[LLVMdev] Extracting an AST to Graphviz using Clang

Carlos Andrade carlosviansi at gmail.com
Sat Jun 9 11:54:02 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120609/42f1099b/attachment.html>


More information about the llvm-dev mailing list