Skip to content

Commit c9c0794

Browse files
Merge pull request #40651 from adrian-prantl/86279876
Initialize clang::CodeGenOptions.DebugExtRefs in ClangImporter.
2 parents d6d848c + d60f184 commit c9c0794

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
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(

lib/IRGen/IRGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
103103
auto &CGO = Importer->getClangCodeGenOpts();
104104
CGO.OptimizationLevel = Opts.shouldOptimize() ? 3 : 0;
105105

106+
CGO.DebugTypeExtRefs = !Opts.DisableClangModuleSkeletonCUs;
106107
CGO.DiscardValueNames = !Opts.shouldProvideValueNames();
107108
switch (Opts.DebugInfoLevel) {
108109
case IRGenDebugInfoLevel::None:
@@ -113,7 +114,6 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
113114
break;
114115
case IRGenDebugInfoLevel::ASTTypes:
115116
case IRGenDebugInfoLevel::DwarfTypes:
116-
CGO.DebugTypeExtRefs = !Opts.DisableClangModuleSkeletonCUs;
117117
CGO.setDebugInfo(clang::codegenoptions::DebugInfoKind::FullDebugInfo);
118118
break;
119119
}

0 commit comments

Comments
 (0)