Skip to content

Commit 7b2fcda

Browse files
author
Mikhail Gudim
committed
addressed review comments.
1 parent dc95302 commit 7b2fcda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/CodeGen/Register.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Register {
3838
"Reg isn't large enough to hold full range.");
3939
static constexpr unsigned MaxFrameIndexBitwidth = 30;
4040
static constexpr unsigned FirstStackSlot = 1u << MaxFrameIndexBitwidth;
41-
static const unsigned StackSlotMask =
41+
static constexpr const unsigned StackSlotMask =
4242
(unsigned)(-1) >> (CHAR_BIT * sizeof(unsigned) - MaxFrameIndexBitwidth);
4343
static_assert(FirstStackSlot >= MCRegister::LastPhysicalReg);
4444
static constexpr unsigned VirtualRegFlag = 1u << 31;
@@ -91,7 +91,7 @@ class Register {
9191
/// Compute the frame index from a register value representing a stack slot.
9292
int stackSlotIndex() const {
9393
assert(isStack() && "Not a stack slot");
94-
return static_cast<int>(SignExtend64(Reg & Register::StackSlotMask, 30));
94+
return static_cast<int>(SignExtend64<30>(Reg & Register::StackSlotMask));
9595
}
9696

9797
constexpr operator unsigned() const { return Reg; }

0 commit comments

Comments
 (0)