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 | |
parent | 2e5b88e3cbb9438b5b9d3a1dc499b11a144ca7d2 (diff) | |
download | external_llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.zip external_llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.tar.gz external_llvm-478a8a02bc0f2e739ed8f4240152e99837e480b9.tar.bz2 |
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')
-rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 6 | ||||
-rw-r--r-- | include/llvm/Target/TargetRegisterInfo.h | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index 6a2e38d..59da26c 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; diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h index 36ac5df..711129f 100644 --- a/include/llvm/Target/TargetRegisterInfo.h +++ b/include/llvm/Target/TargetRegisterInfo.h @@ -376,7 +376,10 @@ public: /// /// Bits are numbered from the LSB, so the bit for physical register Reg can /// be found as (Mask[Reg / 32] >> Reg % 32) & 1. - /// NULL pointer is equivalent to an all-zero mask. + /// + /// A NULL pointer means that no register mask will be used, and call + /// instructions should use implicit-def operands to indicate call clobbered + /// registers. /// virtual const uint32_t *getCallPreservedMask(CallingConv::ID) const { // The default mask clobbers everything. All targets should override. |