From 7e15cfe71debf109ec1ff5ffddb2eb48ac2c450d Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 9 Oct 2015 18:35:09 +0000 Subject: [PATCH] CodeGen: Remove implicit iterator conversions from SlotIndexes.h, NFC Be explicit about changes between pointers and iterators, as with other recent commits. This transitively removes implicit ilist iterator conversions from about 20 source files in CodeGen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249869 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SlotIndexes.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index 0b8879d2f8a..aa74c67ba62 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -427,11 +427,11 @@ namespace llvm { /// Returns the next non-null index, if one exists. /// Otherwise returns getLastIndex(). SlotIndex getNextNonNullIndex(SlotIndex Index) { - IndexList::iterator I = Index.listEntry(); + IndexList::iterator I = Index.listEntry()->getIterator(); IndexList::iterator E = indexList.end(); while (++I != E) if (I->getInstr()) - return SlotIndex(I, Index.getSlot()); + return SlotIndex(&*I, Index.getSlot()); // We reached the end of the function. return getLastIndex(); } @@ -583,11 +583,11 @@ namespace llvm { IndexList::iterator prevItr, nextItr; if (Late) { // Insert mi's index immediately before the following instruction. - nextItr = getIndexAfter(mi).listEntry(); + nextItr = getIndexAfter(mi).listEntry()->getIterator(); prevItr = std::prev(nextItr); } else { // Insert mi's index immediately after the preceding instruction. - prevItr = getIndexBefore(mi).listEntry(); + prevItr = getIndexBefore(mi).listEntry()->getIterator(); nextItr = std::next(prevItr); } @@ -649,11 +649,11 @@ namespace llvm { if (nextMBB == mbb->getParent()->end()) { startEntry = &indexList.back(); endEntry = createEntry(nullptr, 0); - newItr = indexList.insertAfter(startEntry, endEntry); + newItr = indexList.insertAfter(startEntry->getIterator(), endEntry); } else { startEntry = createEntry(nullptr, 0); - endEntry = getMBBStartIdx(nextMBB).listEntry(); - newItr = indexList.insert(endEntry, startEntry); + endEntry = getMBBStartIdx(&*nextMBB).listEntry(); + newItr = indexList.insert(endEntry->getIterator(), startEntry); } SlotIndex startIdx(startEntry, SlotIndex::Slot_Block); -- 2.50.1