diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-02 23:52:57 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-02-02 23:52:57 +0000 |
commit | 478a8a02bc0f2e739ed8f4240152e99837e480b9 (patch) | |
tree | 47ab92f4d7d9d548d79b78837040b3da3ccba482 /include/llvm/CodeGen/MachineOperand.h | |
parent | 2e5b88e3cbb9438b5b9d3a1dc499b11a144ca7d2 (diff) | |
download | llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.tar.gz llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.tar.bz2 llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.tar.xz |
Require non-NULL register masks.
It doesn't seem worthwhile to give meaning to a NULL register mask
pointer. It complicates all the code using register mask operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineOperand.h')
-rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index 6a2e38dd84..59da26c71c 100644 --- a/include/llvm/CodeGen/MachineOperand.h +++ b/include/llvm/CodeGen/MachineOperand.h @@ -446,12 +446,11 @@ public: assert(isRegMask() && "Wrong MachineOperand accessor"); // See TargetRegisterInfo.h. assert(PhysReg < (1u << 30) && "Not a physical register"); - return !Contents.RegMask || - !(Contents.RegMask[PhysReg / 32] & (1u << PhysReg % 32)); + return !(Contents.RegMask[PhysReg / 32] & (1u << PhysReg % 32)); } /// getRegMask - Returns a bit mask of registers preserved by this RegMask - /// operand. A NULL pointer means that all registers are clobbered. + /// operand. const uint32_t *getRegMask() const { assert(isRegMask() && "Wrong MachineOperand accessor"); return Contents.RegMask; @@ -616,6 +615,7 @@ public: /// Any physreg with a 0 bit in the mask is clobbered by the instruction. /// static MachineOperand CreateRegMask(const uint32_t *Mask) { + assert(Mask && "Missing register mask"); MachineOperand Op(MachineOperand::MO_RegisterMask); Op.Contents.RegMask = Mask; return Op; |