diff options
| author | 2025-09-08 22:05:33 +0200 | |
|---|---|---|
| committer | 2025-09-08 22:05:33 +0200 | |
| commit | e043811980db560fc2507bb53b644e54c80527dc (patch) | |
| tree | 6ea563d81c9d3767f439e361fc2c884cf4f9b64d /main.c | |
| parent | 36b5b19bf183cb01525201ccbddd6afa692f21bb (diff) | |
regalloc: start implementing linear scan
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -86,6 +86,8 @@ static struct task { bool verbose; } task; +static void prihelp(void); + static void optparse(char **args) { @@ -101,7 +103,10 @@ optparse(char **args) ft = IFTauto; continue; } - if ((x = optval(arg, "std"))) { + if (!strcmp(arg, "help") || !strcmp(arg, "h") || !strcmp(arg, "-help")) { + prihelp(); + exit(0); + } else if ((x = optval(arg, "std"))) { if (!strcmp(x, "c89") || !strcmp(x, "c90")) ccopt.cstd = STDC89; else if (!strcmp(x, "c99")) ccopt.cstd = STDC99; else if (!strcmp(x, "c11")) ccopt.cstd = STDC11; @@ -266,6 +271,21 @@ dolink(void) return WEXITSTATUS(wstat); } +static void +prihelp(void) +{ + pfmt("Usage: antcc [options] file...\n\n" + "Options:\n" + " -help \tPrint this help message\n" + " -std=<..> \tSet C standard\n" + " -pedantic \tWarnings for strict standards compliance\n" + " -d{pailrm} \tDebug options\n" + " -o <file> \tPlace the output into <file>\n" + " -v \tVerbose output\n" + " -c \tEmit object file but do not link\n" + ); +} + static int driver(void) { |