summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_gcc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-08-17 15:43:25 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-08-17 15:43:25 +0000
commit3bc4f8f6a26b3d7f367a419e0a0dac3563766821 (patch)
tree5930b32d969025cbe17cf110f1966106bfe47f92 /Completion/Unix/Command/_gcc
parente92a823a4b143f42dcb867f74f25b074cd991666 (diff)
downloadzsh-3bc4f8f6a26b3d7f367a419e0a0dac3563766821.tar.gz
zsh-3bc4f8f6a26b3d7f367a419e0a0dac3563766821.zip
30632: gcc completion enhancements for clang etc.
Diffstat (limited to 'Completion/Unix/Command/_gcc')
-rw-r--r--Completion/Unix/Command/_gcc19
1 files changed, 17 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index 402797aa2..b14c13334 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -1,4 +1,4 @@
-#compdef gcc g++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default-
+#compdef gcc g++ cc c++ llvm-gcc llvm-g++ clang clang++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default-
local curcontext="$curcontext" state line ret=1 expl args args2
typeset -A opt_args
@@ -210,10 +210,23 @@ h8/300)
;;
esac
+if [[ "$service" = clang* ]]; then
+ args=(
+ $args
+ -flto -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
+ )
+fi
+
_arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \
"$args[@]" \
-c -S -E -v -a -w -C -H -P -s '(-pg)-p' '(-p)-pg' \
+ '-###[print commands to run this compilation]' \
'-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' \
'-x:input file language:(c objective-c c++ c-header cpp-output c++-cpp-output assembler assembler-with-cpp none)' \
'+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' \
@@ -226,6 +239,7 @@ _arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \
'*-U-:undefine macro:' \
'*-Wp,-:preprocessor option:' \
'*-Wl,-:linker option:' \
+ '*-Xpreprocessor:preprocessor option:' \
'*-Xlinker:linker option:' \
'*-u:pretend symbol to be undefined:' \
'*-Wa,-:assembler option:' \
@@ -234,7 +248,8 @@ _arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \
'*-I-:header file search path:_files -/' \
'-B-:executable prefix:_files -/' \
'-b:target machine:' \
- '-V:gcc version:' \
+ '-V:specify compiler version:' \
+ '--version' \
'-print-file-name=:library:->library' \
'-print-prog-name=:program:' \
'*-include:include file:_files -g \*.h\(-.\)' \