Add ifdef around getSubtargetFeatureName in tablegen output file so that only targets...
authorCraig Topper <craig.topper@gmail.com>
Wed, 25 Apr 2012 06:56:34 +0000 (06:56 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 25 Apr 2012 06:56:34 +0000 (06:56 +0000)
llvm-svn: 155538

llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/utils/TableGen/AsmMatcherEmitter.cpp

index cbd9bdb..3fe681f 100644 (file)
@@ -7595,5 +7595,6 @@ extern "C" void LLVMInitializeARMAsmParser() {
 }
 
 #define GET_REGISTER_MATCHER
+#define GET_SUBTARGET_FEATURE_NAME
 #define GET_MATCHER_IMPLEMENTATION
 #include "ARMGenAsmMatcher.inc"
index 03807b1..8375168 100644 (file)
@@ -2395,13 +2395,17 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
 
   OS << "#endif // GET_REGISTER_MATCHER\n\n";
 
-
-  OS << "\n#ifdef GET_MATCHER_IMPLEMENTATION\n";
-  OS << "#undef GET_MATCHER_IMPLEMENTATION\n\n";
+  OS << "\n#ifdef GET_SUBTARGET_FEATURE_NAME\n";
+  OS << "#undef GET_SUBTARGET_FEATURE_NAME\n\n";
 
   // Generate the helper function to get the names for subtarget features.
   emitGetSubtargetFeatureName(Info, OS);
 
+  OS << "#endif // GET_SUBTARGET_FEATURE_NAME\n\n";
+
+  OS << "\n#ifdef GET_MATCHER_IMPLEMENTATION\n";
+  OS << "#undef GET_MATCHER_IMPLEMENTATION\n\n";
+
   // Generate the function that remaps for mnemonic aliases.
   bool HasMnemonicAliases = emitMnemonicAliases(OS, Info);