From da90fd75241d5b149fd307e3eeae84f7317d9d9b Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Wed, 15 Nov 2023 09:36:47 +0000 Subject: 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. """ --- llvm/lib/IR/DIBuilder.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/IR/DIBuilder.cpp') diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index 1ce8c17..58a7e07 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -405,12 +405,11 @@ DIDerivedType * DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, DIType *Ty, DINode::DIFlags Flags, llvm::Constant *Val, - uint32_t AlignInBits) { + unsigned Tag, uint32_t AlignInBits) { Flags |= DINode::FlagStaticMember; - return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File, - LineNumber, getNonCompileUnitScope(Scope), Ty, 0, - AlignInBits, 0, std::nullopt, Flags, - getConstantOrNull(Val)); + return DIDerivedType::get(VMContext, Tag, Name, File, LineNumber, + getNonCompileUnitScope(Scope), Ty, 0, AlignInBits, + 0, std::nullopt, Flags, getConstantOrNull(Val)); } DIDerivedType * -- cgit v1.1