Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/include/llvm/CodeGen/Register.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ class Register {
///
/// FIXME: remove in favor of member.
static constexpr bool isStackSlot(unsigned Reg) {
return MCRegister::isStackSlot(Reg);
return MCRegister::FirstStackSlot <= Reg &&
Reg < MCRegister::VirtualRegFlag;
}

/// Return true if this is a stack slot.
constexpr bool isStack() const { return MCRegister::isStackSlot(Reg); }
constexpr bool isStack() const { return isStackSlot(Reg); }

/// Compute the frame index from a register value representing a stack slot.
static int stackSlot2Index(Register Reg) {
Expand Down
8 changes: 0 additions & 8 deletions llvm/include/llvm/MC/MCRegister.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ class MCRegister {
static constexpr unsigned FirstStackSlot = 1u << 30;
static constexpr unsigned VirtualRegFlag = 1u << 31;

/// This is the portion of the positive number space that is not a physical
/// register. StackSlot values do not exist in the MC layer, see
/// Register::isStackSlot() for the more information on them.
///
static constexpr bool isStackSlot(unsigned Reg) {
return FirstStackSlot <= Reg && Reg < VirtualRegFlag;
}

/// Return true if the specified register number is in
/// the physical register namespace.
static constexpr bool isPhysicalRegister(unsigned Reg) {
Expand Down