diff options
| -rw-r--r-- | llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp index 9ceb76a8e35..c7b9564c63f 100644 --- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp +++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp @@ -1344,8 +1344,11 @@ bool LowerTypeTestsModule::lower() {      return false;    if (Action == SummaryAction::Import) { -    for (const Use &U : TypeTestFunc->uses()) -      importTypeTest(cast<CallInst>(U.getUser())); +    for (auto UI = TypeTestFunc->use_begin(), UE = TypeTestFunc->use_end(); +         UI != UE;) { +      auto *CI = cast<CallInst>((*UI++).getUser()); +      importTypeTest(CI); +    }      return true;    }  | 

