mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Add predicates for checking if a virtual register has a physical
register mapping or a stack slot mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11795 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b4a482a098
commit
ec8b8bb9ab
@ -57,6 +57,10 @@ namespace llvm {
|
|||||||
v2ssMap_(mf.getSSARegMap()->getNumVirtualRegs(), NO_STACK_SLOT) {
|
v2ssMap_(mf.getSSARegMap()->getNumVirtualRegs(), NO_STACK_SLOT) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hasPhys(unsigned virtReg) const {
|
||||||
|
return getPhys(virtReg) != NO_PHYS_REG;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned getPhys(unsigned virtReg) const {
|
unsigned getPhys(unsigned virtReg) const {
|
||||||
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
||||||
return v2pMap_[toIndex(virtReg)];
|
return v2pMap_[toIndex(virtReg)];
|
||||||
@ -78,6 +82,10 @@ namespace llvm {
|
|||||||
v2pMap_[toIndex(virtReg)] = NO_PHYS_REG;
|
v2pMap_[toIndex(virtReg)] = NO_PHYS_REG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hasStackSlot(unsigned virtReg) const {
|
||||||
|
return getStackSlot(virtReg) != NO_STACK_SLOT;
|
||||||
|
}
|
||||||
|
|
||||||
int getStackSlot(unsigned virtReg) const {
|
int getStackSlot(unsigned virtReg) const {
|
||||||
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
assert(MRegisterInfo::isVirtualRegister(virtReg));
|
||||||
return v2ssMap_[toIndex(virtReg)];
|
return v2ssMap_[toIndex(virtReg)];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user