Add method MachineOperand::hasAllocatedReg().
authorVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 16 Sep 2002 15:58:54 +0000 (15:58 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Mon, 16 Sep 2002 15:58:54 +0000 (15:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3747 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index 935504894a00edb3dec8d6fc527e73a63ce15101..a2190d829d3b645f3a9e76a094eb769d8ed43b2f 100644 (file)
@@ -136,14 +136,21 @@ public:
   inline bool           opLoBits64      () const {
     return flags & LOFLAG64;
   }
-  
-  // used to get the reg number if when one is allocated (must be
-  // called only after reg alloc)
+
+  // used to check if a machine register has been allocated to this operand
+  inline bool   hasAllocatedReg() const {
+    return (regNum >= 0 &&
+            (opType == MO_VirtualRegister || opType == MO_CCRegister || 
+             opType == MO_MachineRegister));
+  }
+
+  // used to get the reg number if when one is allocated
   inline int  getAllocatedRegNum() const {
     assert(opType == MO_VirtualRegister || opType == MO_CCRegister || 
           opType == MO_MachineRegister);
     return regNum;
   }
+
   
 public:
   friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop);