[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Oct 27 22:25:06 PST 2002
Changes in directory llvm/lib/CodeGen:
MachineInstr.cpp updated: 1.49 -> 1.50
---
Log message:
Fairly major overhaul of MachineInstr & Operand classes
- Inline methods that are mostly a single line anyway
- Eliminate several methods that were never called
- Group methods a bit more consistently
---
Diffs of the changes:
Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.49 llvm/lib/CodeGen/MachineInstr.cpp:1.50
--- llvm/lib/CodeGen/MachineInstr.cpp:1.49 Sun Oct 27 20:28:34 2002
+++ llvm/lib/CodeGen/MachineInstr.cpp Sun Oct 27 22:24:49 2002
@@ -47,12 +47,16 @@
void
MachineInstr::SetMachineOperandVal(unsigned int i,
MachineOperand::MachineOperandType opType,
- Value* _val,
+ Value* V,
bool isdef,
bool isDefAndUse)
{
assert(i < operands.size());
- operands[i].Initialize(opType, _val);
+ operands[i].opType = opType;
+ operands[i].value = V;
+ operands[i].regNum = -1;
+ operands[i].flags = 0;
+
if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
operands[i].markDef();
if (isDefAndUse)
@@ -60,25 +64,36 @@
}
void
-MachineInstr::SetMachineOperandConst(unsigned int i,
+MachineInstr::SetMachineOperandConst(unsigned i,
MachineOperand::MachineOperandType operandType,
int64_t intValue)
{
assert(i < operands.size());
assert(TargetInstrDescriptors[opCode].resultPos != (int) i &&
"immed. constant cannot be defined");
- operands[i].InitializeConst(operandType, intValue);
+
+ operands[i].opType = operandType;
+ operands[i].value = NULL;
+ operands[i].immedVal = intValue;
+ operands[i].regNum = -1;
+ operands[i].flags = 0;
}
void
-MachineInstr::SetMachineOperandReg(unsigned int i,
+MachineInstr::SetMachineOperandReg(unsigned i,
int regNum,
bool isdef,
bool isDefAndUse,
bool isCCReg)
{
assert(i < operands.size());
- operands[i].InitializeReg(regNum, isCCReg);
+
+ operands[i].opType =
+ isCCReg? MachineOperand::MO_CCRegister : MachineOperand::MO_MachineRegister;
+ operands[i].value = NULL;
+ operands[i].regNum = regNum;
+ operands[i].flags = 0;
+
if (isdef || TargetInstrDescriptors[opCode].resultPos == (int) i)
operands[i].markDef();
if (isDefAndUse)
More information about the llvm-commits
mailing list