[cfe-dev] Address taken variables and assignment counts

George Burgess IV via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 1 00:53:00 PST 2016


Hello!

I don't believe clang has machinery you can just query to retrieve this
sort of information, but clang is big, so I could be wrong. :)

That said, the uninitialized values checker needs to determine if a local
variable has been assigned 0 times (and hasn't had its address taken in a
non-const context). So, that may be a good starting point for you.

George

On Fri, Jan 29, 2016 at 11:15 AM, Meador Inge via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi All,
>
> I am working with some code that involves walking the Clang AST
> and have some questions.  For a particular variable, say 'x', is there
> a straight forward (in the sense that there is already code somewhere
> in Clang to do it) way to determine:
>
>   1. If 'x' is address taken.
>
>   2. If 'x' has been assigned multiple times.
>
> ?
>
> Or do I have to figure those things out in the AST walking code that
> I am writing?
>
> --
> # Meador
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160201/59519825/attachment.html>


More information about the cfe-dev mailing list