Recommit "[CodeView] Emit static data members as S_CONSTANTs."
authorAmy Huang <akhuang@google.com>
Tue, 27 Oct 2020 18:35:57 +0000 (11:35 -0700)
committerAmy Huang <akhuang@google.com>
Wed, 28 Oct 2020 23:35:59 +0000 (16:35 -0700)
commit7669f3c0f69db78cdd3deef066abc99f60fc580d
tree7b40ca4ffae302cff9524c78b24e7d0c8bda7338
parentde518673436ecea229076827ee1f3131482d8f41
Recommit "[CodeView] Emit static data members as S_CONSTANTs."

We used to only emit static const data members in CodeView as
S_CONSTANTS when they were used; this patch makes it so they are always emitted.

This changes CodeViewDebug.cpp to find the static const members from the
class debug info instead of creating DIGlobalVariables in the IR
whenever a static const data member is used.

Bug: https://bugs.llvm.org/show_bug.cgi?id=47580

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

This reverts commit 504615353f31136dd6bf7a971b6c236fd70582be.
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-static-member.cpp
llvm/include/llvm/CodeGen/DebugHandlerBase.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
llvm/test/DebugInfo/COFF/global-constants.ll
llvm/test/DebugInfo/COFF/types-array-unsized.ll