https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/70639
>From 81bd54091451eb2021007bc10b8a7c6965178800 Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Fri, 27 Oct 2023 16:19:47 +0100
Subject: [PATCH 1/8] [clang][DebugInfo] Emit global variable definitions for
dwblaikie wrote:
> 2) always put DW_AT_const_value in DW_TAG_member.
My understanding is that this is not possible. Dependent initializer
expressions can't be evaluated in all cases - we're only allowed to evaluate
them in the places the language allows us to, otherwise we might produce the
Michael137 wrote:
> > That's true, if defined in a header, we'll emit a DW_TAG_variable for the
> > constant in each compile unit the header is included in. GCC does do the
> > right thing and only emit the definition DIE in a single CU. We should
> > probably do the same. Though not sure at
https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/70639
>From 18db082fc5008283f77cc98d9c733a47c63b7096 Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Fri, 27 Oct 2023 16:19:47 +0100
Subject: [PATCH 1/8] [clang][DebugInfo] Emit global variable definitions for
Michael137 wrote:
Hmmm it seems like for `constexpr static` data members we don't get a symbol in
the MachO the same way we do for out-of-line `const static`s that have a
location:
```
struct Foo {
static const int val1;
static constexpr int val2 = 5;
Michael137 wrote:
> The DWARFASTParserClang.cpp will try to create the class from the DWARF for
> the class definition. You will need to find the DW_TAG_variable when we are
> creating the static field if there is no DW_AT_const_value in the
> DW_TAG_member. But we also need to support the
clayborg wrote:
> > > Few minor issues, but looks good to me. (you metnioned somewhere an lldb
> > > issue I think with this patch when the value is removed from the static
> > > member declaration inside the class? If that's a problem - probably hold
> > > off on committing this until lldb's
https://github.com/dwblaikie approved this pull request.
Few minor issues, but looks good to me.
(you metnioned somewhere an lldb issue I think with this patch when the value
is removed from the static member declaration inside the class? If that's a
problem - probably hold off on committing
@@ -0,0 +1,87 @@
+// RUN: %clangxx -target arm64-apple-macosx11.0.0 -g %s -emit-llvm -S -o - |
FileCheck --check-prefixes=CHECK %s
+
+enum class Enum : int {
+ VAL = -1
+};
+
+struct Empty {};
+
+constexpr auto func() { return 25; }
+
+struct Foo {
+static constexpr int
https://github.com/clayborg commented:
One question I have here: where will the DW_TAG_variable get emitted for these
`constexpr`? For actual static member variables we emit a single
DW_TAG_variable in the file that declares the global variable, but for
`constexpr` we won't be able to do this
@@ -5883,6 +5907,18 @@ void CGDebugInfo::finalize() {
DBuilder.replaceTemporary(std::move(FwdDecl), cast(Repl));
}
+ for (auto const *VD : StaticDataMemberDefinitionsToEmit) {
+assert(VD->isStaticDataMember());
+
+if (auto It = DeclCache.find(VD); It !=
@@ -67,15 +67,15 @@ int C::a = 4;
// CHECK-NOT:size:
// CHECK-NOT:align:
// CHECK-NOT:offset:
-// CHECK-SAME: flags: DIFlagStaticMember,
-// CHECK-SAME: extraData: i1 true)
+// CHECK-SAME: flags:
https://github.com/Michael137 updated
https://github.com/llvm/llvm-project/pull/70639
>From 18db082fc5008283f77cc98d9c733a47c63b7096 Mon Sep 17 00:00:00 2001
From: Michael Buch
Date: Fri, 27 Oct 2023 16:19:47 +0100
Subject: [PATCH 1/4] [clang][DebugInfo] Emit global variable definitions for
13 matches
Mail list logo