[cfe-dev] Removal of the AST XML printer (r127141)

Anton Lokhmotov Anton.Lokhmotov at arm.com
Thu Mar 10 05:05:01 PST 2011


[Continuing a discussion started in cfe-commits.  Please see below.]

Hi Doug,

We believe that the AST XML printer is very useful even in its current
state, so its removal is not warranted.  Yes, it represents Clang's internal
AST but that's exactly why it is useful: there's simply no other way to dump
Clang's AST in a form that other tools can parse.  For example, we have
developed a number of automatic AST tests based on the XML printer, which,
if the printer is unavailable, we have to throw away (potentially
compromising the quality of our compiler).  It may be argued that potential
future improvements will actually make it less suitable for such uses.

If the problem is that a potential user can be let down by its
incompleteness or instability, I can propose two alternatives.  First,
remove the XML printer from the Clang driver but otherwise leave it in the
library (with a number of caveats).  Second, allow us to come up with a
cut-down version of the XML printer that will only be able, say, to output
info for declarations.  This will be easier to maintain, while not set up
user expectations too high.

Please let me know what you think.

Anton.


> -----Original Message-----
> From: Douglas Gregor [mailto:dgregor at apple.com]
> Sent: 09 March 2011 16:12
> To: Anton Lokhmotov
> Cc: cfe-commits at cs.uiuc.edu
> Subject: Re: [cfe-commits] r127141 - in /cfe/trunk:
> include/clang/Driver/ include/clang/Frontend/ lib/Frontend/
> lib/FrontendTool/ test/Coverage/
> 
> 
> On Mar 9, 2011, at 3:28 AM, Anton Lokhmotov wrote:
> 
> > Hello Douglas,
> >
> > I am taken aback by your decision to remove the AST XML printer.  It
> > definitely works beyond toy examples, as we actually use it in
> > production.
> >
> > I appreciate your points on how the AST printer should be improved.
> > Would it be possible for you to propose a project up for grabs at
> > http://clang.llvm.org/OpenProjects.html, so the AST printer could be
> > improved by volunteers over time rather than completely removed 
> > from the sources?
> 
> We've waited for volunteers to improve the AST XML printer for many,
> many months (first commit of the XML printer: May 21, 2009). It didn't
> work. A few patches trickled in, but this feature remains incomplete,
> undocumented, and poorly tested. It's irresponsible to knowingly
> release a feature in such a state.
> 
> I'll go update OpenProjects.html, and we'll see if we can draw more
> volunteers into working on something that we would be proud to release
> as a feature.
> 
> 	- Doug
> 
> 
> 
> > Regards,
> > Anton.
> >
> >
> >> Date: Mon, 07 Mar 2011 01:03:30 -0000
> >> From: Douglas Gregor <dgregor at apple.com>
> >> Subject: [cfe-commits] r127141 - in /cfe/trunk:
> include/clang/Driver/
> >> 	include/clang/Frontend/ lib/Frontend/ lib/FrontendTool/
> >> test/Coverage/
> >> To: cfe-commits at cs.uiuc.edu
> >> Message-ID: <20110307010330.78FEB2A6C12C at llvm.org>
> >> Content-Type: text/plain; charset="utf-8"
> >>
> >> Author: dgregor
> >> Date: Sun Mar  6 19:03:30 2011
> >> New Revision: 127141
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=127141&view=rev
> >> Log:
> >> Remove the AST printer (-ast-print-xml), which is too incomplete and
> >> too low-level to actually be useful but is just interesting enough
> >> for people to try to use it (which won't actually work beyond toy
> >> examples).
> >>
> >> To bring back the AST printer, it needs to be:
> >>  - Complete, covering all of C/C++/Objective-C
> >>  - Documented, with appropriate Schema against which we can validate
> >>  the output
> >>  - Designed for C/C++/Objective-C, not Clang's specific ASTs
> >>  - Stable across Clang versions
> >>  - Well-tested







More information about the cfe-dev mailing list