This won't be complete, since we also get collisions between local variables 
and namespaces, and that wouldn't be detected by your heuristic.

I think the trick that Fred used in https://reviews.llvm.org/D46551 is actually 
pretty complete.  An expression is never going to need to look up a variable if 

strstr(expressionText, varname) == NULL

And OTOH if this is not NULL, there's a very good chance we will need to look 
it up.  So this is a pretty optimal filter.  We should clean this up (I think 
it caused some test failures with the new variable completion in expr, IIRC).  
If we need to do more after that is in place we can, but I bet this will end up 
with us for the most part only injecting local variables where they are needed.

Jim


> On Apr 12, 2019, at 7:21 AM, Greg Clayton via Phabricator 
> <revi...@reviews.llvm.org> wrote:
> 
> clayborg added a comment.
> 
> Just thought of 1 additional way to allow us to pull in fewer var 
> declarations: get a list of all of the member variable names in the current 
> class when stopped in a class method and only add ones that match local 
> variables. If we are in a static member variable then skip of course. 
> Comments? Thoughts?
> 
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D59960/new/
> 
> https://reviews.llvm.org/D59960
> 
> 
> 

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

Reply via email to