aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit979bbf48d53e3943f2efbd81a7baa33a5687c3a1 (patch)
tree373e7058dd28ddce587b9bb57976da0996484614 /llvm/lib/CodeGen/MachineInstr.cpp
parenta36cdcfaf8734731c8c83df7cf6efe7e647f1fba (diff)
downloadllvm-979bbf48d53e3943f2efbd81a7baa33a5687c3a1.zip
llvm-979bbf48d53e3943f2efbd81a7baa33a5687c3a1.tar.gz
llvm-979bbf48d53e3943f2efbd81a7baa33a5687c3a1.tar.bz2
Add methods to add implicit def use operands to a MI.
llvm-svn: 31675
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index ba75e73..65c164a 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/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;