aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-04-25 06:56:34 +0000
committerCraig Topper <craig.topper@gmail.com>2012-04-25 06:56:34 +0000
commit8030e1a0df630ec6ed1cd5ec673f6472558a4dbe (patch)
tree06d448069385ea69bb0c6c4bedb1d0b955899e2a
parentc16f851569eff1c2296e6addf341c9797e386f01 (diff)
downloadexternal_llvm-8030e1a0df630ec6ed1cd5ec673f6472558a4dbe.zip
external_llvm-8030e1a0df630ec6ed1cd5ec673f6472558a4dbe.tar.gz
external_llvm-8030e1a0df630ec6ed1cd5ec673f6472558a4dbe.tar.bz2
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155538 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp1
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp10
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index cbd9bdb..3fe681f 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -7595,5 +7595,6 @@ extern "C" void LLVMInitializeARMAsmParser() {
}
#define GET_REGISTER_MATCHER
+#define GET_SUBTARGET_FEATURE_NAME
#define GET_MATCHER_IMPLEMENTATION
#include "ARMGenAsmMatcher.inc"
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index 03807b1..8375168 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -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);