diff options
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 20 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBuilder.h | 5 |
2 files changed, 11 insertions, 14 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index f76da2fa4a..32e728436c 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -207,10 +207,6 @@ public: return *this; } - bool operator==(const MachineOperand& rhs) const { - return regNum == rhs.regNum && opType == rhs.opType; - } - // Accessor methods. Caller is responsible for checking the // operand type before invoking the corresponding accessor. // @@ -285,14 +281,14 @@ public: return *SymbolName; } - bool isUse () const { return flags & USEFLAG; } - bool isEverUsed (const MachineInstr&) const; - bool isDef () const { return flags & DEFFLAG; } - bool isHiBits32 () const { return flags & HIFLAG32; } - bool isEverDefined (const MachineInstr&) const; - bool isLoBits32 () const { return flags & LOFLAG32; } - bool isHiBits64 () const { return flags & HIFLAG64; } - bool isLoBits64 () const { return flags & LOFLAG64; } + bool isUse () const { return flags & USEFLAG; } + MachineOperand& setUse () { flags |= USEFLAG; return *this; } + bool isDef () const { return flags & DEFFLAG; } + MachineOperand& setDef () { flags |= DEFFLAG; return *this; } + bool isHiBits32 () const { return flags & HIFLAG32; } + bool isLoBits32 () const { return flags & LOFLAG32; } + bool isHiBits64 () const { return flags & HIFLAG64; } + bool isLoBits64 () const { return flags & LOFLAG64; } // used to check if a machine register has been allocated to this operand bool hasAllocatedReg() const { diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 67255214a2..e0f9736100 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -138,9 +138,10 @@ inline MachineInstrBuilder BuildMI(int Opcode, unsigned NumOperands) { /// calls that are expected, it does not include the destination register. /// inline MachineInstrBuilder BuildMI(int Opcode, unsigned NumOperands, - unsigned DestReg) { + unsigned DestReg, + MOTy::UseType useType = MOTy::Def) { return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands+1, - true, true)).addReg(DestReg, MOTy::Def); + true, true)).addReg(DestReg, useType); } |