[cfe-dev] Read/Write Accesses of global variables in a Function body...

Eli Friedman eli.friedman at gmail.com
Mon Dec 19 13:34:02 PST 2011


On Mon, Dec 19, 2011 at 1:30 PM, Peter <clang_llvm_123-4 at yahoo.de> wrote:
> Thanks Eli, you helped me a lot...!!!
>
> One last question, is there any way to find that a
> a DeclRefExpr only occurred on the left hand site?
>
> I can overwrite 'VisitBinaryOperator' to see if it occurred
> on the left hand site. But how do I know, that it doesn't occur
> on the right hand site?
>
> 'VisitDeclRefExpr' finds any occurrences...and it looks like 'DeclRefExpr'
> doesn't tell
> me on which site is...

How about you just record all the DeclRefExprs you see on the
left-hand side of an assignment, and see if you find any others?

-Eli



More information about the cfe-dev mailing list