aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-08 09:09:39 -0800
committerKazu Hirata <kazu@google.com>2021-11-08 09:09:39 -0800
commit3c06920cd12f28b63be9d59dc02b50e1815447da (patch)
treedaf02e816692e082e9b3841857301f6a553b8749 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent2829376bb267f3364c1225ffaac8b1b8b5688ed1 (diff)
downloadllvm-3c06920cd12f28b63be9d59dc02b50e1815447da.zip
llvm-3c06920cd12f28b63be9d59dc02b50e1815447da.tar.gz
llvm-3c06920cd12f28b63be9d59dc02b50e1815447da.tar.bz2
[llvm] Use make_early_inc_range (NFC)
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 8b0846d..c568461 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5538,21 +5538,16 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
// Upgrade any old intrinsic calls in the function.
for (auto &I : UpgradedIntrinsics) {
- for (auto UI = I.first->materialized_user_begin(), UE = I.first->user_end();
- UI != UE;) {
- User *U = *UI;
- ++UI;
+ for (User *U : llvm::make_early_inc_range(I.first->materialized_users()))
if (CallInst *CI = dyn_cast<CallInst>(U))
UpgradeIntrinsicCall(CI, I.second);
- }
}
// Update calls to the remangled intrinsics
for (auto &I : RemangledIntrinsics)
- for (auto UI = I.first->materialized_user_begin(), UE = I.first->user_end();
- UI != UE;)
+ for (User *U : llvm::make_early_inc_range(I.first->materialized_users()))
// Don't expect any other users than call sites
- cast<CallBase>(*UI++)->setCalledFunction(I.second);
+ cast<CallBase>(U)->setCalledFunction(I.second);
// Finish fn->subprogram upgrade for materialized functions.
if (DISubprogram *SP = MDLoader->lookupSubprogramForFunction(F))