From 810b5c8ab99340fc0cf4c224697d1d069ab3d90b Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Mon, 18 Jun 2018 05:14:46 +0000 Subject: 43048: add sanitizers, standards aliases and fix -flto --- Completion/Unix/Command/_gcc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command/_gcc') diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index a552bb2db..9690df79f 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -338,16 +338,31 @@ h8/300) ;; esac +local -a sanitizers if [[ "$service" = clang* ]]; then args=( $args - -flto -emit-llvm + "-flto=-[generate output files suitable for link time optimization]::style:(full thin)" + -emit-llvm "-Qunused-arguments[don't emit warning for unused driver arguments]" --analyze -fshow-column -fshow-source-location -fcaret-diagnostics -fdiagnostics-fixit-info -fdiagnostics-parseable-fixits -fdiagnostics-print-source-range-info -fprint-source-range-info -fdiagnostics-show-option -fmessage-length ) + sanitizers=( + address alignment bool bounds enum float-cast-overflow float-divide-by-zero + integer-divide-by-zero memory nonnull-attribute null nullability-arg nullability-assign + nullability-return object-size pointer-overflow return unsigned-integer-overflow + returns-nonnull-attribute shift signed-integer-overflow unreachable vla-bound vptr + ) +else + args=( + '-flto=-[Enable link-time optimization]::jobs:' + ) + sanitizers=( + address memory + ) fi local -a languages @@ -399,7 +414,7 @@ args+=( '-print-file-name=-[Display the full path to library ]:library:->library' '-print-prog-name=-[Display the full path to compiler component ]:program:' '*-specs=-[Override built-in specs with the contents of ]:file:_files' - '-std=-[assume that the input sources are for specified standard]:standard:(c90 c89 c99 c11 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 gnu++17 c++2a gnu++2a)' + '-std=-[assume that the input sources are for specified standard]:standard:(c90 c89 iso9899:1990 iso9899:199409 c99 iso9899:1999 c11 iso9899:2011 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 iso9899:2017 gnu++17 c++2a gnu++2a)' '*-include:include file:_files -g \*.h\(-.\)' '*-imacros:macro input file:_files -g \*.h\(-.\)' '*-idirafter:second include path directory:_files -/' @@ -1034,7 +1049,6 @@ args+=( '-flto-odr-type-merging[Merge C++ types using One Definition Rule]' '-flto-partition=-[Partition symbols and vars at linktime based on object files they originate from]:partitioning algorithm:(1to1 balanced max one none)' '-flto-report[Report various link-time optimization statistics]' - '-flto=-[Enable link-time optimization]::jobs:' '-fmax-errors=-[Maximum number of errors to report]:errors: ' '-fmem-report-wpa[Report on permanent memory allocation in WPA only]' '-fmem-report[Report on permanent memory allocation]' @@ -1061,7 +1075,7 @@ args+=( '-freciprocal-math[Same as -fassociative-math for expressions which include division]' '-frecord-gcc-switches[Record gcc command line switches in the object file]' '-free[Turn on Redundant Extensions Elimination pass]' - '-fsanitize=-[Enable AddressSanitizer, a memory error detector]:style:(address thread)' + "-fsanitize=-[Enable AddressSanitizer, a memory error detector]:style:($sanitizers)" '-fsched-stalled-insns-dep=-[Set dependence distance checking in premature scheduling of queued insns]:instructions: ' '-fsched-stalled-insns=-[Set number of queued insns that can be prematurely scheduled]:instructions: ' '-fsched-verbose=-[Set the verbosity level of the scheduler]:verbosity: ' -- cgit v1.2.3 From 03b2cd1bb013212d1f6c2b897156ac87b455c2ee Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Tue, 19 Jun 2018 23:54:55 +0000 Subject: 43074: Completion for additional linker options for clang and sanitizers for gcc --- ChangeLog | 3 +++ Completion/Unix/Command/_gcc | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command/_gcc') diff --git a/ChangeLog b/ChangeLog index c05911bd1..fe2f3192c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-06-18 Oliver Kiddle + * 43074: Eitan: Completion/Unix/Command/_gcc: Completion for + additional linker options for clang and sanitizers for gcc + * 43078: Completion/Unix/Command/_sed: add completion for the sed expression diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 9690df79f..5817318f6 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -338,7 +338,6 @@ h8/300) ;; esac -local -a sanitizers if [[ "$service" = clang* ]]; then args=( $args @@ -349,21 +348,23 @@ if [[ "$service" = clang* ]]; then -fshow-column -fshow-source-location -fcaret-diagnostics -fdiagnostics-fixit-info -fdiagnostics-parseable-fixits -fdiagnostics-print-source-range-info -fprint-source-range-info -fdiagnostics-show-option -fmessage-length - ) - sanitizers=( - address alignment bool bounds enum float-cast-overflow float-divide-by-zero - integer-divide-by-zero memory nonnull-attribute null nullability-arg nullability-assign - nullability-return object-size pointer-overflow return unsigned-integer-overflow - returns-nonnull-attribute shift signed-integer-overflow unreachable vla-bound vptr + "-nostdinc[Do not search standard system directories or compiler builtin directories for include files]" + "-nostdlibinc[Do not search standard system directories for include files]" + "-nobuiltininc[Do not search builtin directory for include files]" ) else args=( '-flto=-[Enable link-time optimization]::jobs:' ) +fi + +local -a sanitizers sanitizers=( - address memory + address alignment bool bounds enum float-cast-overflow float-divide-by-zero + integer-divide-by-zero memory nonnull-attribute null nullability-arg nullability-assign + nullability-return object-size pointer-overflow return unsigned-integer-overflow + returns-nonnull-attribute shift signed-integer-overflow unreachable vla-bound vptr ) -fi local -a languages languages=( @@ -965,7 +966,7 @@ args+=( args+=( '-nostartfiles[Do not use the standard system startup files when linking]' '-nodefaultlibs[Do not use the standard system libraries when linking]' - '-nostdlib[Do not use the standard system startup files or libraries when linking]' + '-nostdlib[Do not use standard system startup files or libraries when linking]' '-rdynamic[Pass the flag -export-dynamic to the ELF linker, on targets that support it]' '-s[Remove all symbol table and relocation information from the executable]' '-static[On systems that support dynamic linking, this prevents linking with the shared libraries]' -- cgit v1.2.3 From 7facf9695078c9ae5d16d0bf4dd11ed0e0b5edb4 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Wed, 11 Jul 2018 00:10:24 +0900 Subject: 43155: _gcc: escape ':' in action for -std --- ChangeLog | 4 ++++ Completion/Unix/Command/_gcc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_gcc') diff --git a/ChangeLog b/ChangeLog index 6e17484aa..3ca47e16e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-07-10 Jun-ichi Takimoto + + * 43155: Completion/Unix/Command/_gcc: escape : in action for -std + 2018-07-10 Peter Stephenson * 43156, 43157: Src/exec.c: need to allow for possible diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 5817318f6..5fcd020bd 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -415,7 +415,7 @@ args+=( '-print-file-name=-[Display the full path to library ]:library:->library' '-print-prog-name=-[Display the full path to compiler component ]:program:' '*-specs=-[Override built-in specs with the contents of ]:file:_files' - '-std=-[assume that the input sources are for specified standard]:standard:(c90 c89 iso9899:1990 iso9899:199409 c99 iso9899:1999 c11 iso9899:2011 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 iso9899:2017 gnu++17 c++2a gnu++2a)' + '-std=-[assume that the input sources are for specified standard]:standard:(c90 c89 iso9899\:1990 iso9899\:199409 c99 iso9899\:1999 c11 iso9899\:2011 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 iso9899\:2017 gnu++17 c++2a gnu++2a)' '*-include:include file:_files -g \*.h\(-.\)' '*-imacros:macro input file:_files -g \*.h\(-.\)' '*-idirafter:second include path directory:_files -/' -- cgit v1.2.3 From 5f2d265b3a9eddb14076cad595bd9f05b03fa069 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Wed, 11 Jul 2018 22:34:03 +0900 Subject: 43164: _gcc: fix 'args=' to 'args+=', and update a few options --- ChangeLog | 5 +++++ Completion/Unix/Command/_gcc | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command/_gcc') diff --git a/ChangeLog b/ChangeLog index 3ca47e16e..39504af85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-07-11 Jun-ichi Takimoto + + * 43164: Completion/Unix/Command/_gcc: fix 'args=' to 'args+=', + and update a few options. + 2018-07-10 Jun-ichi Takimoto * 43155: Completion/Unix/Command/_gcc: escape : in action for -std diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 5fcd020bd..5b97b8c30 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -339,8 +339,7 @@ h8/300) esac if [[ "$service" = clang* ]]; then - args=( - $args + args+=( "-flto=-[generate output files suitable for link time optimization]::style:(full thin)" -emit-llvm "-Qunused-arguments[don't emit warning for unused driver arguments]" @@ -353,7 +352,7 @@ if [[ "$service" = clang* ]]; then "-nobuiltininc[Do not search builtin directory for include files]" ) else - args=( + args+=( '-flto=-[Enable link-time optimization]::jobs:' ) fi @@ -383,7 +382,6 @@ languages=( # generic options (from --help) args+=( - -a -C -H -P -s '-###[print commands to run this compilation]' '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' '-x[Specify the language of the following input files]:input file language:('"$languages"')' @@ -395,6 +393,10 @@ args+=( '*-A-:define assertion:' '*-D-:define macro:' '*-U-:undefine macro:' + '-C[do not discard comments during preprocess]' + '-CC[do not discard comments, including macro expansion]' + '-P[inhibit generation of linkemakers during preprocess]' + '-H[print name of each header file used]' '-E[Preprocess only; do not compile, assemble or link]' '-S[Compile only; do not assemble or link]' '-c[Compile and assemble, but do not link]' -- cgit v1.2.3