[all-commits] [llvm/llvm-project] f56cb5: [DEBUGINFO] [LLDB] Add support for generating debu...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Thu Feb 17 11:14:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f56cb520d8554ca42a215e82ecfa58d0b6c178e4
      https://github.com/llvm/llvm-project/commit/f56cb520d8554ca42a215e82ecfa58d0b6c178e4
  Author: Shafik Yaghmour <syaghmour at apple.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    A clang/test/CodeGenCXX/debug-info-structured-binding.cpp
    A lldb/test/API/lang/cpp/structured-binding/Makefile
    A lldb/test/API/lang/cpp/structured-binding/TestStructuredBinding.py
    A lldb/test/API/lang/cpp/structured-binding/main.cpp

  Log Message:
  -----------
  [DEBUGINFO] [LLDB] Add support for generating debug-info for structured bindings of structs and arrays

Currently we are not emitting debug-info for all cases of structured bindings a
C++17 feature which allows us to bind names to subobjects in an initializer.

A structured binding is represented by a DecompositionDecl AST node and the
binding are represented by a BindingDecl. It looks the original implementation
only covered the tuple like case which be represented by a DeclRefExpr which
contains a VarDecl.

If the binding is to a subobject of the struct the binding will contain a
MemberExpr and in the case of arrays it will contain an ArraySubscriptExpr.
This PR adds support emitting debug-info for the MemberExpr and ArraySubscriptExpr
cases as well as llvm and lldb tests for these cases as well as the tuple case.

Differential Revision: https://reviews.llvm.org/D119178




More information about the All-commits mailing list