[PATCH] D99250: [DebugInfo] Fix the mismatching of C++ language tags and Dwarf versions.

ChenZheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 24 04:53:53 PDT 2021


shchenz added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:572
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
-    else if (LO.CPlusPlus11)
+    else if (LO.CPlusPlus11 && CGM.getCodeGenOpts().DwarfVersion >= 5)
       LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
----------------
Seems we miss to handle `DW_LANG_C_plus_plus_03` which is also a DWARF 5 language name value? We always generate `DW_LANG_C_plus_plus` for `-std=c++03` even at `-gdwarf-5`? If so, maybe we also need to fix this in another patch.


================
Comment at: clang/test/CodeGenCXX/debug-info-programming-language.cpp:3
+// RUN:   -x c++ -std=c++14 \
+// RUN:   -O0 -disable-llvm-passes \
+// RUN:   -debug-info-kind=standalone \
----------------
the alignment is a little strange, 80 characters one line?


================
Comment at: clang/test/CodeGenCXX/debug-info-programming-language.cpp:9
+// RUN:   -O0 -disable-llvm-passes \
+// RUN:   -debug-info-kind=standalone \
+// RUN: | FileCheck --check-prefix=CHECK-DWARF3 %s
----------------
is limited debug info kind enough for this test?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99250/new/

https://reviews.llvm.org/D99250



More information about the cfe-commits mailing list