[PATCH] D144008: [DebugMetadata][DwarfDebug] Support function-local static variables in lexical block scopes (7/7)

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 06:36:41 PST 2023


krisb created this revision.
Herald added subscribers: Enna1, pengfei, hiraditya, nemanjai.
Herald added a reviewer: sscalpone.
Herald added a project: All.
krisb edited the summary of this revision.
krisb added reviewers: dblaikie, jmmartinez.
krisb added projects: LLVM, debug-info.
krisb published this revision for review.
Herald added a subscriber: llvm-commits.

RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544

Similar to imported declarations and types, the patch tracks function-local
static variables (globals in terms of LLVM IR) in DISubprogram's 'retainedNodes'.
DwarfDebug is adjusted in accordance with the aforementioned metadata change and
provided a support of static locals scoped by a lexical block.

The patch assumes that DICompileUnit's 'globals' no longer tracks static locals
and DwarfDebug would assert if any locally-scoped variables get placed there.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144008

Files:
  llvm/include/llvm/IR/DIBuilder.h
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/IR/DIBuilder.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
  llvm/lib/Target/BPF/BTFDebug.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/lib/Transforms/Utils/Debugify.cpp
  llvm/test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll
  llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll
  llvm/test/CodeGen/BPF/BTF/static-var-inited.ll
  llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll
  llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll
  llvm/test/CodeGen/BPF/BTF/static-var-sec.ll
  llvm/test/CodeGen/BPF/BTF/static-var.ll
  llvm/test/CodeGen/BPF/dwarfdump.ll
  llvm/test/CodeGen/PowerPC/pr24546.ll
  llvm/test/CodeGen/X86/dbg-distringtype-uint.ll
  llvm/test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll
  llvm/test/DebugInfo/Generic/inlined-static-var.ll
  llvm/test/DebugInfo/Generic/lexical-block-static-var.ll
  llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll
  llvm/test/DebugInfo/X86/DW_AT_specification.ll
  llvm/test/DebugInfo/X86/dimodule-external-fortran.ll
  llvm/test/DebugInfo/X86/distringtype.ll
  llvm/test/DebugInfo/X86/gnu-public-names.ll
  llvm/test/DebugInfo/X86/namelist1.ll
  llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
  llvm/unittests/Transforms/Utils/CloningTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144008.497305.patch
Type: text/x-patch
Size: 51084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230217/a18ee928/attachment.bin>


More information about the llvm-commits mailing list