[LLVMdev] Extracting an AST to Graphviz using Clang

Alex Rønne Petersen xtzgzorex at gmail.com
Sat Jun 9 12:17:10 PDT 2012


Hi Carlos,

> I am new to this list, and hope this question is pertinent to this mailing
> list.

Welcome!

> Stmt::viewAST is only available in debug builds on systems with Graphviz or
> gv!

You need to actually build Clang in debug mode for this particular
method to be available, which is very likely why you're seeing this
error. I don't think that Clang builds shipped with Xcode (for
example) are built in debug mode.

Regards,
Alex

On Sat, Jun 9, 2012 at 8:54 PM, Carlos Andrade <carlosviansi at gmail.com> wrote:
> Dears,
>
> I am new to this list, and hope this question is pertinent to this mailing
> list.
>
> I have been trying to use Clang to extract an AST from my source code, but
> without success when attempting to do so with Graphviz.
>
> I created a thread on Stackoverflow recently in hope any could help me [1],
> but the question is actually pretty simple. I keep getting
>
>
> Stmt::viewAST is only available in debug builds on systems with Graphviz or
> gv!
>
> alongside the code that is output despite having graphviz added to the path
> and having it installed on my machine. dot works fine from my console, but I
> have no 'gv' like it is suggested on the documentation (you can find how I
> attempted that and the versions on the stack link better formatted than on
> this email).
>
> The command I am running on my console is:
>
> ./clang -cc1 -ast-view smd.c
>
> My graphviz version is 2.28 and my clang version is 2.9 (for a couple of
> reasons I need to make it work for this version).
>
> http://stackoverflow.com/questions/10962845/stmtviewast-is-only-available-in-debug-builds-on-systems-with-graphviz-or-gv
>
> I also heard xml output was discontinued, but I still see the option from
> cc1 to output in such format without any warning message on 2.9 (although no
> apparent output is given in that case), why is that?
>
> Thank you,
>
> Carlos Andrade
> http://carlosandrade.co
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list