[cfe-dev] Classify variables of a loop/compound statement/etc.

Alberto Barbaro barbaro.alberto at gmail.com
Wed Jan 14 09:42:27 PST 2015


Luis,
My 2 cents. Maybe you can create a recursive visitor and use the VisitStmt
method. Using a cast you can understand if it is an if statement and if yes
you could call, for example,getThen() method or something similar.

What you mean with read/write variables?

I think you can understand if it is global or not taking the declaration
point using something like getDecl() on the DeclRefExpr.

I'm sure that I said something wrong. Any better idea?

Thanks,
Alberto
On 14 Jan 2015 15:44, "Luis Miguel Sanchez Garcia" <
luismiguel.sanchez at uc3m.es> wrote:

> Hi all,
>
> I would like to develop a tool that prints the variables of a concrete
> loop/compount statement/etc. The information that I need to print for each
> variable is:
> - read variables, write variables and rw variables
> - And if it is local or global variable.
>
> Any help to start?
>
> Regards,
> Luis.
> --
> --
> --------------------------------------------------
> Luis Miguel Sánchez García
> Computer Architecture and Technology Area.
> Office 2.2.B08
> Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID
> Universidad Carlos III de Madrid
> Avda. de la Universidad, 30
> 28911 Leganés - Madrid - Spain
> e-mail: lmsan at arcos.inf.uc3m.es
>         luismiguel.sanchez at uc3m.es
>
> Phone: (+34) 91 624 5951
>
> Linked-In: http://es.linkedin.com/in/lmsan
> Twitter: http://twitter.com/lmsanchezgarcia
> --------------------------------------------------
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150114/4ac6624d/attachment.html>


More information about the cfe-dev mailing list