mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
ADT: Stop using getNodePtrUnchecked on end() iterators
Stop using `getNodePtrUnchecked()` when building IR. Eventually a dereference will be required to get at the downcast node, since the iterator will only store an `ilist_node_base` of some sort. This should have no functionality change for now, but is a path towards removing some more UB from ilist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261495 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -361,10 +361,8 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) {
|
||||
assert(I != InstList.end() &&
|
||||
"Trying to get me to create degenerate basic block!");
|
||||
|
||||
BasicBlock *InsertBefore = std::next(Function::iterator(this))
|
||||
.getNodePtrUnchecked();
|
||||
BasicBlock *New = BasicBlock::Create(getContext(), BBName,
|
||||
getParent(), InsertBefore);
|
||||
BasicBlock *New = BasicBlock::Create(getContext(), BBName, getParent(),
|
||||
this->getNextNode());
|
||||
|
||||
// Save DebugLoc of split point before invalidating iterator.
|
||||
DebugLoc Loc = I->getDebugLoc();
|
||||
|
||||
Reference in New Issue
Block a user