Skip to content

Commit d60f184

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 (cherry picked from commit c30f256)
1 parent 046400d commit d60f184

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
@@ -1129,6 +1129,10 @@ ClangImporter::create(ASTContext &ctx,
11291129

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

0 commit comments

Comments
 (0)