[dwarf] Emit a DIGlobalVariable for constant strings.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 16 May 2022 23:03:47 +0000 (16:03 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 16 May 2022 23:52:16 +0000 (16:52 -0700)
commit4680982b36a84770a1600fc438be8ec090671724
tree73b29c4770923ed67f8d27a9b26901b995ae0e57
parent4c5b187f2c065648799e109a6754917e642dc659
[dwarf] Emit a DIGlobalVariable for constant strings.

An upcoming patch will extend llvm-symbolizer to provide the source line
information for global variables. The goal is to move AddressSanitizer
off of internal debug info for symbolization onto the DWARF standard
(and doing a clean-up in the process). Currently, ASan reports the line
information for constant strings if a memory safety bug happens around
them. We want to keep this behaviour, so we need to emit debuginfo for
these variables as well.

Reviewed By: dblaikie, rnk, aprantl

Differential Revision: https://reviews.llvm.org/D123534
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/debug-info-variables.c [new file with mode: 0644]
clang/test/VFS/external-names.c
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/test/Assembler/invalid-diglobalvariable-missing-name.ll [deleted file]
llvm/test/DebugInfo/COFF/global-no-strings.ll [new file with mode: 0644]