Precompiled headers: initial support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96919 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2010-02-23 09:04:33 +00:00
parent be6ee7c116
commit c6e0dbf1dd

View File

@ -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">,