CodeGen: Make iterator-to-pointer conversion explicit, NFC

Remove the implicit conversion from MachineInstrBundleIterator to
MachineInstr*, leaving behind an explicit conversion.

I *think* this is the last ilist_iterator-related implicit conversion to
ilist_node subclass.  If I'm right, I can finally dig in and fix the UB
in ilist that these conversions were relying on.

Note that the implicit users of this conversion have already been
removed.  If you have out-of-tree code that doesn't update, you might be
able to buy some time by temporarily reverting this commit.

llvm-svn: 276902
This commit is contained in:
Duncan P. N. Exon Smith
2016-07-27 18:45:18 +00:00
parent 22039e6858
commit 1723821d17

View File

@@ -50,8 +50,8 @@ public:
Ty &operator*() const { return *MII; }
Ty *operator->() const { return &operator*(); }
// FIXME: This conversion should be explicit.
operator Ty *() const { return MII.getNodePtrUnchecked(); }
// FIXME: This should be implemented as "return &operator*()" (or removed).
explicit operator Ty *() const { return MII.getNodePtrUnchecked(); }
bool operator==(const MachineInstrBundleIterator &X) const {
return MII == X.MII;