Add helper method
authorChris Lattner <sabre@nondot.org>
Mon, 18 Nov 2002 06:57:05 +0000 (06:57 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Nov 2002 06:57:05 +0000 (06:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4744 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index fb6e46040a7fe3bd11f7c8e79adcc8e81128f1d7..833a4a13e6df7aa98042125cf27ac02952eee661 100644 (file)
@@ -190,6 +190,10 @@ public:
     return regNum;
   }
 
+  inline unsigned getReg() const {
+    assert(hasAllocatedReg() && "Cannot call MachineOperand::getReg()!");
+    return regNum;
+  }    
   
   friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop);