diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-24 06:30:36 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-24 06:30:36 +0000 |
commit | ec8b8bb9abffdcc22373a7f28803c18ed8efa102 (patch) | |
tree | e16f1bdd4b487f3c805d268dc5b8b24016272440 /lib/CodeGen/VirtRegMap.h | |
parent | b4a482a098ddb1923b69147b611e95146328ac71 (diff) | |
download | external_llvm-ec8b8bb9abffdcc22373a7f28803c18ed8efa102.zip external_llvm-ec8b8bb9abffdcc22373a7f28803c18ed8efa102.tar.gz external_llvm-ec8b8bb9abffdcc22373a7f28803c18ed8efa102.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 90bd2af..f6a1cec 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -57,6 +57,10 @@ namespace llvm { v2ssMap_(mf.getSSARegMap()->getNumVirtualRegs(), NO_STACK_SLOT) { } + bool hasPhys(unsigned virtReg) const { + return getPhys(virtReg) != NO_PHYS_REG; + } + unsigned getPhys(unsigned virtReg) const { assert(MRegisterInfo::isVirtualRegister(virtReg)); return v2pMap_[toIndex(virtReg)]; @@ -78,6 +82,10 @@ namespace llvm { v2pMap_[toIndex(virtReg)] = NO_PHYS_REG; } + bool hasStackSlot(unsigned virtReg) const { + return getStackSlot(virtReg) != NO_STACK_SLOT; + } + int getStackSlot(unsigned virtReg) const { assert(MRegisterInfo::isVirtualRegister(virtReg)); return v2ssMap_[toIndex(virtReg)]; |