kastiglione added a comment.

> 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 speak think they're speaking the same language even though we 
know they're each actually speaking a different but somewhat 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.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127605

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to