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

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 14:12:35 PDT 2023


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 fixed so this doesn't regress things? And document the dependence clearly in the commit message)
> 
> I saw the patch to lldb to test that we can find global variables that are `constexpr`. In upstream, we can't use find global variables, but the expression parser does work for these. We should make sure that both `FindGlobalVariables(...)` and expression parsing work for all `constexpr` globals.

Yup, the expression evaluator finds them by looking at the `DW_AT_const_value` on the declaration. But since we're moving that constant onto the definition with this patch, that will break that codepath.

Looking into how best to address that now

https://github.com/llvm/llvm-project/pull/70639


More information about the cfe-commits mailing list