mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-23 11:38:38 +00:00
instructions can be in different namespaces. Make sure to use the right
one for each instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28038 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de321a8014
commit
a1e8a80b96
@ -287,12 +287,10 @@ static void EmitInstructions(std::vector<AsmWriterInst> &Insts,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Namespace = FirstInst.CGI->Namespace;
|
O << " case " << FirstInst.CGI->Namespace << "::"
|
||||||
|
|
||||||
O << " case " << Namespace << "::"
|
|
||||||
<< FirstInst.CGI->TheDef->getName() << ":\n";
|
<< FirstInst.CGI->TheDef->getName() << ":\n";
|
||||||
for (unsigned i = 0, e = SimilarInsts.size(); i != e; ++i)
|
for (unsigned i = 0, e = SimilarInsts.size(); i != e; ++i)
|
||||||
O << " case " << Namespace << "::"
|
O << " case " << SimilarInsts[i].CGI->Namespace << "::"
|
||||||
<< SimilarInsts[i].CGI->TheDef->getName() << ":\n";
|
<< SimilarInsts[i].CGI->TheDef->getName() << ":\n";
|
||||||
for (unsigned i = 0, e = FirstInst.Operands.size(); i != e; ++i) {
|
for (unsigned i = 0, e = FirstInst.Operands.size(); i != e; ++i) {
|
||||||
if (i != DifferingOperand) {
|
if (i != DifferingOperand) {
|
||||||
@ -304,13 +302,13 @@ static void EmitInstructions(std::vector<AsmWriterInst> &Insts,
|
|||||||
// emit a switch for just this operand now.
|
// emit a switch for just this operand now.
|
||||||
O << " switch (MI->getOpcode()) {\n";
|
O << " switch (MI->getOpcode()) {\n";
|
||||||
std::vector<std::pair<std::string, AsmWriterOperand> > OpsToPrint;
|
std::vector<std::pair<std::string, AsmWriterOperand> > OpsToPrint;
|
||||||
OpsToPrint.push_back(std::make_pair(Namespace+"::"+
|
OpsToPrint.push_back(std::make_pair(FirstInst.CGI->Namespace + "::" +
|
||||||
FirstInst.CGI->TheDef->getName(),
|
FirstInst.CGI->TheDef->getName(),
|
||||||
FirstInst.Operands[i]));
|
FirstInst.Operands[i]));
|
||||||
|
|
||||||
for (unsigned si = 0, e = SimilarInsts.size(); si != e; ++si) {
|
for (unsigned si = 0, e = SimilarInsts.size(); si != e; ++si) {
|
||||||
AsmWriterInst &AWI = SimilarInsts[si];
|
AsmWriterInst &AWI = SimilarInsts[si];
|
||||||
OpsToPrint.push_back(std::make_pair(Namespace+"::"+
|
OpsToPrint.push_back(std::make_pair(AWI.CGI->Namespace+"::"+
|
||||||
AWI.CGI->TheDef->getName(),
|
AWI.CGI->TheDef->getName(),
|
||||||
AWI.Operands[i]));
|
AWI.Operands[i]));
|
||||||
}
|
}
|
||||||
@ -341,8 +339,6 @@ void AsmWriterEmitter::run(std::ostream &O) {
|
|||||||
"bool " << Target.getName() << ClassName
|
"bool " << Target.getName() << ClassName
|
||||||
<< "::printInstruction(const MachineInstr *MI) {\n";
|
<< "::printInstruction(const MachineInstr *MI) {\n";
|
||||||
|
|
||||||
std::string Namespace = Target.inst_begin()->second.Namespace;
|
|
||||||
|
|
||||||
std::vector<AsmWriterInst> Instructions;
|
std::vector<AsmWriterInst> Instructions;
|
||||||
|
|
||||||
for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
|
for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user