Fix emission of instructions that directly reference MBBs

llvm-svn: 7771
This commit is contained in:
Chris Lattner 2003-08-12 05:19:49 +00:00
parent 9f09954df9
commit e5b8234685
1 changed files with 10 additions and 4 deletions

View File

@ -1205,15 +1205,21 @@ void InstrSelectorEmitter::run(std::ostream &OS) {
if (P->getResult()) OS << ", NewReg"; if (P->getResult()) OS << ", NewReg";
OS << ")"; OS << ")";
for (unsigned i = 0, e = Operands.size(); i != e; ++i) for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
if (Operands[i].first->isLeaf()) { TreePatternNode *Op = Operands[i].first;
Record *RV = Operands[i].first->getValueRecord(); if (Op->isLeaf()) {
Record *RV = Op->getValueRecord();
assert(RV->isSubClassOf("RegisterClass") && assert(RV->isSubClassOf("RegisterClass") &&
"Only handles registers here so far!"); "Only handles registers here so far!");
OS << ".addReg(" << Operands[i].second << "->Val)"; OS << ".addReg(" << Operands[i].second << "->Val)";
} else { } else if (Op->getOperator()->getName() == "imm") {
OS << ".addZImm(" << Operands[i].second << "->Val)"; OS << ".addZImm(" << Operands[i].second << "->Val)";
} else if (Op->getOperator()->getName() == "basicblock") {
OS << ".addMBB(" << Operands[i].second << "->Val)";
} else {
assert(0 && "Unknown value type!");
} }
}
OS << ";\n"; OS << ";\n";
break; break;
case Pattern::Expander: { case Pattern::Expander: {