Skip to content

Commit a622067

Browse files
use reviewer suggested style
1 parent 00da984 commit a622067

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,13 +2080,12 @@ splitCoroutine(Function &F, SmallVectorImpl<Function *> &Clones,
20802080
return Shape;
20812081
}
20822082

2083-
static LazyCallGraph::SCC &updateCallGraphAfterCoroutineSplit(
2083+
static void updateCallGraphAfterCoroutineSplit(
20842084
LazyCallGraph::Node &N, const coro::Shape &Shape,
2085-
const SmallVectorImpl<Function *> &Clones, LazyCallGraph::SCC &C,
2085+
const SmallVectorImpl<Function *> &Clones, LazyCallGraph::SCC *&C,
20862086
LazyCallGraph &CG, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR,
20872087
FunctionAnalysisManager &FAM) {
20882088

2089-
auto *CurrentSCC = &C;
20902089
if (!Clones.empty()) {
20912090
switch (Shape.ABI) {
20922091
case coro::ABI::Switch:
@@ -2106,16 +2105,13 @@ static LazyCallGraph::SCC &updateCallGraphAfterCoroutineSplit(
21062105
}
21072106

21082107
// Let the CGSCC infra handle the changes to the original function.
2109-
CurrentSCC = &updateCGAndAnalysisManagerForCGSCCPass(CG, *CurrentSCC, N, AM,
2110-
UR, FAM);
2108+
C = &updateCGAndAnalysisManagerForCGSCCPass(CG, *C, N, AM, UR, FAM);
21112109
}
21122110

21132111
// Do some cleanup and let the CGSCC infra see if we've cleaned up any edges
21142112
// to the split functions.
21152113
postSplitCleanup(N.getFunction());
2116-
CurrentSCC = &updateCGAndAnalysisManagerForFunctionPass(CG, *CurrentSCC, N,
2117-
AM, UR, FAM);
2118-
return *CurrentSCC;
2114+
C = &updateCGAndAnalysisManagerForFunctionPass(CG, *C, N, AM, UR, FAM);
21192115
}
21202116

21212117
/// Replace a call to llvm.coro.prepare.retcon.
@@ -2216,8 +2212,8 @@ PreservedAnalyses CoroSplitPass::run(LazyCallGraph::SCC &C,
22162212
coro::Shape Shape =
22172213
splitCoroutine(F, Clones, FAM.getResult<TargetIRAnalysis>(F),
22182214
OptimizeFrame, MaterializableCallback);
2219-
CurrentSCC = &updateCallGraphAfterCoroutineSplit(
2220-
*N, Shape, Clones, *CurrentSCC, CG, AM, UR, FAM);
2215+
updateCallGraphAfterCoroutineSplit(*N, Shape, Clones, CurrentSCC, CG, AM,
2216+
UR, FAM);
22212217

22222218
auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
22232219
ORE.emit([&]() {

0 commit comments

Comments
 (0)