[cfe-dev] Guidance: clang or llvm

Munawar Hafiz munawar.hafiz at gmail.com
Tue Dec 21 13:24:19 PST 2010


Thanks a lot.

Munawar

On Tue, Dec 21, 2010 at 12:01 AM, Douglas Gregor <dgregor at apple.com> wrote:

>
> On Dec 18, 2010, at 10:21 PM, Munawar Hafiz wrote:
>
> > Hi,
> > I am implementing refactorings in CDT using clang (or llvm?) as the
> analysis engine. I am planning to write these library functions on top of
> clang, and then using native calls to communicate with them. Here are some
> specific things that I want to perform.
> >
> > a) Given two variables, ask analysis engine if they are aliases or not.
> > b) Given a variable, find about its points-to-set.
>
> If you want pointer analysis, you'll probably need LLVM's analysis. Mapping
> that information back to Clang's ASTs will be nontrivial, though.
>
> > c) Given a variable, follow its def-use chain.
> > d) Given a function, follow its call graph.
>
> These could be constructed on top of Clang, although def-use information
> would be limited to the simple cases.
>
> > e) Given a cursor, browse the AST. The AST may involve multiple files.
>
> This can be done with Clang (or even libclang, the C interface). It's by
> far the easiest, Clang-only thing to do.
>
>        - Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101221/63f136c8/attachment.html>


More information about the cfe-dev mailing list