Make -fsyntax-only, -include and -emit-llvm work for C++ and Objective-C/C++.
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 25 Nov 2008 21:35:20 +0000 (21:35 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 25 Nov 2008 21:35:20 +0000 (21:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60047 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CompilerDriver/Tools.td

index fa2cd33ffbdde88033b35f48a90e2f813e29e60d..930092d8dfb43d4ee4597a67d4ea210a1f5886e4 100644 (file)
@@ -22,7 +22,7 @@ def llvm_gcc_c : Tool<
                     (default),
                     "llvm-gcc -E -x c++ $INFILE"),
             (switch_on "fsyntax-only"),
-              "llvm-gcc -c -x c $INFILE",
+              "llvm-gcc -fsyntax-only -x c $INFILE",
             (default),
               "llvm-gcc -c -x c $INFILE -o $OUTFILE -emit-llvm")),
  (switch_option "emit-llvm", (stop_compilation),
@@ -46,9 +46,14 @@ def llvm_gcc_cpp : Tool<
                     "llvm-g++ -E -x c++ $INFILE -o $OUTFILE",
                     (default),
                     "llvm-g++ -E -x c++ $INFILE"),
+            (switch_on "fsyntax-only"),
+              "llvm-g++ -fsyntax-only -x c++ $INFILE",
             (default),
               "llvm-g++ -c -x c++ $INFILE -o $OUTFILE -emit-llvm")),
+ (switch_option "emit-llvm", (stop_compilation)),
  (switch_option "E", (stop_compilation)),
+ (switch_option "fsyntax-only", (stop_compilation)),
+ (parameter_list_option "include", (forward)),
  (sink)
 ]>;
 
@@ -62,9 +67,14 @@ def llvm_gcc_m : Tool<
                     "llvm-gcc -E -x objective-c $INFILE -o $OUTFILE",
                     (default),
                     "llvm-gcc -E -x objective-c $INFILE"),
+            (switch_on "fsyntax-only"),
+              "llvm-gcc -fsyntax-only -x objective-c $INFILE",
             (default),
               "llvm-gcc -c -x objective-c $INFILE -o $OUTFILE -emit-llvm")),
+ (switch_option "emit-llvm", (stop_compilation)),
  (switch_option "E", (stop_compilation)),
+ (switch_option "fsyntax-only", (stop_compilation)),
+ (parameter_list_option "include", (forward)),
  (sink)
 ]>;
 
@@ -78,9 +88,14 @@ def llvm_gcc_mxx : Tool<
                     "llvm-gcc -E -x objective-c++ $INFILE -o $OUTFILE",
                     (default),
                     "llvm-gcc -E -x objective-c++ $INFILE"),
+            (switch_on "fsyntax-only"),
+              "llvm-gcc -fsyntax-only -x objective-c++ $INFILE",
             (default),
               "llvm-gcc -c -x objective-c++ $INFILE -o $OUTFILE -emit-llvm")),
+ (switch_option "emit-llvm", (stop_compilation)),
  (switch_option "E", (stop_compilation)),
+ (switch_option "fsyntax-only", (stop_compilation)),
+ (parameter_list_option "include", (forward)),
  (sink)
 ]>;