Skip to content

Commit eb200e5

Browse files
committed
Emit the C++ dialect in -gmodules .pcm files.
Because of commit: https://reviews.llvm.org/D104291 the -gmodules .pcm files do not have the same DW_AT_language dialect as the .o file. This was a simple matter of passing the DebugStrictDwarf flag to the PCHContainerGenerator object's CodeGenOpts from the CompilerInstance passed in to it. Before this change if you ran dwarfdump on the gmodule cache folder you would get DW_AT_language (DW_LANG_C_plus_plus) even when using -std=c++14 with clang Patch by Shubham Rastogi! Differential Revision: https://reviews.llvm.org/D116790
1 parent bfeb92c commit eb200e5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class PCHContainerGenerator : public ASTConsumer {
156156
CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning());
157157
CodeGenOpts.DebugPrefixMap =
158158
CI.getInvocation().getCodeGenOpts().DebugPrefixMap;
159+
CodeGenOpts.DebugStrictDwarf = CI.getCodeGenOpts().DebugStrictDwarf;
159160
}
160161

161162
~PCHContainerGenerator() override = default;

clang/test/Modules/ModuleDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
2525

2626
// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
27-
// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus,
27+
// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11,
2828
// CHECK-SAME: isOptimized: false,
2929
// CHECK-NOT: splitDebugFilename:
3030
// CHECK-SAME: dwoId:

0 commit comments

Comments
 (0)