aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-02-23 09:04:33 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-02-23 09:04:33 +0000
commitc6e0dbf1ddb767e6587bbf340b8dc66a20b7cfea (patch)
tree7929b2b13c510a405b506b5c2aa86dfade4c269b /tools
parentbe6ee7c116f8f768a180df6eba6799a6660722e7 (diff)
downloadexternal_llvm-c6e0dbf1ddb767e6587bbf340b8dc66a20b7cfea.zip
external_llvm-c6e0dbf1ddb767e6587bbf340b8dc66a20b7cfea.tar.gz
external_llvm-c6e0dbf1ddb767e6587bbf340b8dc66a20b7cfea.tar.bz2
Precompiled headers: initial support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvmc/plugins/Base/Base.td.in34
1 files changed, 28 insertions, 6 deletions
diff --git a/tools/llvmc/plugins/Base/Base.td.in b/tools/llvmc/plugins/Base/Base.td.in
index d36554c..5f09664 100644
--- a/tools/llvmc/plugins/Base/Base.td.in
+++ b/tools/llvmc/plugins/Base/Base.td.in
@@ -130,10 +130,11 @@ def Preprocess : OptionPreprocessor<
// Tools
-class llvm_gcc_based <string cmd_prefix, string in_lang, string E_ext> : Tool<
+class llvm_gcc_based <string cmd_prefix, string in_lang,
+ string E_ext, string out_lang> : Tool<
[(in_language in_lang),
(out_language "llvm-bitcode"),
- (output_suffix "bc"),
+ (output_suffix out_lang),
(cmd_line (case
(switch_on "E"),
(case (not_empty "o"),
@@ -180,12 +181,24 @@ class llvm_gcc_based <string cmd_prefix, string in_lang, string E_ext> : Tool<
(sink)
]>;
-def llvm_gcc_c : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x c", "c", "i">;
-def llvm_gcc_cpp : llvm_gcc_based<"@LLVMGXXCOMMAND@ -x c++", "c++", "i">;
+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">;
+ "objective-c", "mi", "bc">;
def llvm_gcc_mxx : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c++",
- "objective-c++", "mi">;
+ "objective-c++", "mi", "bc">;
+
+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 opt : Tool<
[(in_language "llvm-bitcode"),
@@ -278,11 +291,15 @@ def llvm_gcc_cpp_linker : llvm_gcc_based_linker<"@LLVMGXXCOMMAND@">;
def LanguageMap : LanguageMap<
[LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
+ LangToSuffixes<"c++-header", ["hpp"]>,
LangToSuffixes<"c", ["c"]>,
+ LangToSuffixes<"c-header", ["h"]>,
LangToSuffixes<"c-cpp-output", ["i"]>,
LangToSuffixes<"objective-c-cpp-output", ["mi"]>,
LangToSuffixes<"objective-c++", ["mm"]>,
+ LangToSuffixes<"objective-c++-header", ["hmm"]>,
LangToSuffixes<"objective-c", ["m"]>,
+ LangToSuffixes<"objective-c-header", ["hm"]>,
LangToSuffixes<"assembler", ["s"]>,
LangToSuffixes<"assembler-with-cpp", ["S"]>,
LangToSuffixes<"llvm-assembler", ["ll"]>,
@@ -301,6 +318,11 @@ def CompilationGraph : CompilationGraph<[
Edge<"root", "llvm_gcc_mxx">,
Edge<"root", "llc">,
+ Edge<"root", "llvm_gcc_c_pch">,
+ Edge<"root", "llvm_gcc_cpp_pch">,
+ Edge<"root", "llvm_gcc_m_pch">,
+ Edge<"root", "llvm_gcc_mxx_pch">,
+
Edge<"llvm_gcc_c", "llc">,
Edge<"llvm_gcc_cpp", "llc">,
Edge<"llvm_gcc_m", "llc">,