Fix emission of instructions that directly reference MBBs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-08-12 05:19:49 +00:00
parent 175724f2d3
commit 42f3372742
2 changed files with 20 additions and 8 deletions

View File

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

View File

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