aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-07-28 22:08:12 -0700
committerGitHub <noreply@github.com>2024-07-28 22:08:12 -0700
commit34d48279b8161d2510fff9e94e10c9508d5249f8 (patch)
treeb40338d8453b7ce72dfa3fd61c8b179eabc2edbd /llvm/lib/IR/BasicBlock.cpp
parentdfdef2cbf738dd1cae99fb521d49086fcbbaf19a (diff)
downloadllvm-34d48279b8161d2510fff9e94e10c9508d5249f8.zip
llvm-34d48279b8161d2510fff9e94e10c9508d5249f8.tar.gz
llvm-34d48279b8161d2510fff9e94e10c9508d5249f8.tar.bz2
[llvm] Initialize SmallVector with ranges (NFC) (#100948)
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index bf19934..d9a6b6b 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -626,9 +626,7 @@ BasicBlock *BasicBlock::splitBasicBlockBefore(iterator I, const Twine &BBName) {
// to reflect that the incoming branches will be from the New block and not
// from predecessors of the 'this' block.
// Save predecessors to separate vector before modifying them.
- SmallVector<BasicBlock *, 4> Predecessors;
- for (BasicBlock *Pred : predecessors(this))
- Predecessors.push_back(Pred);
+ SmallVector<BasicBlock *, 4> Predecessors(predecessors(this));
for (BasicBlock *Pred : Predecessors) {
Instruction *TI = Pred->getTerminator();
TI->replaceSuccessorWith(this, New);