File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -568,9 +568,9 @@ void CGDebugInfo::CreateCompileUnit() {
568
568
if (LO.CPlusPlus ) {
569
569
if (LO.ObjC )
570
570
LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
571
- else if (LO.CPlusPlus14 )
571
+ else if (LO.CPlusPlus14 && CGM. getCodeGenOpts (). DwarfVersion >= 5 )
572
572
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
573
- else if (LO.CPlusPlus11 )
573
+ else if (LO.CPlusPlus11 && CGM. getCodeGenOpts (). DwarfVersion >= 5 )
574
574
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
575
575
else
576
576
LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -triple %itanium_abi_triple %s -o - \
2
+ // RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \
3
+ // RUN: | FileCheck --check-prefix=CHECK-DWARF5 %s
4
+ // RUN: %clang_cc1 -dwarf-version=3 -emit-llvm -triple %itanium_abi_triple %s -o - \
5
+ // RUN: -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \
6
+ // RUN: | FileCheck --check-prefix=CHECK-DWARF3 %s
7
+
8
+ int main () {
9
+ return 0 ;
10
+ }
11
+
12
+ // CHECK-DWARF5: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14,
13
+ // CHECK-DWARF3: distinct !DICompileUnit(language: DW_LANG_C_plus_plus,
Original file line number Diff line number Diff line change 23
23
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
24
24
25
25
// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
26
- // CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11 ,
26
+ // CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus ,
27
27
// CHECK-SAME: isOptimized: false,
28
28
// CHECK-NOT: splitDebugFilename:
29
29
// CHECK-SAME: dwoId:
You can’t perform that action at this time.
0 commit comments