From 1723821d178189bca27926ff02ae0032b51abb1b Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 27 Jul 2016 18:45:18 +0000 Subject: [PATCH] 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 --- llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h index 45a9a188f90e..c24fee8493ed 100644 --- a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h +++ b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h @@ -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;