[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

vadve at cs.uiuc.edu vadve at cs.uiuc.edu
Mon Sep 16 10:59:11 PDT 2002


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.63 -> 1.64

---
Log message:

Add method MachineOperand::hasAllocatedReg().


---
Diffs of the changes:

Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.63 llvm/include/llvm/CodeGen/MachineInstr.h:1.64
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.63	Wed Aug 14 11:54:11 2002
+++ llvm/include/llvm/CodeGen/MachineInstr.h	Mon Sep 16 10:58:54 2002
@@ -136,14 +136,21 @@
   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);





More information about the llvm-commits mailing list