Skip to content

Commit 8d1fddf

Browse files
committed
FineModuleTrace: add a blocklist action for skipping fine module tracing
1 parent a586e4b commit 8d1fddf

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

include/swift/Basic/BlockListAction.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ BLOCKLIST_ACTION(ShouldUseBinaryModule)
2323
BLOCKLIST_ACTION(ShouldUseTextualModule)
2424
BLOCKLIST_ACTION(DowngradeInterfaceVerificationFailure)
2525
BLOCKLIST_ACTION(ShouldUseLayoutStringValueWitnesses)
26+
BLOCKLIST_ACTION(SkipEmittingFineModuleTrace)
2627

2728
#undef BLOCKLIST_ACTION

lib/FrontendTool/LoadedModuleTrace.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,9 @@ bool swift::emitFineModuleTraceIfNeeded(CompilerInstance &Instance,
951951
}
952952
ModuleDecl *mainModule = Instance.getMainModule();
953953
ASTContext &ctxt = mainModule->getASTContext();
954+
if (ctxt.blockListConfig.hasBlockListAction(mainModule->getNameStr(),
955+
BlockListKeyKind::ModuleName, BlockListAction::SkipEmittingFineModuleTrace))
956+
return false;
954957
assert(!ctxt.hadError() &&
955958
"We should've already exited earlier if there was an error.");
956959

test/IDE/objc_send_collector_1.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
// RUN: SWIFT_COMPILER_FINE_GRAINED_TRACE_PATH=%t/given_trace_2.json %target-swift-frontend -I %t/lib/swift -emit-module %s %S/Inputs/objc_send_collector_2.swift -module-name main -swift-version 5 -F %S/Inputs/mock-sdk -emit-loaded-module-trace-path %t/.MODULE_TRACE -enable-library-evolution
1111
// RUN: not ls %t/given_trace_2.json
1212

13+
14+
// RUN: echo "---" > %t/blocklist.yml
15+
// RUN: echo "SkipEmittingFineModuleTrace:" >> %t/blocklist.yml
16+
// RUN: echo " ModuleName:" >> %t/blocklist.yml
17+
// RUN: echo " - FooBar" >> %t/blocklist.yml
18+
19+
// RUN: SWIFT_COMPILER_FINE_GRAINED_TRACE_PATH=%t/given_trace_3.json %target-swift-frontend -I %t/lib/swift -typecheck %s %S/Inputs/objc_send_collector_2.swift -module-name FooBar -swift-version 5 -F %S/Inputs/mock-sdk -emit-loaded-module-trace-path %t/.MODULE_TRACE -blocklist-file %t/blocklist.yml
20+
// RUN: not ls %t/given_trace_3.json
21+
1322
// REQUIRES: objc_interop
1423

1524
import Foo

0 commit comments

Comments
 (0)