summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-13 02:23:01 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-13 02:23:01 +0000
commit9490e0d078aee9409c888234868dcbbf86b3d792 (patch)
treeca938d2fca59e347c153bcf24c1c18f730cf46f7 /llvm/lib/CodeGen/MachineInstr.cpp
parent6a91cc03ad0c849dda7c7a7fac443e832a24d592 (diff)
downloadbcm5719-llvm-9490e0d078aee9409c888234868dcbbf86b3d792.tar.gz
bcm5719-llvm-9490e0d078aee9409c888234868dcbbf86b3d792.zip
Optionally create a MachineInstr without default implicit operands.
llvm-svn: 42945
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 1ac955a743c..a3485bc524c 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud