Attempt to fix a crash on WIN32.

llvm-svn: 24936
This commit is contained in:
Evan Cheng 2005-12-22 02:35:21 +00:00
parent dfad8ed54e
commit a87d743912
1 changed files with 16 additions and 15 deletions

View File

@ -1124,22 +1124,23 @@ void DAGISelEmitter::ParseInstructions() {
CodeGenInstruction &InstInfo =Target.getInstruction(Instrs[i]->getName());
// Note: Removed if (InstInfo.OperandList.size() == 0) continue;
// It's possible for some instruction, e.g. RET for X86 that only has an
// implicit flag operand.
// FIXME: temporary hack...
if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
InstInfo.isStore) {
// These produce no results
for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
Operands.push_back(InstInfo.OperandList[j].Rec);
} else {
// Assume the first operand is the result.
Results.push_back(InstInfo.OperandList[0].Rec);
if (InstInfo.OperandList.size() != 0) {
// It's possible for some instruction, e.g. RET for X86 that only has an
// implicit flag operand.
// FIXME: temporary hack...
if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
InstInfo.isStore) {
// These produce no results
for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
Operands.push_back(InstInfo.OperandList[j].Rec);
} else {
// Assume the first operand is the result.
Results.push_back(InstInfo.OperandList[0].Rec);
// The rest are inputs.
for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
Operands.push_back(InstInfo.OperandList[j].Rec);
// The rest are inputs.
for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
Operands.push_back(InstInfo.OperandList[j].Rec);
}
}
// Create and insert the instruction.