Skip to content

Commit b3e79c5

Browse files
committed
---
yaml --- r: 319413 b: refs/heads/master-rebranch c: 6c192e2 h: refs/heads/master i: 319411: b18371b
1 parent 8228da4 commit b3e79c5

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
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 72c066d790919ff8bab0b67c876c052e83ec86df
1460+
refs/heads/master-rebranch: 6c192e2081d81e3b67cbd46e76a350c3e27ed054

branches/master-rebranch/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 {

branches/master-rebranch/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)