Skip to content

Commit

Permalink
Precompiled headers: initial support.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96919 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Mikhail Glushenkov committed Feb 23, 2010
1 parent be6ee7c commit c6e0dbf
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions tools/llvmc/plugins/Base/Base.td.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"]>,
Expand All @@ -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">,
Expand Down

0 comments on commit c6e0dbf

Please sign in to comment.