[LLVMdev] Instrumenting C/C++ programs

Chandler Carruth chandlerc at google.com
Thu Nov 17 08:52:23 PST 2011


On Wed, Nov 16, 2011 at 9:09 PM, eyasu getahun <eya.get at gmail.com> wrote:

> Hello guys,
>
> I am trying to know how clang generates AST from source code. But it is
> not clear for me how clang generates it. Can you tell me which class or
> function of clang is building/generating AST? I want to see the specific
> function or algorithm of clang which generates AST. Thanks in advance for
> your idea.
>

As Jim already indicated, the LLVM development list is the wrong forum for
Clang questions. You want the Clang development list. I have added that
mailing list, and am BCC-ing the LLVM ones so we don't bother them further.

To answer your question, the root function behind parsing an AST is here:
http://clang.llvm.org/doxygen/namespaceclang.html#af5bbdd5c2bf254fc38f96c5dc24dba81

Understand that "parsing an AST" is a huge part of what Clang does. Most of
the code in Clang is devoted to this task. Reading a single function won't
tell you how it works, you'll need to dig into the code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111117/f1f0152e/attachment.html>


More information about the llvm-dev mailing list