Skip to content

Commit c30f256

Browse files
committed
Initialize clang::CodeGenOptions.DebugExtRefs in ClangImporter.
This fixes a race condition in parallel builds. DebugExtRefs is part of the Clang module hash. ObjectFilePCHContainerOperations has its own CodenOpts object which always sets DebugExtRefs=true, so the module has could differ depending on whether a module was built as a top-level module or as a dependency of another module. This fixes the SwiftREPL tests. rdar://86279876
1 parent f0b7065 commit c30f256

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,10 @@ ClangImporter::create(ASTContext &ctx,
11301130

11311131
// Create a compiler instance.
11321132
{
1133+
// The Clang modules produced by ClangImporter are always embedded in an
1134+
// ObjectFilePCHContainer and contain -gmodules debug info.
1135+
importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true;
1136+
11331137
auto PCHContainerOperations =
11341138
std::make_shared<clang::PCHContainerOperations>();
11351139
PCHContainerOperations->registerWriter(

0 commit comments

Comments
 (0)