Remove all uses of ilist_node::getNextNode() and ilist_node::getPrevNode() in favor of just using iterators.

This change is needed for the next update to ToT LLVM. It can be put
into place now without breaking anything so I am committing it now.

The churn upstream on ilist_node is neccessary to remove undefined
behavior. Rather than updating the different ilist_node patches for the
hacky change required to not use iterators, just use iterators and keep
everything as ilist_nodes. Upstream they want to eventually do this, so
it makes sense for us to just do it now.

Please do not introduce new invocations of
ilist_node::get{Next,Prev}Node() into the tree.
This commit is contained in:
Michael Gottesman
2015-11-18 13:06:01 -08:00
parent 2874743528
commit e25cd8860c
7 changed files with 37 additions and 28 deletions

View File

@@ -1881,7 +1881,7 @@ SILValue LifetimeChecker::handleConditionalInitAssign() {
}
// Before the memory allocation, store zero in the control variable.
B.setInsertionPoint(TheMemory.MemoryInst->getNextNode());
B.setInsertionPoint(&*std::next(TheMemory.MemoryInst->getIterator()));
SILValue ControlVariableAddr = ControlVariableBox;
auto Zero = B.createIntegerLiteral(Loc, IVType, 0);
B.createStore(Loc, Zero, ControlVariableAddr);