[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.h

Alkis Evlogimenos alkis at niobe.cs.uiuc.edu
Tue Feb 24 00:31:01 PST 2004


Changes in directory llvm/lib/CodeGen:

VirtRegMap.h updated: 1.3 -> 1.4

---
Log message:

Add predicates for checking if a virtual register has a physical
register mapping or a stack slot mapping.


---
Diffs of the changes:  (+8 -0)

Index: llvm/lib/CodeGen/VirtRegMap.h
diff -u llvm/lib/CodeGen/VirtRegMap.h:1.3 llvm/lib/CodeGen/VirtRegMap.h:1.4
--- llvm/lib/CodeGen/VirtRegMap.h:1.3	Mon Feb 23 17:49:40 2004
+++ llvm/lib/CodeGen/VirtRegMap.h	Tue Feb 24 00:30:36 2004
@@ -57,6 +57,10 @@
               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)];
@@ -76,6 +80,10 @@
             assert(v2pMap_[toIndex(virtReg)] != NO_PHYS_REG &&
                    "attempt to clear a not assigned virtual register");
             v2pMap_[toIndex(virtReg)] = NO_PHYS_REG;
+        }
+
+        bool hasStackSlot(unsigned virtReg) const {
+            return getStackSlot(virtReg) != NO_STACK_SLOT;
         }
 
         int getStackSlot(unsigned virtReg) const {





More information about the llvm-commits mailing list