[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Aug 5 11:59:01 PDT 2003
Changes in directory llvm/lib/CodeGen:
MachineInstr.cpp updated: 1.75 -> 1.76
---
Log message:
All callers of these methods actually wanted them to preserve the flags,
so get rid of the def/use parameters that were getting passed in.
**** This now changes the semantics of these methods to preserve the flags,
not clobber them!
---
Diffs of the changes:
Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.75 llvm/lib/CodeGen/MachineInstr.cpp:1.76
--- llvm/lib/CodeGen/MachineInstr.cpp:1.75 Sun Aug 3 16:51:45 2003
+++ llvm/lib/CodeGen/MachineInstr.cpp Tue Aug 5 11:58:46 2003
@@ -80,24 +80,13 @@
operands.resize(numOperands, MachineOperand());
}
-void
-MachineInstr::SetMachineOperandVal(unsigned i,
- MachineOperand::MachineOperandType opType,
- Value* V,
- bool isdef,
- bool isDefAndUse)
-{
+void MachineInstr::SetMachineOperandVal(unsigned i,
+ MachineOperand::MachineOperandType opTy,
+ Value* V) {
assert(i < operands.size()); // may be explicit or implicit op
- operands[i].opType = opType;
+ operands[i].opType = opTy;
operands[i].value = V;
operands[i].regNum = -1;
-
- if (isDefAndUse)
- operands[i].flags = MachineOperand::DEFUSEFLAG;
- else if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
- operands[i].flags = MachineOperand::DEFONLYFLAG;
- else
- operands[i].flags = 0;
}
void
@@ -116,22 +105,12 @@
operands[i].flags = 0;
}
-void
-MachineInstr::SetMachineOperandReg(unsigned i,
- int regNum,
- bool isdef) {
+void MachineInstr::SetMachineOperandReg(unsigned i, int regNum) {
assert(i < getNumOperands()); // must be explicit op
operands[i].opType = MachineOperand::MO_MachineRegister;
operands[i].value = NULL;
operands[i].regNum = regNum;
-
- if (isdef || TargetInstrDescriptors[opCode].resultPos == (int)i) {
- assert(operands[i].flags == MachineOperand::DEFONLYFLAG &&
- "Shouldn't be changing a register type once set!");
- operands[i].flags = MachineOperand::DEFONLYFLAG;
- }
-
insertUsedReg(regNum);
}
More information about the llvm-commits
mailing list