summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp7
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp12
2 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index c8dc01ed05a..8f1b4aada1a 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2614,10 +2614,9 @@ static void deactivateArgCleanupsBeforeCall(CodeGenFunction &CGF,
ArrayRef<CallArgList::CallArgCleanup> Cleanups =
CallArgs.getCleanupsToDeactivate();
// Iterate in reverse to increase the likelihood of popping the cleanup.
- for (ArrayRef<CallArgList::CallArgCleanup>::reverse_iterator
- I = Cleanups.rbegin(), E = Cleanups.rend(); I != E; ++I) {
- CGF.DeactivateCleanupBlock(I->Cleanup, I->IsActiveIP);
- I->IsActiveIP->eraseFromParent();
+ for (const auto &I : llvm::reverse(Cleanups)) {
+ CGF.DeactivateCleanupBlock(I.Cleanup, I.IsActiveIP);
+ I.IsActiveIP->eraseFromParent();
}
}
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 9a82caff45c..90e45a011ca 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -496,12 +496,12 @@ struct CounterCoverageMappingBuilder
llvm::SmallSet<SourceLocation, 8> StartLocs;
Optional<Counter> ParentCounter;
- for (auto I = RegionStack.rbegin(), E = RegionStack.rend(); I != E; ++I) {
- if (!I->hasStartLoc())
+ for (SourceMappingRegion &I : llvm::reverse(RegionStack)) {
+ if (!I.hasStartLoc())
continue;
- SourceLocation Loc = I->getStartLoc();
+ SourceLocation Loc = I.getStartLoc();
if (!isNestedIn(Loc, ParentFile)) {
- ParentCounter = I->getCounter();
+ ParentCounter = I.getCounter();
break;
}
@@ -510,11 +510,11 @@ struct CounterCoverageMappingBuilder
// correct count. We avoid creating redundant regions by stopping once
// we've seen this region.
if (StartLocs.insert(Loc).second)
- SourceRegions.emplace_back(I->getCounter(), Loc,
+ SourceRegions.emplace_back(I.getCounter(), Loc,
getEndOfFileOrMacro(Loc));
Loc = getIncludeOrExpansionLoc(Loc);
}
- I->setStartLoc(getPreciseTokenLocEnd(Loc));
+ I.setStartLoc(getPreciseTokenLocEnd(Loc));
}
if (ParentCounter) {
OpenPOWER on IntegriCloud