Skip to content

Commit a6f48ed

Browse files
authored
[MC] Remove MCRegister::isStackSlot. (#127755)
Stack slots should only be stored in Register. The only caller was Register::isStackSlot so just inline it there.
1 parent 2bf473b commit a6f48ed

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

llvm/include/llvm/CodeGen/Register.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ class Register {
4242
///
4343
/// FIXME: remove in favor of member.
4444
static constexpr bool isStackSlot(unsigned Reg) {
45-
return MCRegister::isStackSlot(Reg);
45+
return MCRegister::FirstStackSlot <= Reg &&
46+
Reg < MCRegister::VirtualRegFlag;
4647
}
4748

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

5152
/// Compute the frame index from a register value representing a stack slot.
5253
static int stackSlot2Index(Register Reg) {

llvm/include/llvm/MC/MCRegister.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ class MCRegister {
5454
static constexpr unsigned FirstStackSlot = 1u << 30;
5555
static constexpr unsigned VirtualRegFlag = 1u << 31;
5656

57-
/// This is the portion of the positive number space that is not a physical
58-
/// register. StackSlot values do not exist in the MC layer, see
59-
/// Register::isStackSlot() for the more information on them.
60-
///
61-
static constexpr bool isStackSlot(unsigned Reg) {
62-
return FirstStackSlot <= Reg && Reg < VirtualRegFlag;
63-
}
64-
6557
/// Return true if the specified register number is in
6658
/// the physical register namespace.
6759
static constexpr bool isPhysicalRegister(unsigned Reg) {

0 commit comments

Comments
 (0)