From 979bbf48d53e3943f2efbd81a7baa33a5687c3a1 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sat, 11 Nov 2006 10:20:02 +0000 Subject: Add methods to add implicit def use operands to a MI. llvm-svn: 31675 --- llvm/lib/CodeGen/MachineInstr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'llvm/lib/CodeGen/MachineInstr.cpp') diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index ba75e736239..65c164a4eec 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; -- cgit v1.2.3