Thanks a lot. <br><br>Munawar<br><br><div class="gmail_quote">On Tue, Dec 21, 2010 at 12:01 AM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im"><br>
On Dec 18, 2010, at 10:21 PM, Munawar Hafiz wrote:<br>
<br>
> Hi,<br>
> 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.<br>


><br>
> a) Given two variables, ask analysis engine if they are aliases or not.<br>
> b) Given a variable, find about its points-to-set.<br>
<br>
</div>If you want pointer analysis, you'll probably need LLVM's analysis. Mapping that information back to Clang's ASTs will be nontrivial, though.<br>
<div class="im"><br>
> c) Given a variable, follow its def-use chain.<br>
> d) Given a function, follow its call graph.<br>
<br>
</div>These could be constructed on top of Clang, although def-use information would be limited to the simple cases.<br>
<div class="im"><br>
> e) Given a cursor, browse the AST. The AST may involve multiple files.<br>
<br>
</div>This can be done with Clang (or even libclang, the C interface). It's by far the easiest, Clang-only thing to do.<br>
<br>
        - Doug</blockquote></div><br>