diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 7aa77e55dbfcc..3a1db4f1a7a90 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -3633,7 +3633,7 @@ static llvm::StoreInst *findDominatingStoreToReturnValue(CodeGenFunction &CGF) { // Look at directly preceding instruction, skipping bitcasts, lifetime // markers, and fake uses and their operands. const llvm::Instruction *LoadIntoFakeUse = nullptr; - for (llvm::Instruction &I : make_range(IP->rbegin(), IP->rend())) { + for (llvm::Instruction &I : llvm::reverse(*IP)) { // Ignore instructions that are just loads for fake uses; the load should // immediately precede the fake use, so we only need to remember the // operand for the last fake use seen.