[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-08 Thread Michael Buch via cfe-commits
Michael137 wrote: > This causes Clang to assert: > > ``` > llvm/lib/IR/Metadata.cpp:689: > void llvm::MDNode::resolve(): Assertion `isUniqued() && "Expected this > to be uniqued"' failed. > ``` > > See https://bugs.chromium.org/p/chromium/issues/detail?id=1500262#c1 for a >

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-07 Thread via cfe-commits
zmodem wrote: This causes Clang to assert: ``` llvm/lib/IR/Metadata.cpp:689: void llvm::MDNode::resolve(): Assertion `isUniqued() && "Expected this to be uniqued"' failed. ``` See https://bugs.chromium.org/p/chromium/issues/detail?id=1500262#c1 for a reproducer. I'll revert to

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-06 Thread Michael Buch via cfe-commits
https://github.com/Michael137 closed https://github.com/llvm/llvm-project/pull/70639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-02 Thread via cfe-commits
avl-llvm 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

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread via cfe-commits
avl-llvm wrote: > > Or maybe we can include the DW_AT_const_value in both places? > > The ask to drop the constant off of the declaration comes from the > DWARFParallelLinker work where it was causing non-deterministic output. But > @dwblaikie @avl-llvm will know more about that I do not

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread Michael Buch via cfe-commits
Michael137 wrote: > The DWARFASTParserClang, with the current state of things, will automatically > add the const value initializer to the clang AST field. See > `DWARFASTParserClang::ParseSingleMember(...)` around the `// Handle static > members` around >

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread Greg Clayton via cfe-commits
clayborg 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

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread David Blaikie via cfe-commits
dwblaikie 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 which

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-11-01 Thread Michael Buch via cfe-commits
Michael137 wrote: > 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 will we?

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread Michael Buch via cfe-commits
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/7] [clang][DebugInfo] Emit global variable definitions for

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread Michael Buch via cfe-commits
Michael137 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 been

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread Greg Clayton via cfe-commits
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 been fixed so

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread Michael Buch via cfe-commits
Michael137 wrote: > size report sounds generally OK - but there's a bunch of what look like > unrelated or strange results in there, perhaps they weren't compared at > exactly the same version? (like why did the apple_names size go down? How did > the .text and .debuG_line size change at all?

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread Michael Buch via cfe-commits
@@ -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:

[lldb] [clang] [clang][DebugInfo] Emit global variable definitions for static data members with constant initializers (PR #70639)

2023-10-31 Thread David Blaikie via cfe-commits
dwblaikie wrote: size report sounds generally OK - but there's a bunch of what look like unrelated or strange results in there, perhaps they weren't compared at exactly the same version? (like why did the apple_names size go down? How did the .text and .debuG_line size change at all? )