From a778d7d97349f8d8a21faefe66e108470380b7f3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 22 Oct 2008 17:29:21 +0000 Subject: [PATCH] Add support for assembler-with-cpp (preprocessed .S files), patch by Roman Divacky! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57988 91177308-0d34-0410-b5e6-96231b3b80d8 --- Driver/clang.cpp | 10 +++++++++- utils/ccc | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 34f6cb698e..9a106c70b8 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -207,6 +207,7 @@ enum LangKind { langkind_unspecified, langkind_c, langkind_c_cpp, + langkind_asm_cpp, langkind_c_pch, langkind_cxx, langkind_cxx_cpp, @@ -219,7 +220,7 @@ enum LangKind { /* TODO: GCC also accepts: c-header c++-header objective-c-header objective-c++-header - assembler assembler-with-cpp + assembler ada, f77*, ratfor (!), f95, java, treelang */ static llvm::cl::opt @@ -231,6 +232,8 @@ BaseLang("x", llvm::cl::desc("Base language to compile"), clEnumValN(langkind_objcxx,"objective-c++","Objective C++"), clEnumValN(langkind_c_cpp, "c-cpp-output", "Preprocessed C"), + clEnumValN(langkind_asm_cpp, "assembler-with-cpp", + "Preprocessed asm"), clEnumValN(langkind_cxx_cpp, "c++-cpp-output", "Preprocessed C++"), clEnumValN(langkind_objc_cpp, "objective-c-cpp-output", @@ -276,6 +279,8 @@ static LangKind GetLanguage(const std::string &Filename) { // assembler: .S if (Ext == "c") return langkind_c; + else if (Ext == "S" || Ext == "s") + return langkind_asm_cpp; else if (Ext == "i") return langkind_c_cpp; else if (Ext == "ii") @@ -316,6 +321,8 @@ static bool InitializeLangOptions(LangOptions &Options, LangKind LK){ InitializeCOptions(Options); PCH = true; break; + case langkind_asm_cpp: + // FALLTHROUGH case langkind_c_cpp: NoPreprocess = true; // FALLTHROUGH @@ -458,6 +465,7 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK, switch (LK) { default: assert(0 && "Unknown base language"); case langkind_c: + case langkind_asm_cpp: case langkind_c_cpp: case langkind_c_pch: case langkind_objc: diff --git a/utils/ccc b/utils/ccc index f0821ca524..96548553ea 100755 --- a/utils/ccc +++ b/utils/ccc @@ -36,7 +36,7 @@ CCC_LOG = checkenv('CCC_LOG') CCC_ECHO = checkbool('CCC_ECHO') CCC_NATIVE = checkbool('CCC_NATIVE','1') CCC_FALLBACK = checkbool('CCC_FALLBACK') -CCC_LANGUAGES = checkenv('CCC_LANGUAGES','c,c++,c-cpp-output,objective-c,objective-c++,objective-c-cpp-output') +CCC_LANGUAGES = checkenv('CCC_LANGUAGES','c,c++,c-cpp-output,objective-c,objective-c++,objective-c-cpp-output,assembler-with-cpp') if CCC_LANGUAGES: CCC_LANGUAGES = set([s.strip() for s in CCC_LANGUAGES.split(',')]) -- 2.40.0