mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
[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
This commit is contained in:
parent
8ef979bdc8
commit
7d14114241
@ -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 << ", ";
|
||||
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user