aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvmc
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-09-21 14:59:47 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-09-21 14:59:47 +0000
commit47e87db3a1ef79816e1a4fc6b1b450fcd5daf77d (patch)
treed0a69ca2db3ea7c621610f63d1b0888cd9f4a5a9 /tools/llvmc
parent46aa524f0d34c21ccd64d674ae3628c69fb9883e (diff)
downloadexternal_llvm-47e87db3a1ef79816e1a4fc6b1b450fcd5daf77d.zip
external_llvm-47e87db3a1ef79816e1a4fc6b1b450fcd5daf77d.tar.gz
external_llvm-47e87db3a1ef79816e1a4fc6b1b450fcd5daf77d.tar.bz2
llvmc: split llvm_gcc_based into llvm_gcc_{pch,comp}_based.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc')
-rw-r--r--tools/llvmc/src/Base.td.in46
1 files changed, 26 insertions, 20 deletions
diff --git a/tools/llvmc/src/Base.td.in b/tools/llvmc/src/Base.td.in
index f82276c..12c283a 100644
--- a/tools/llvmc/src/Base.td.in
+++ b/tools/llvmc/src/Base.td.in
@@ -165,10 +165,10 @@ def Preprocess : OptionPreprocessor<
// Tools
class llvm_gcc_based <string cmd, string in_lang,
- string E_ext, string out_lang> : Tool<
+ string E_ext, string out_lang, string out_ext> : Tool<
[(in_language in_lang),
- (out_language "llvm-bitcode"),
- (output_suffix out_lang),
+ (out_language out_lang),
+ (output_suffix out_ext),
(command cmd),
(actions
(case
@@ -214,24 +214,29 @@ class llvm_gcc_based <string cmd, string in_lang,
(sink)
]>;
-def llvm_gcc_c : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x c", "c", "i", "bc">;
-def llvm_gcc_cpp : llvm_gcc_based<"@LLVMGXXCOMMAND@ -x c++", "c++", "i", "bc">;
-def llvm_gcc_m : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c",
- "objective-c", "mi", "bc">;
-def llvm_gcc_mxx : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c++",
- "objective-c++", "mi", "bc">;
+class llvm_gcc_comp_based <string cmd, string in_lang, string E_ext>
+: llvm_gcc_based<cmd, in_lang, E_ext, "llvm-bitcode", "bc">;
+
+class llvm_gcc_pch_based <string cmd, string in_lang, string E_ext>
+: llvm_gcc_based<cmd, in_lang, E_ext, "precompiled-header", "gch">;
+
+def llvm_gcc_c : llvm_gcc_comp_based
+ <"@LLVMGCCCOMMAND@ -x c", "c", "i">;
+def llvm_gcc_cpp : llvm_gcc_comp_based
+ <"@LLVMGXXCOMMAND@ -x c++", "c++", "i">;
+def llvm_gcc_m : llvm_gcc_comp_based
+ <"@LLVMGCCCOMMAND@ -x objective-c", "objective-c", "mi">;
+def llvm_gcc_mxx : llvm_gcc_comp_based
+ <"@LLVMGCCCOMMAND@ -x objective-c++", "objective-c++", "mi">;
-def llvm_gcc_c_pch : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x c-header",
- "c-header", "i", "gch">;
-def llvm_gcc_cpp_pch : llvm_gcc_based<"@LLVMGXXCOMMAND@ -x c++-header",
- "c++-header",
- "i", "gch">;
-def llvm_gcc_m_pch : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c-header",
- "objective-c-header",
- "mi", "gch">;
-def llvm_gcc_mxx_pch
- : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c++-header",
- "objective-c++-header", "mi", "gch">;
+def llvm_gcc_c_pch : llvm_gcc_pch_based
+ <"@LLVMGCCCOMMAND@ -x c-header", "c-header", "i">;
+def llvm_gcc_cpp_pch : llvm_gcc_pch_based
+ <"@LLVMGXXCOMMAND@ -x c++-header", "c++-header", "i">;
+def llvm_gcc_m_pch : llvm_gcc_pch_based
+ <"@LLVMGCCCOMMAND@ -x objective-c-header", "objective-c-header", "mi">;
+def llvm_gcc_mxx_pch : llvm_gcc_pch_based
+ <"@LLVMGCCCOMMAND@ -x objective-c++-header", "objective-c++-header", "mi">;
def opt : Tool<
[(in_language "llvm-bitcode"),
@@ -343,6 +348,7 @@ def llvm_gcc_cpp_linker : llvm_gcc_based_linker<"@LLVMGXXCOMMAND@",
// Language map
def LanguageMap : LanguageMap<[
+ (lang_to_suffixes "precompiled-header", ["gch", "pch"]),
(lang_to_suffixes "c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]),
(lang_to_suffixes "c++-header", "hpp"),
(lang_to_suffixes "c", "c"),