Skip to content

[Frontend] Some pipeline refactoring #32601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Frontend] Move mangling stats to end of pipeline
  • Loading branch information
hamishknight committed Jun 29, 2020
commit 12ae72c8082ec3220eb874f10c913e160bdffeb3
10 changes: 5 additions & 5 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,13 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
if (auto *stats = ctx.Stats)
countASTStats(*stats, Instance);

// Report mangling stats if there was no error.
if (!ctx.hadError())
Mangle::printManglingStats();

// Make sure we didn't load a module during a parse-only invocation, unless
// it's -emit-imported-modules, which can load modules.
auto action = Instance.getInvocation().getFrontendOptions().RequestedAction;
auto action = opts.RequestedAction;
if (FrontendOptions::shouldActionOnlyParse(action) &&
action != FrontendOptions::ActionType::EmitImportedModules) {
assert(ctx.getNumLoadedModules() == 1 &&
Expand Down Expand Up @@ -2219,10 +2223,6 @@ int swift::performFrontend(ArrayRef<const char *> Args,

int ReturnValue = 0;
bool HadError = performCompile(*Instance, Args, ReturnValue, observer);
if (!HadError) {
Mangle::printManglingStats();
}

if (!HadError && !Invocation.getFrontendOptions().DumpAPIPath.empty()) {
HadError = dumpAPI(Instance->getMainModule(),
Invocation.getFrontendOptions().DumpAPIPath);
Expand Down