DWARF-5 Supported languages Tags C++03, C++11,C++14

Hello Everyone,

I’m working on providing support for New Language Tags, prescribed in DWARF-5.
DW_LANG_C_plus_plus_03
DW_LANG_C_plus_plus_11
DW_LANG_C_plus_plus_14

While, C++11 and C++14, is defined and can be emitted by Frontend.
“include/clang/Basci/LangStandard.h”

CPlusPlus = (1 << 5),
CPlusPlus11 = (1 << 6),
CPlusPlus14 = (1 << 7),
CPlusPlus17 = (1 << 8),
CPlusPlus2a = (1 << 9),

Currently CLANG emits “DW_LANG_C_plus_plus” which in DWARF suggests ISO C++98, regardless of the -std=… specified in commandline.
Also in file “include/clang/Basci/LangStandards.def” CLANG has aliased c++98 and c++03.

// C++ modes
LANGSTANDARD(cxx98, “c++98”,
CXX, “ISO C++ 1998 with amendments”,
LineComment | CPlusPlus | Digraphs)
LANGSTANDARD_ALIAS(cxx98, “c++03”)

So, my query is that since, c++98 and c++03 is mostly same assuming CLANG Frontend.
Should we also support DW_LANG_C_plus_plus_03 ? for -std=c++03 in Frontend or let it remain alias of c++98.

LLVM AsmPrinters has already code for supporting these new DWARF-5 Language Tags.
So, If we decide not to go with DW_LANG_C_plus_plus_03, we’ll have to remove it’s reference from llvm, since frontend won’t emit it at all.

Thanks!
Sourabh Singh Tomar

It's OK if LLVM supports things Clang does not.

What does GCC do with the language attribute in different C++
versions? How does LLDB and GDB handle different C++ language versions
specified this way?

It's OK if LLVM supports things Clang does not.

What does GCC do with the language attribute in different C++
versions? How does LLDB and GDB handle different C++ language versions
specified this way?

LLDB should be doing the right thing; it knows that all of these are C++. It will ignore the language version for initializing the expression evaluator with that version though, since the expression evaluator is global for the entire program and there is no guarantee that all TUs use the same dialect (also it uses Objective-C++ as the language, always).

-- adrian