Skip to content

Commit 12ae72c

Browse files
committed
[Frontend] Move mangling stats to end of pipeline
1 parent 7bc5440 commit 12ae72c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,9 +1241,13 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
12411241
if (auto *stats = ctx.Stats)
12421242
countASTStats(*stats, Instance);
12431243

1244+
// Report mangling stats if there was no error.
1245+
if (!ctx.hadError())
1246+
Mangle::printManglingStats();
1247+
12441248
// Make sure we didn't load a module during a parse-only invocation, unless
12451249
// it's -emit-imported-modules, which can load modules.
1246-
auto action = Instance.getInvocation().getFrontendOptions().RequestedAction;
1250+
auto action = opts.RequestedAction;
12471251
if (FrontendOptions::shouldActionOnlyParse(action) &&
12481252
action != FrontendOptions::ActionType::EmitImportedModules) {
12491253
assert(ctx.getNumLoadedModules() == 1 &&
@@ -2219,10 +2223,6 @@ int swift::performFrontend(ArrayRef<const char *> Args,
22192223

22202224
int ReturnValue = 0;
22212225
bool HadError = performCompile(*Instance, Args, ReturnValue, observer);
2222-
if (!HadError) {
2223-
Mangle::printManglingStats();
2224-
}
2225-
22262226
if (!HadError && !Invocation.getFrontendOptions().DumpAPIPath.empty()) {
22272227
HadError = dumpAPI(Instance->getMainModule(),
22282228
Invocation.getFrontendOptions().DumpAPIPath);

0 commit comments

Comments
 (0)