[PATCH] D99900: [llvm] [testsuite] Fix invalid DW_AT_location DWARF expression in unattached-global.ll

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 8 14:21:48 PDT 2021


dblaikie added a comment.

In D99900#2677901 <https://reviews.llvm.org/D99900#2677901>, @aprantl wrote:

> Yeah, my understanding is that all global variables start out as both !dbg attachements on LLVM globals *and* in the list of globals in the DICompileUnit. This way we don't loose track of them when the LLVM global symbol gets deleted by an optimization.

yeah - seems important that the variable is reachable through both paths, but seems wrong to me that the DIExpression that only makes sense in the context of the dbg attachment is reachable from anywhere else (so I'd expect maybe two DIGlobalVariableExpressions - one with the empty DIExpression, kept in the CU's globals list, and one from the intrinsic, mutated by optimizations and dropped if something is optimized out. But that's not how it is today, so we do need to tolerate these weird/meaningless/defunct location expressions in the CU's globals list for now at least.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99900/new/

https://reviews.llvm.org/D99900



More information about the llvm-commits mailing list