aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2023-11-15 08:16:24 +0000
committerGitHub <noreply@github.com>2023-11-15 08:16:24 +0000
commit9a9933fae23249fbf6cf5b3c090e630f578b7f98 (patch)
tree2e60f0886d0e3884f74c780758b86fc1d8a807bc /llvm/lib/IR/DebugInfoMetadata.cpp
parent5480be13d5bff9df8d306cd948ff975ed577c054 (diff)
downloadllvm-9a9933fae23249fbf6cf5b3c090e630f578b7f98.zip
llvm-9a9933fae23249fbf6cf5b3c090e630f578b7f98.tar.gz
llvm-9a9933fae23249fbf6cf5b3c090e630f578b7f98.tar.bz2
[llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (#72234)
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/DebugInfoMetadata.cpp')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 0e14ec9..943826c 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -711,7 +711,9 @@ Constant *DIDerivedType::getStorageOffsetInBits() const {
}
Constant *DIDerivedType::getConstant() const {
- assert(getTag() == dwarf::DW_TAG_member && isStaticMember());
+ assert((getTag() == dwarf::DW_TAG_member ||
+ getTag() == dwarf::DW_TAG_variable) &&
+ isStaticMember());
if (auto *C = cast_or_null<ConstantAsMetadata>(getExtraData()))
return C->getValue();
return nullptr;