aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-11 10:20:02 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-11 10:20:02 +0000
commit3ba433a7e85c4f5b943ae6585a0327f4ccd461a0 (patch)
treebe9b1c5d506dff046146ac6b665ee026d6aca3a6 /lib/CodeGen/MachineInstr.cpp
parent490ce1ea6f85395127f62ba521ce9d20d1f569fe (diff)
Add methods to add implicit def use operands to a MI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index ba75e73623..65c164a4ee 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -125,6 +125,18 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
}
}
+/// addImplicitDefUseOperands - Add all implicit def and use operands to
+/// this instruction.
+void MachineInstr::addImplicitDefUseOperands() {
+ const TargetInstrDescriptor &TID = TargetInstrDescriptors[Opcode];
+ if (TID.ImplicitDefs)
+ for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs)
+ addRegOperand(*ImpDefs, true, true);
+ if (TID.ImplicitUses)
+ for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses)
+ addRegOperand(*ImpUses, false, true);
+}
+
void MachineInstr::dump() const {
std::cerr << " " << *this;