diff options
author | Michael Buch <michaelbuch12@gmail.com> | 2023-11-15 09:36:47 +0000 |
---|---|---|
committer | Michael Buch <michaelbuch12@gmail.com> | 2023-11-15 10:26:35 +0000 |
commit | da90fd75241d5b149fd307e3eeae84f7317d9d9b (patch) | |
tree | 43ccb676f24659ac014887478c7bdfbcac356a4c /llvm/lib/IR/DIBuilder.cpp | |
parent | 808caa9d4608b4383743043f6dbdab6faf608bcc (diff) | |
download | llvm-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 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/DIBuilder.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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 * |