From fd8cc23220d25dfe6956470da8bd63d26649c428 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 27 Feb 2016 20:01:33 +0000 Subject: CodeGen: Change MachineInstr to use MachineInstr&, NFC Change MachineInstr API to prefer MachineInstr& over MachineInstr* whenever the parameter is expected to be non-null. Slowly inching toward being able to fix PR26753. llvm-svn: 262149 --- llvm/include/llvm/CodeGen/MachineInstr.h | 6 +++--- llvm/include/llvm/CodeGen/MachineInstrBuilder.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/include') diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index a654d9cd593..da9eddf7ebd 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -742,7 +742,7 @@ public: /// Return true if this instruction is identical to (same /// opcode and same operands as) the specified instruction. - bool isIdenticalTo(const MachineInstr *Other, + bool isIdenticalTo(const MachineInstr &Other, MICheckType Check = CheckDefs) const; /// Unlink 'this' from the containing basic block, and return it without @@ -1154,7 +1154,7 @@ public: /// Copy implicit register operands from specified /// instruction to this instruction. - void copyImplicitOps(MachineFunction &MF, const MachineInstr *MI); + void copyImplicitOps(MachineFunction &MF, const MachineInstr &MI); // // Debugging support @@ -1297,7 +1297,7 @@ struct MachineInstrExpressionTrait : DenseMapInfo { if (RHS == getEmptyKey() || RHS == getTombstoneKey() || LHS == getEmptyKey() || LHS == getTombstoneKey()) return LHS == RHS; - return LHS->isIdenticalTo(RHS, MachineInstr::IgnoreVRegDefs); + return LHS->isIdenticalTo(*RHS, MachineInstr::IgnoreVRegDefs); } }; diff --git a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h index f19d426a310..8683917a51c 100644 --- a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h @@ -230,7 +230,7 @@ public: /// Copy all the implicit operands from OtherMI onto this one. const MachineInstrBuilder & - copyImplicitOps(const MachineInstr *OtherMI) const { + copyImplicitOps(const MachineInstr &OtherMI) const { MI->copyImplicitOps(*MF, OtherMI); return *this; } -- cgit v1.2.3