efriedma-quic wrote:

> I'm not sure what you mean by "or it finds a pointer that's the base". The 
> MemberExpr the visitor returns doesn't have to be a pointer---e.g. 
> ptr->a.b.c.d returning ptr->a.b, where b isn't a pointer---or do you mean 
> something else?

In an expression which does not contain "->" operators, StructAccessBase should 
return an lvalue: the expression which describes the base of the relevant 
struct.  There might be addressof/dereference/array decay/etc. in the middle, 
but that's the ultimate result.  The "or it finds a pointer" bit isn't relevant 
in this case.

"LHS->member" is equivalent to "(*LHS).member"... and sometimes 
StructAccessBase wants to return "*LHS".  This is where the "or it finds a 
pointer" bit comes in; there is no expression *LHS in the AST, so it returns a 
pointer which needs to be dereferenced to turn it into an lvalue.

https://github.com/llvm/llvm-project/pull/110497
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to