From 8be82e83c039370123ff85826b5f4efd258115a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 09:01:31 +0800 Subject: [PATCH 1/8] sorrry I forgot that --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 9cff4bc5..bdaf3733 100644 --- a/src/main.c +++ b/src/main.c @@ -40,7 +40,7 @@ static const char help_fmt[] = "\n" "Options:\n" " -o OUTFILE output an executable file, don't run the code\n" - " -O0/-O1/-O2/-O3 set optimization level (0 = default, 3 = runs fastest)\n" + " -O0/-O1/-O2/-O3 set optimization level (1 = default, 3 = runs fastest)\n" " -v / --verbose display some progress information\n" " -vv display a lot of information about all compilation steps\n" " --valgrind use valgrind when running the code\n" @@ -55,9 +55,8 @@ void parse_arguments(int argc, char **argv) { memset(&command_line_args, 0, sizeof command_line_args); command_line_args.argv0 = argv[0]; - command_line_args.optlevel = 1; /* Set default optimize to O1 - User sets optimize will overwrite the default flag - */ + /* Set default optimize to O1, user sets optimize will overwrite the default flag*/ + command_line_args.optlevel = 1; if (argc == 2 && !strcmp(argv[1], "--help")) { // Print help. From 0c19b888768ec3f558ab148cdb09534453765d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 09:11:21 +0800 Subject: [PATCH 2/8] sync --- tests/should_succeed/compiler_cli.jou | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/should_succeed/compiler_cli.jou b/tests/should_succeed/compiler_cli.jou index df9b3a8c..95b6d1cd 100644 --- a/tests/should_succeed/compiler_cli.jou +++ b/tests/should_succeed/compiler_cli.jou @@ -37,7 +37,7 @@ def main() -> int: # Output: # Output: Options: # Output: -o OUTFILE output an executable file, don't run the code - # Output: -O0/-O1/-O2/-O3 set optimization level (0 = default, 3 = runs fastest) + # Output: -O0/-O1/-O2/-O3 set optimization level (1 = default, 3 = runs fastest) # Output: -v / --verbose display some progress information # Output: -vv display a lot of information about all compilation steps # Output: --valgrind use valgrind when running the code From 48ad60483be479b7becd228252e4b08bfed37e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 09:12:06 +0800 Subject: [PATCH 3/8] add note --- src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.c b/src/main.c index bdaf3733..ed8e847b 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ static void optimize(LLVMModuleRef module, int level) LLVMDisposePassManager(pm); } +/* Sync with tests/should_succeed/compiler_cli.jou */ static const char help_fmt[] = "Usage:\n" " [-o OUTFILE] [-O0|-O1|-O2|-O3] [--verbose] [--linker-flags \"...\"] FILENAME\n" From 55a190e7ba51c37bb3cf6745768175df6a10ced9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 09:15:17 +0800 Subject: [PATCH 4/8] what are you doing vscode I forget to install the editorconfig plugin? --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index ed8e847b..2c314475 100644 --- a/src/main.c +++ b/src/main.c @@ -57,7 +57,7 @@ void parse_arguments(int argc, char **argv) memset(&command_line_args, 0, sizeof command_line_args); command_line_args.argv0 = argv[0]; /* Set default optimize to O1, user sets optimize will overwrite the default flag*/ - command_line_args.optlevel = 1; + command_line_args.optlevel = 1; if (argc == 2 && !strcmp(argv[1], "--help")) { // Print help. From 14accd4b7e9349f0736e1d6df0fcf9adfb98e3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 20:57:35 +0800 Subject: [PATCH 5/8] Update src/main.c Co-authored-by: Akuli --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 2c314475..53afa36a 100644 --- a/src/main.c +++ b/src/main.c @@ -41,7 +41,7 @@ static const char help_fmt[] = "\n" "Options:\n" " -o OUTFILE output an executable file, don't run the code\n" - " -O0/-O1/-O2/-O3 set optimization level (1 = default, 3 = runs fastest)\n" + " -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest)\n" " -v / --verbose display some progress information\n" " -vv display a lot of information about all compilation steps\n" " --valgrind use valgrind when running the code\n" From 15d7546f940182e047644e07ef98cd93e444a037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 20:57:56 +0800 Subject: [PATCH 6/8] Update src/main.c --- src/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.c b/src/main.c index 53afa36a..17129562 100644 --- a/src/main.c +++ b/src/main.c @@ -32,7 +32,6 @@ static void optimize(LLVMModuleRef module, int level) LLVMDisposePassManager(pm); } -/* Sync with tests/should_succeed/compiler_cli.jou */ static const char help_fmt[] = "Usage:\n" " [-o OUTFILE] [-O0|-O1|-O2|-O3] [--verbose] [--linker-flags \"...\"] FILENAME\n" From 4a5fd7257c62c3616962edf1ce270810a58fc22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 20:58:56 +0800 Subject: [PATCH 7/8] Update compiler_cli.jou --- tests/should_succeed/compiler_cli.jou | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/should_succeed/compiler_cli.jou b/tests/should_succeed/compiler_cli.jou index 95b6d1cd..10b6db35 100644 --- a/tests/should_succeed/compiler_cli.jou +++ b/tests/should_succeed/compiler_cli.jou @@ -37,7 +37,7 @@ def main() -> int: # Output: # Output: Options: # Output: -o OUTFILE output an executable file, don't run the code - # Output: -O0/-O1/-O2/-O3 set optimization level (1 = default, 3 = runs fastest) + # Output: -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest)" # Output: -v / --verbose display some progress information # Output: -vv display a lot of information about all compilation steps # Output: --valgrind use valgrind when running the code From b5b511265c29af368daea564307bb7331d39f754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD=E4=BA=91?= <71159641+littlewhitecloud@users.noreply.github.com> Date: Sun, 17 Dec 2023 21:04:43 +0800 Subject: [PATCH 8/8] Update compiler_cli.jou --- tests/should_succeed/compiler_cli.jou | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/should_succeed/compiler_cli.jou b/tests/should_succeed/compiler_cli.jou index 10b6db35..abf56f03 100644 --- a/tests/should_succeed/compiler_cli.jou +++ b/tests/should_succeed/compiler_cli.jou @@ -37,7 +37,7 @@ def main() -> int: # Output: # Output: Options: # Output: -o OUTFILE output an executable file, don't run the code - # Output: -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest)" + # Output: -O0/-O1/-O2/-O3 set optimization level (0 = no optimization, 1 = default, 3 = runs fastest) # Output: -v / --verbose display some progress information # Output: -vv display a lot of information about all compilation steps # Output: --valgrind use valgrind when running the code