int64_t immedVal; // constant value for an explicit constant
};
+
+
public:
/*ctor*/ MachineOperand ();
return immedVal;
}
+ bool isDef; // is this a defition for the value
+ // made public for faster access
+
public:
friend ostream& operator<<(ostream& os, const MachineOperand& mop);
: opType(MO_VirtualRegister),
value(NULL),
regNum(0),
- immedVal(0)
+ immedVal(0),
+ isDef(false)
{}
inline
: opType(operandType),
value(_val),
regNum(0),
- immedVal(0)
+ immedVal(0),
+ isDef(false)
{}
inline
MachineOperand::MachineOperand(const MachineOperand& mo)
- : opType(mo.opType)
+ : opType(mo.opType),
+ isDef(false)
{
switch(opType) {
case MO_VirtualRegister:
// Access to set the operands when building the machine instruction
void SetMachineOperand(unsigned int i,
MachineOperand::MachineOperandType operandType,
- Value* _val);
+ Value* _val, bool isDef=false);
void SetMachineOperand(unsigned int i,
MachineOperand::MachineOperandType operandType,
- int64_t intValue);
+ int64_t intValue, bool isDef=false);
void SetMachineOperand(unsigned int i,
- unsigned int regNum);
+ unsigned int regNum,
+ bool isDef=false);
};
inline const MachineOpCode
inline _V* operator*() const { return minstr->getOperand(i).getVRegValue();}
inline _V* operator->() const { return operator*(); }
- inline bool isDef () const { return (((int) i) == resultPos); }
+ // inline bool isDef () const { return (((int) i) == resultPos); }
+
+ inline bool isDef () const { return minstr->getOperand(i).isDef; }
inline bool done () const { return (i == minstr->getNumOperands()); }
inline _Self& operator++() { i++; skipToNextVal(); return *this; }