aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2023-11-15 09:36:47 +0000
committerMichael Buch <michaelbuch12@gmail.com>2023-11-15 10:26:35 +0000
commitda90fd75241d5b149fd307e3eeae84f7317d9d9b (patch)
tree43ccb676f24659ac014887478c7bdfbcac356a4c /clang/lib/CodeGen/CGDebugInfo.cpp
parent808caa9d4608b4383743043f6dbdab6faf608bcc (diff)
downloadllvm-da90fd75241d5b149fd307e3eeae84f7317d9d9b.zip
llvm-da90fd75241d5b149fd307e3eeae84f7317d9d9b.tar.gz
llvm-da90fd75241d5b149fd307e3eeae84f7317d9d9b.tar.bz2
Reland "[llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (#72234)"
This was reverted because it broke the OCaml LLVM bindings. Relanding the original patch but without changing the C-API. They'll continue to work just fine as they do today. If in the future there is a need to pass a new tag to the C-API for creating static members, then we'll make the change to the OCaml bindings at that time. Original commit message: """ This patch adds the LLVM-side infrastructure to implement DWARFv5 issue 161118.1: "DW_TAG for C++ static data members". The clang-side of this patch will simply construct the DIDerivedType with a different DW_TAG. """
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 04ca02cfe..a201cf0 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1681,7 +1681,8 @@ CGDebugInfo::CreateRecordStaticField(const VarDecl *Var, llvm::DIType *RecordTy,
llvm::DINode::DIFlags Flags = getAccessFlag(Var->getAccess(), RD);
auto Align = getDeclAlignIfRequired(Var, CGM.getContext());
llvm::DIDerivedType *GV = DBuilder.createStaticMemberType(
- RecordTy, VName, VUnit, LineNumber, VTy, Flags, /* Val */ nullptr, Align);
+ RecordTy, VName, VUnit, LineNumber, VTy, Flags, /* Val */ nullptr,
+ llvm::dwarf::DW_TAG_member, Align);
StaticDataMemberCache[Var->getCanonicalDecl()].reset(GV);
StaticDataMemberDefinitionsToEmit.push_back(Var->getCanonicalDecl());
return GV;