aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-09 22:45:08 +0000
committerDan Gohman <gohman@apple.com>2008-12-09 22:45:08 +0000
commitbcf28c08b3f0a3c4aa1be8f1485f6452d9a2b690 (patch)
tree86dd4bb7d3a9c0e16bfee87769cf0c1267679ea9 /lib/CodeGen
parent74c376529101acbe141a256d0bf23a44eb454c84 (diff)
downloadexternal_llvm-bcf28c08b3f0a3c4aa1be8f1485f6452d9a2b690.zip
external_llvm-bcf28c08b3f0a3c4aa1be8f1485f6452d9a2b690.tar.gz
external_llvm-bcf28c08b3f0a3c4aa1be8f1485f6452d9a2b690.tar.bz2
Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineInstr.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 2cca6c0..5fe1003 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -406,6 +406,8 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
assert((isImpReg || !OperandsComplete()) &&
"Trying to add an operand to a machine instr that is already done!");
+ MachineRegisterInfo *RegInfo = getRegInfo();
+
// If we are adding the operand to the end of the list, our job is simpler.
// This is true most of the time, so this is a reasonable optimization.
if (isImpReg || NumImplicitOps == 0) {
@@ -419,7 +421,7 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
// If the operand is a register, update the operand's use list.
if (Op.isReg())
- Operands.back().AddRegOperandToRegInfo(getRegInfo());
+ Operands.back().AddRegOperandToRegInfo(RegInfo);
return;
}
}
@@ -427,8 +429,6 @@ void MachineInstr::addOperand(const MachineOperand &Op) {
// Otherwise, we have to insert a real operand before any implicit ones.
unsigned OpNo = Operands.size()-NumImplicitOps;
- MachineRegisterInfo *RegInfo = getRegInfo();
-
// If this instruction isn't embedded into a function, then we don't need to
// update any operand lists.
if (RegInfo == 0) {