summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 19:52:15 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-02-21 19:52:15 +0000
commita848c47130b9cd328958f02a3e01e66334b60bf3 (patch)
treed52638375d8d23ddfe4e50ee9e8de8a5c2e4b792 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent4ab89ea1871113d7db98e35053b3b02ccc936310 (diff)
downloadbcm5719-llvm-a848c47130b9cd328958f02a3e01e66334b60bf3.tar.gz
bcm5719-llvm-a848c47130b9cd328958f02a3e01e66334b60bf3.zip
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. llvm-svn: 261495
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index a4e382d9c85..4b9cc003ee2 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5458,11 +5458,9 @@ bool CodeGenPrepare::splitBranchCondition(Function &F) {
DEBUG(dbgs() << "Before branch condition splitting\n"; BB.dump());
// Create a new BB.
- auto *InsertBefore = std::next(Function::iterator(BB))
- .getNodePtrUnchecked();
- auto TmpBB = BasicBlock::Create(BB.getContext(),
- BB.getName() + ".cond.split",
- BB.getParent(), InsertBefore);
+ auto TmpBB =
+ BasicBlock::Create(BB.getContext(), BB.getName() + ".cond.split",
+ BB.getParent(), BB.getNextNode());
// Update original basic block by using the first condition directly by the
// branch instruction and removing the no longer needed and/or instruction.
OpenPOWER on IntegriCloud