From c6e0dbf1ddb767e6587bbf340b8dc66a20b7cfea Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Tue, 23 Feb 2010 09:04:33 +0000 Subject: [PATCH] Precompiled headers: initial support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96919 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvmc/plugins/Base/Base.td.in | 34 ++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/tools/llvmc/plugins/Base/Base.td.in b/tools/llvmc/plugins/Base/Base.td.in index d36554c9da9..5f09664cefa 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 : Tool< +class llvm_gcc_based : 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 : 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">,