aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/MachineInstr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index fb6e46040a..833a4a13e6 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -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);