diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-30 00:12:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-30 00:12:25 +0000 |
commit | c288ff1d7869f7f449c18facfea2d3165c1d92f1 (patch) | |
tree | 39e4010a7be973388343fc676560cac7188a878a /llvm/lib/CodeGen | |
parent | a77acbdcae573f9094fc9cd4df746ece8d85d4ef (diff) | |
download | bcm5719-llvm-c288ff1d7869f7f449c18facfea2d3165c1d92f1.tar.gz bcm5719-llvm-c288ff1d7869f7f449c18facfea2d3165c1d92f1.zip |
simplify some code by factoring operand construction better.
llvm-svn: 45428
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index dd89e3649db..1655cbabf28 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -31,29 +31,11 @@ MachineInstr::MachineInstr() void MachineInstr::addImplicitDefUseOperands() { if (TID->ImplicitDefs) - for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) { - MachineOperand Op; - Op.opType = MachineOperand::MO_Register; - Op.IsDef = true; - Op.IsImp = true; - Op.IsKill = false; - Op.IsDead = false; - Op.contents.RegNo = *ImpDefs; - Op.auxInfo.subReg = 0; - Operands.push_back(Op); - } + for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) + addRegOperand(*ImpDefs, true, true); if (TID->ImplicitUses) - for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) { - MachineOperand Op; - Op.opType = MachineOperand::MO_Register; - Op.IsDef = false; - Op.IsImp = true; - Op.IsKill = false; - Op.IsDead = false; - Op.contents.RegNo = *ImpUses; - Op.auxInfo.subReg = 0; - Operands.push_back(Op); - } + for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) + addRegOperand(*ImpUses, false, true); } /// MachineInstr ctor - This constructor create a MachineInstr and add the |