Revert "[DebugInfo] Fix the mismatching between C++ language tags and Dwarf versions."
authorEsme-Yi <esme.yi@ibm.com>
Mon, 12 Apr 2021 10:36:46 +0000 (10:36 +0000)
committerEsme-Yi <esme.yi@ibm.com>
Mon, 12 Apr 2021 10:36:46 +0000 (10:36 +0000)
This reverts commit 62fa9b9388aa114e3b1a58bbdbcd966ae3492ba5.

clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-programming-language.cpp [deleted file]
clang/test/Modules/ModuleDebugInfo.cpp

index 290cdbf..d20b309 100644 (file)
@@ -568,9 +568,9 @@ void CGDebugInfo::CreateCompileUnit() {
   if (LO.CPlusPlus) {
     if (LO.ObjC)
       LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
-    else if (LO.CPlusPlus14 && CGM.getCodeGenOpts().DwarfVersion >= 5)
+    else if (LO.CPlusPlus14)
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
-    else if (LO.CPlusPlus11 && CGM.getCodeGenOpts().DwarfVersion >= 5)
+    else if (LO.CPlusPlus11)
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
     else
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
diff --git a/clang/test/CodeGenCXX/debug-info-programming-language.cpp b/clang/test/CodeGenCXX/debug-info-programming-language.cpp
deleted file mode 100644 (file)
index 82a6db6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: %clang_cc1 -dwarf-version=5  -emit-llvm -triple %itanium_abi_triple %s -o - \
-// RUN:   -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \
-// RUN: | FileCheck --check-prefix=CHECK-DWARF5 %s
-// RUN: %clang_cc1 -dwarf-version=3  -emit-llvm -triple %itanium_abi_triple %s -o - \
-// RUN:   -x c++ -std=c++14 -O0 -disable-llvm-passes -debug-info-kind=limited \
-// RUN: | FileCheck --check-prefix=CHECK-DWARF3 %s
-
-int main() {
-  return 0;
-}
-
-// CHECK-DWARF5: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14,
-// CHECK-DWARF3: distinct !DICompileUnit(language: DW_LANG_C_plus_plus,
index 836f0d2..3121719 100644 (file)
@@ -23,7 +23,7 @@
 // CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
 
 // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
-// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus,
+// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11,
 // CHECK-SAME:                    isOptimized: false,
 // CHECK-NOT:                     splitDebugFilename:
 // CHECK-SAME:                    dwoId: