This is an archive of the discontinued LLVM Phabricator instance.

X86: Avoid implicit iterator conversions, NFC
ClosedPublic

Authored by dexonsmith on Jul 8 2016, 12:29 PM.

Details

Reviewers
ab
Summary

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr*, mainly by preferring MachineInstr& over MachineInstr* and
using range-based for loops.

Diff Detail

Event Timeline

dexonsmith updated this revision to Diff 63294.Jul 8 2016, 12:29 PM
dexonsmith retitled this revision from to X86: Avoid implicit iterator conversions, NFC.
dexonsmith updated this object.
dexonsmith added a subscriber: llvm-commits.

Fast ping, since this and the PowerPC patch are the only remaining blockers to removing the implicit MachineInstrBundleIterator::operator MachineInstr*(), and I'd like to prevent bitrot in the rest of the backend.

Note that I don't necessarily need X86 or even backend expertise for this review; I'd just appreciate someone double-checking that I didn't dereference an end-iterator somewhere or something like that. Is anyone willing to give this a quick read?

ab accepted this revision.Jul 11 2016, 8:09 PM
ab added a reviewer: ab.
ab added a subscriber: ab.

LGTM

This revision is now accepted and ready to land.Jul 11 2016, 8:09 PM

Thanks! Committed in r275149.

dexonsmith closed this revision.Jul 11 2016, 8:26 PM