[all-commits] [llvm/llvm-project] e403f4: [clang][DebugInfo] Allow function-local statics an...

chbessonova via All-commits all-commits at lists.llvm.org
Mon Dec 6 02:20:48 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e403f4fdc88322201040f2bee7b328e8a78e2f7f
      https://github.com/llvm/llvm-project/commit/e403f4fdc88322201040f2bee7b328e8a78e2f7f
  Author: Kristina Bessonova <kbessonova at accesssoftek.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/CodeGen/CGDecl.cpp
    A clang/test/CodeGenCXX/debug-info-lexcial-block.cpp

  Log Message:
  -----------
  [clang][DebugInfo] Allow function-local statics and types to be scoped within a lexical block

This is almost a reincarnation of https://reviews.llvm.org/D15977 originally
implemented by Amjad Aboud. It was discussed on llvm-dev [0], committed
with its backend counterpart [1], but finally reverted [2].

This patch makes clang to emit debug info for function-local static variables,
records (classes, structs and unions) and typdefs correctly scoped if
those function-local entites defined within a lexical (bracketed) block.

Before this patch, clang emits all those entities directly scoped in
DISubprogram no matter where they were really defined, causing
debug info loss (reported several times in [3], [4], [5]).

[0] https://lists.llvm.org/pipermail/llvm-dev/2015-November/092551.html
[1] https://reviews.llvm.org/rG30e7a8f694a19553f64b3a3a5de81ce317b9ec2f
[2] https://reviews.llvm.org/rGdc4531e552af6c880a69d226d3666756198fbdc8
[3] https://bugs.llvm.org/show_bug.cgi?id=19238
[4] https://bugs.llvm.org/show_bug.cgi?id=23164
[5] https://bugs.llvm.org/show_bug.cgi?id=44695

Reviewed By: dblaikie

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




More information about the All-commits mailing list