forked from OSchip/llvm-project
Fix emission of instructions that directly reference MBBs
llvm-svn: 7771
This commit is contained in:
parent
9f09954df9
commit
e5b8234685
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue