FineModuleTracing: being blocklisted in collecting fine trace shouldn't change that the promised file is being emitted

This commit is contained in:
Xi Ge
2024-12-20 21:31:48 -08:00
parent c8fa52b96d
commit 049f381807
2 changed files with 14 additions and 9 deletions

View File

@@ -876,11 +876,17 @@ static void createFineModuleTraceFile(CompilerInstance &instance,
return;
}
ObjcMethodReferenceCollector collector(MD);
instance.forEachFileToTypeCheck([&](SourceFile& SF) {
collector.setFileBeforeVisiting(&SF);
collector.walk(SF);
return false;
});
auto blocklisted = ctx.blockListConfig.hasBlockListAction(MD->getNameStr(),
BlockListKeyKind::ModuleName, BlockListAction::SkipEmittingFineModuleTrace);
if (!blocklisted) {
instance.forEachFileToTypeCheck([&](SourceFile& SF) {
collector.setFileBeforeVisiting(&SF);
collector.walk(SF);
return false;
});
}
// print this json line.
std::string stringBuffer;
@@ -903,9 +909,6 @@ bool swift::emitFineModuleTraceIfNeeded(CompilerInstance &Instance,
const FrontendOptions &opts) {
ModuleDecl *mainModule = Instance.getMainModule();
ASTContext &ctxt = mainModule->getASTContext();
if (ctxt.blockListConfig.hasBlockListAction(mainModule->getNameStr(),
BlockListKeyKind::ModuleName, BlockListAction::SkipEmittingFineModuleTrace))
return false;
assert(!ctxt.hadError() &&
"We should've already exited earlier if there was an error.");