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
This commit is contained in:
Evan Cheng
2006-11-11 10:20:02 +00:00
parent 490ce1ea6f
commit 3ba433a7e8
4 changed files with 22 additions and 10 deletions

View File

@ -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;