[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 5 08:09:23 PDT 2025


jimingham wrote:

I don't remember how that works in swift, but note, there are two separate issues with the C family expression parser.  One was making local declarations override ivar references in name resolution in the context of the expression.  That is why we inject variables into the expression by hand (and is controlled by the target.experimental.inject-local-vars setting).  That's not even necessary, IIRC it's to work around the side effect of the too much optimizing of the DWARF.  But the more important C++ requirement is that we use it to make the expression

local_or_global_variable = 100

work correctly without having to pass variable references into the expression from a separate context as a pointer, which would require that behind the user's back we would be munging this expression to:

*local_or_global_variable_pointer = 100

We wanted to avoid having to do that everywhere, and the solution to that was to use C++ references when a variable was mentioned in an expression.  That's the harder bit you are going to have to solve to get rid of C++ in the basic C-family expression evaluator. 

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


More information about the lldb-commits mailing list