[LLVMdev] Extracting an AST to Graphviz using Clang

Carlos Andrade carlosviansi at gmail.com
Sat Jun 9 13:10:01 PDT 2012


Hi Alex,

Would you recommend any specific link in respect on how to compile in debug
mode? I downloaded the Mac OS version on the website so I did not compile
anything. I am sort of a rookie on bash but I should be able to figure my
way around this.

Also, is there any particular reason why this functionality is only
available on debug mode?

Thank you so much for the fast reply, was driving me nuts!

Best,

Carlos Andrade
http://carlosandrade.co



2012/6/9 Alex Rønne Petersen <xtzgzorex at gmail.com>

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


More information about the llvm-dev mailing list