[Lldb-commits] [PATCH] D127605: [lldb] Support non-pointer implicit this/self in GetValueForVariableExpressionPath

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 16 07:35:11 PDT 2022


jingham added a comment.

In D127605#3580123 <https://reviews.llvm.org/D127605#3580123>, @kastiglione wrote:

>> This is good, but it also illustrates how the strings "->" and ".'" should actually come from the typesystem and not be hardcoded. We're just lucky that all languages have a "." operator.
>>
>> More elegant would be to just add an API to TypeSystem to get the operator to access ivars.
>
> Initially I was thinking along these lines. But I became less sure. The "variable expression path" syntax is C-like but independent of the source language. For example, in Swift, there is no `->`. So my rhetorical question is, should the `Language` or `TypeSystem`, etc, know about "variable expression path" syntax, as you suggest? Or should we rely on there being a shared subset between source language and variable expression path syntax, and allow the two subsystems to think they're speaking the same language even though we know they're each actually speaking a different but partially compatible language (source vs variable expression path).
>
> I decided to keep the `->`/`.` choice inside `GetValueForVariableExpressionPath` because I feel that kind of logic belongs closer to other variable expression path code.

The original intention of the variable expression paths was that they were really about navigating the ValueObject hierarchy, and the syntax we use should be governed by how to do that most conveniently, without being bound by the variety of languages that might underly that ValueObject hierarchy.  That's particularly convenient when you get to synthetic children, which aren't necessarily bound to the language in which the types are expressed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127605



More information about the lldb-commits mailing list