From e043811980db560fc2507bb53b644e54c80527dc Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 8 Sep 2025 22:05:33 +0200 Subject: regalloc: start implementing linear scan --- main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 35d25ac..3ec4f95 100644 --- a/main.c +++ b/main.c @@ -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 \tPlace the output into \n" + " -v \tVerbose output\n" + " -c \tEmit object file but do not link\n" + ); +} + static int driver(void) { -- cgit v1.2.3