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 | a4161ee99478e7f8f9e33481e1c0dc79f0b4bd7d (patch) | |
tree | bc97ec76e051d07e5c2e1970147bd28b50852245 /lib/CodeGen/MachineInstr.cpp | |
parent | 234d529e582963ad4b5d83b911cd057fe99d1435 (diff) |
simplify some code by factoring operand construction better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index dd89e3649d..1655cbabf2 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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 |