[llvm-commits] [llvm] r155538 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp utils/TableGen/AsmMatcherEmitter.cpp

Craig Topper craig.topper at gmail.com
Tue Apr 24 23:56:34 PDT 2012


Author: ctopper
Date: Wed Apr 25 01:56:34 2012
New Revision: 155538

URL: http://llvm.org/viewvc/llvm-project?rev=155538&view=rev
Log:
Add ifdef around getSubtargetFeatureName in tablegen output file so that only targets that want the function get it. This prevents other targets from getting an unused function warning.

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

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=155538&r1=155537&r2=155538&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Wed Apr 25 01:56:34 2012
@@ -7595,5 +7595,6 @@
 }
 
 #define GET_REGISTER_MATCHER
+#define GET_SUBTARGET_FEATURE_NAME
 #define GET_MATCHER_IMPLEMENTATION
 #include "ARMGenAsmMatcher.inc"

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=155538&r1=155537&r2=155538&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Apr 25 01:56:34 2012
@@ -2395,13 +2395,17 @@
 
   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);
 





More information about the llvm-commits mailing list