[PATCH] D21726: CodeGen: Use MachineInstr& in TargetInstrInfo, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 17:18:08 PDT 2016


> This all LGTM now, go ahead and commit at your convenience.

Thanks everyone for the reviews!  Committed in r274189.

> As an aside, there is a bit of an API issue I noticed because of this
> change. BuildMI has overloads for MachineInstr*, MBB::iterator, and
> MBB::instr_iterator, but not MachineInstr&. This actually means that if
> someone changes a caller to pass a MachineInstr& instead of a
> MachineInstr*, they'll get a behaviour change and potentially introduce
> a bug. This didn't come up in this patch though, since it always changed
> from an iterator to a reference. Maybe we should add a MachineInstr&
> overload, just to be safe?

Good call.  Done in r274193.


More information about the llvm-commits mailing list