Skip to content

Commit 7b43e1d

Browse files
author
Harlan Haskins
committed
[FrontendTool] [NFC] Reduce scope of FrontendObserver
These APIs weren't used.
1 parent c3c6fdc commit 7b43e1d

File tree

3 files changed

+1
-41
lines changed

3 files changed

+1
-41
lines changed

include/swift/FrontendTool/FrontendTool.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,6 @@ class FrontendObserver {
4242

4343
/// The frontend has configured the compiler instance.
4444
virtual void configuredCompiler(CompilerInstance &instance);
45-
46-
/// The frontend has performed semantic analysis.
47-
virtual void performedSemanticAnalysis(CompilerInstance &instance);
48-
49-
/// The frontend has performed basic SIL generation.
50-
/// SIL diagnostic passes have not yet been applied.
51-
virtual void performedSILGeneration(SILModule &module);
52-
53-
/// The frontend has executed the SIL diagnostic passes.
54-
virtual void performedSILDiagnostics(SILModule &module);
55-
56-
/// The frontend has executed the SIL optimization pipeline.
57-
virtual void performedSILOptimization(SILModule &module);
58-
59-
/// The frontend is about to run the program as an immediate script.
60-
virtual void aboutToRunImmediately(CompilerInstance &instance);
61-
62-
// TODO: maybe enhance this interface to hear about IRGen and LLVM
63-
// progress.
6445
};
6546

6647
/// Perform all the operations of the frontend, exactly as if invoked

lib/FrontendTool/FrontendTool.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,6 @@ static bool performCompile(CompilerInstance &Instance,
960960
if (Action == FrontendOptions::ActionType::ResolveImports)
961961
return Context.hadError();
962962

963-
if (observer)
964-
observer->performedSemanticAnalysis(Instance);
965-
966963
if (Stats)
967964
countStatsPostSema(*Stats, Instance);
968965

@@ -1051,10 +1048,6 @@ static bool performMandatorySILPasses(CompilerInvocation &Invocation,
10511048
} else if (!Invocation.getDiagnosticOptions().SkipDiagnosticPasses) {
10521049
if (runSILDiagnosticPasses(*SM))
10531050
return true;
1054-
1055-
if (observer) {
1056-
observer->performedSILDiagnostics(*SM);
1057-
}
10581051
} else {
10591052
// Even if we are not supposed to run the diagnostic passes, we still need
10601053
// to run the ownership evaluator.
@@ -1154,9 +1147,6 @@ static bool processCommandLineAndRunImmediately(CompilerInvocation &Invocation,
11541147
ProcessCmdLine(opts.ImmediateArgv.begin(), opts.ImmediateArgv.end());
11551148
Instance.setSILModule(std::move(SM));
11561149

1157-
if (observer)
1158-
observer->aboutToRunImmediately(Instance);
1159-
11601150
ReturnValue =
11611151
RunImmediately(Instance, CmdLine, IRGenOpts, Invocation.getSILOptions());
11621152
return Instance.getASTContext().hadError();
@@ -1243,9 +1233,6 @@ static bool performCompileStepsPostSILGen(
12431233
SILOptions &SILOpts = Invocation.getSILOptions();
12441234
IRGenOptions &IRGenOpts = Invocation.getIRGenOptions();
12451235

1246-
if (observer)
1247-
observer->performedSILGeneration(*SM);
1248-
12491236
if (Stats)
12501237
countStatsPostSILGen(*Stats, *SM);
12511238

@@ -1301,9 +1288,6 @@ static bool performCompileStepsPostSILGen(
13011288

13021289
performSILOptimizations(Invocation, SM.get());
13031290

1304-
if (observer)
1305-
observer->performedSILOptimization(*SM);
1306-
13071291
if (Stats)
13081292
countStatsPostSILOpt(*Stats, *SM);
13091293

@@ -1873,8 +1857,3 @@ int swift::performFrontend(ArrayRef<const char *> Args,
18731857

18741858
void FrontendObserver::parsedArgs(CompilerInvocation &invocation) {}
18751859
void FrontendObserver::configuredCompiler(CompilerInstance &instance) {}
1876-
void FrontendObserver::performedSemanticAnalysis(CompilerInstance &instance) {}
1877-
void FrontendObserver::performedSILGeneration(SILModule &module) {}
1878-
void FrontendObserver::performedSILDiagnostics(SILModule &module) {}
1879-
void FrontendObserver::performedSILOptimization(SILModule &module) {}
1880-
void FrontendObserver::aboutToRunImmediately(CompilerInstance &instance) {}

tools/swift-remoteast-test/swift-remoteast-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ printDynamicTypeAndAddressForExistential(void *object,
178178
namespace {
179179

180180
struct Observer : public FrontendObserver {
181-
void aboutToRunImmediately(CompilerInstance &instance) override {
181+
void configuredCompiler(CompilerInstance &instance) override {
182182
Context = &instance.getASTContext();
183183
}
184184
};

0 commit comments

Comments
 (0)