diff options
author | Fangrui Song <i@maskray.me> | 2022-03-23 15:31:09 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-03-23 15:31:09 -0700 |
commit | dcad676958e7b8345784e4b19c45d6bada9a3836 (patch) | |
tree | 2561c38cece92af7915b1118f7ec04b912754cfb /llvm/lib/Analysis/CGSCCPassManager.cpp | |
parent | 12606d16bc3e1c75eefc781863b199b930137068 (diff) | |
download | llvm-dcad676958e7b8345784e4b19c45d6bada9a3836.zip llvm-dcad676958e7b8345784e4b19c45d6bada9a3836.tar.gz llvm-dcad676958e7b8345784e4b19c45d6bada9a3836.tar.bz2 |
[CGSCC] Use make_early_inc_range. NFC
Diffstat (limited to 'llvm/lib/Analysis/CGSCCPassManager.cpp')
-rw-r--r-- | llvm/lib/Analysis/CGSCCPassManager.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp index 0221031..b2e7422 100644 --- a/llvm/lib/Analysis/CGSCCPassManager.cpp +++ b/llvm/lib/Analysis/CGSCCPassManager.cpp @@ -174,9 +174,8 @@ ModuleToPostOrderCGSCCPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) { PreservedAnalyses PA = PreservedAnalyses::all(); CG.buildRefSCCs(); - for (auto RCI = CG.postorder_ref_scc_begin(), - RCE = CG.postorder_ref_scc_end(); - RCI != RCE;) { + for (LazyCallGraph::RefSCC &RC : + llvm::make_early_inc_range(CG.postorder_ref_sccs())) { assert(RCWorklist.empty() && "Should always start with an empty RefSCC worklist"); // The postorder_ref_sccs range we are walking is lazily constructed, so @@ -190,7 +189,7 @@ ModuleToPostOrderCGSCCPassAdaptor::run(Module &M, ModuleAnalysisManager &AM) { // // We also eagerly increment the iterator to the next position because // the CGSCC passes below may delete the current RefSCC. - RCWorklist.insert(&*RCI++); + RCWorklist.insert(&RC); do { LazyCallGraph::RefSCC *RC = RCWorklist.pop_back_val(); |