summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-07-07 05:19:25 +0000
committerCraig Topper <craig.topper@intel.com>2017-07-07 05:19:25 +0000
commit2b347eb15a75ddd5c057596948757202c578a168 (patch)
tree6f485932d0af81b730811934e0e4fa8f233f877a
parent66631a12b833ffffa643bb67042811fe163cebae (diff)
downloadbcm5719-llvm-2b347eb15a75ddd5c057596948757202c578a168.tar.gz
bcm5719-llvm-2b347eb15a75ddd5c057596948757202c578a168.zip
[TableGen] Fix some mismatches in the use of Namespace fields versus Target name in some of our emitters.
Some of our emitters were using the name of the Target to reference things that were created by others emitters using Namespace. Apparently all targets have the same Target name as their instruction and register Namespace field? Someone on IRC had a target that didn't do this and was getting build errors. This patch is a necessary, but maybe not sufficient fix. llvm-svn: 307358
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp4
-rw-r--r--llvm/utils/TableGen/RegisterBankEmitter.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index b73a4f17527..1f8e1b12588 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2222,7 +2222,7 @@ static void emitValidateOperandClass(AsmMatcherInfo &Info,
OS << " switch (Operand.getReg()) {\n";
OS << " default: OpKind = InvalidMatchClass; break;\n";
for (const auto &RC : Info.RegisterClasses)
- OS << " case " << Info.Target.getName() << "::"
+ OS << " case " << RC.first->getValueAsString("Namespace") << "::"
<< RC.first->getName() << ": OpKind = " << RC.second->Name
<< "; break;\n";
OS << " }\n";
@@ -2989,7 +2989,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
std::string LenMnemonic = char(MI->Mnemonic.size()) + MI->Mnemonic.str();
OS << " { " << StringTable.GetOrAddStringOffset(LenMnemonic, false)
<< " /* " << MI->Mnemonic << " */, "
- << Target.getName() << "::"
+ << Target.getInstNamespace() << "::"
<< MI->getResultInst()->TheDef->getName() << ", "
<< MI->ConversionFnKind << ", ";
diff --git a/llvm/utils/TableGen/RegisterBankEmitter.cpp b/llvm/utils/TableGen/RegisterBankEmitter.cpp
index 3f11eff1d37..880d075da42 100644
--- a/llvm/utils/TableGen/RegisterBankEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterBankEmitter.cpp
@@ -227,7 +227,7 @@ void RegisterBankEmitter::emitBaseClassImplementation(
OS << " // " << LowestIdxInWord << "-" << (LowestIdxInWord + 31) << "\n";
for (const auto &RC : RCs) {
std::string QualifiedRegClassID =
- (Twine(TargetName) + "::" + RC->getName() + "RegClassID").str();
+ (Twine(RC->Namespace) + "::" + RC->getName() + "RegClassID").str();
OS << " (1u << (" << QualifiedRegClassID << " - "
<< LowestIdxInWord << ")) |\n";
}
OpenPOWER on IntegriCloud