Skip to content

Commit 26c63c9

Browse files
committed
---
yaml --- r: 347880 b: refs/heads/master c: 6c192e2 h: refs/heads/master
1 parent da061a8 commit 26c63c9

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 72c066d790919ff8bab0b67c876c052e83ec86df
2+
refs/heads/master: 6c192e2081d81e3b67cbd46e76a350c3e27ed054
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/FrontendTool/FrontendTool.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ 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 optimization and diagnostics pipelines.
54+
virtual void performedSILProcessing(SILModule &module);
55+
56+
// TODO: maybe enhance this interface to hear about IRGen and LLVM
57+
// progress.
4558
};
4659

4760
namespace frontend {

trunk/lib/FrontendTool/FrontendTool.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,9 @@ static bool performCompile(CompilerInstance &Instance,
10051005
if (Action == FrontendOptions::ActionType::ResolveImports)
10061006
return Context.hadError();
10071007

1008+
if (observer)
1009+
observer->performedSemanticAnalysis(Instance);
1010+
10081011
if (Stats)
10091012
countStatsPostSema(*Stats, Instance);
10101013

@@ -1238,6 +1241,9 @@ static bool performCompileStepsPostSILGen(
12381241
if (auto *SF = MSF.dyn_cast<SourceFile *>())
12391242
ricd.emplace(*SF);
12401243

1244+
if (observer)
1245+
observer->performedSILGeneration(*SM);
1246+
12411247
if (Stats)
12421248
countStatsPostSILGen(*Stats, *SM);
12431249

@@ -1284,6 +1290,9 @@ static bool performCompileStepsPostSILGen(
12841290
if (Instance.performSILProcessing(SM.get(), Stats))
12851291
return true;
12861292

1293+
if (observer)
1294+
observer->performedSILProcessing(*SM);
1295+
12871296
emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance, Invocation,
12881297
moduleIsPublic);
12891298

@@ -1847,3 +1856,6 @@ int swift::performFrontend(ArrayRef<const char *> Args,
18471856

18481857
void FrontendObserver::parsedArgs(CompilerInvocation &invocation) {}
18491858
void FrontendObserver::configuredCompiler(CompilerInstance &instance) {}
1859+
void FrontendObserver::performedSemanticAnalysis(CompilerInstance &instance) {}
1860+
void FrontendObserver::performedSILGeneration(SILModule &module) {}
1861+
void FrontendObserver::performedSILProcessing(SILModule &module) {}

0 commit comments

Comments
 (0)