[Lldb-commits] [PATCH] D143062: [lldb] Allow evaluating expressions in C++20 mode

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 1 03:47:40 PST 2023


Michael137 created this revision.
Michael137 added reviewers: aprantl, labath.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This patch allows users to evaluate expressions using
`expr -l c++20`. Currently DWARF keeps the CU's at
`DW_AT_language` at `DW_LANG_C_plus_plus_14` even
when compiling with `-std=c++20`. So even in "C++20
programs" expression evaluation will by default be
performed in `C++11` mode for now.

Enabling `C++14` has been previously attempted at
https://reviews.llvm.org/D80308

There are some remaining issues around evaluating C++20
expressions. Mainly, lack of support for C++20 AST nodes in
`clang::ASTImporter`. But these can be addressed in follow-up
patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143062

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Target/Language.cpp
  lldb/test/API/lang/cpp/standards/cpp20/Makefile
  lldb/test/API/lang/cpp/standards/cpp20/TestCPP20Standard.py
  lldb/test/API/lang/cpp/standards/cpp20/main.cpp
  lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143062.493897.patch
Type: text/x-patch
Size: 7743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230201/b017785f/attachment.bin>


More information about the lldb-commits mailing list