From fa9457276a2174aaf302240dd32d89900ad021ae Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sat, 13 Oct 2007 02:23:01 +0000 Subject: Optionally create a MachineInstr without default implicit operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42945 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineInstr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/MachineInstr.cpp') diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 1ac955a743..a3485bc524 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -58,16 +58,17 @@ void MachineInstr::addImplicitDefUseOperands() { /// implicit operands. It reserves space for number of operands specified by /// TargetInstrDescriptor or the numOperands if it is not zero. (for /// instructions with variable number of operands). -MachineInstr::MachineInstr(const TargetInstrDescriptor &tid) +MachineInstr::MachineInstr(const TargetInstrDescriptor &tid, bool NoImp) : TID(&tid), NumImplicitOps(0), parent(0) { - if (TID->ImplicitDefs) + if (!NoImp && TID->ImplicitDefs) for (const unsigned *ImpDefs = TID->ImplicitDefs; *ImpDefs; ++ImpDefs) NumImplicitOps++; - if (TID->ImplicitUses) + if (!NoImp && TID->ImplicitUses) for (const unsigned *ImpUses = TID->ImplicitUses; *ImpUses; ++ImpUses) NumImplicitOps++; Operands.reserve(NumImplicitOps + TID->numOperands); - addImplicitDefUseOperands(); + if (!NoImp) + addImplicitDefUseOperands(); // Make sure that we get added to a machine basicblock LeakDetector::addGarbageObject(this); } -- cgit v1.2.3