On Wed, Jul 18, 2012 at 12:47 AM, Jean-Daniel Dupas <devli...@shadowlab.org> wrote: > > Le 17 juil. 2012 à 20:08, Manuel Klimek <kli...@google.com> a écrit : > >> On Tue, Jul 17, 2012 at 7:55 PM, Douglas Gregor <dgre...@apple.com> wrote: >>> >>> On Jul 16, 2012, at 11:56 PM, Manuel Klimek <kli...@google.com> wrote: >>> >>>> On Tue, Jul 17, 2012 at 7:22 AM, Douglas Gregor <dgre...@apple.com> wrote: >>>>> >>>>> On Jul 16, 2012, at 5:46 AM, Alexander Kornienko <ale...@google.com> >>>>> wrote: >>>>> >>>>>> Author: alexfh >>>>>> Date: Mon Jul 16 07:46:48 2012 >>>>>> New Revision: 160265 >>>>>> >>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=160265&view=rev >>>>>> Log: >>>>>> The new clang-ast-dump tool for selective AST dumping. Moved common >>>>>> command-line tool stuff to CommandLineClangTool >>>>> >>>>> I don't think this belongs in the Clang repository because: >>>>> >>>>> 1) It's built on a *debugging* option, the XML dumper, which is >>>>> neither actively maintained nor complete enough to build any tool upon >>>>> 2) It provides no value for users of Clang >>>>> 3) It provides very little value for developers of Clang tools, >>>>> since it does little more than clang + grep >>>>> 4) It fails nearly all of the criteria for a Clang extension >>>>> outlined in http://clang.llvm.org/get_involved.html >>>>> >>>>> I'll be happy to hear opinions to the contrary (Manuel?), but barring >>>>> some killer argument for this feature, I'd like it reverted. >>>> >>>> I'll provide an argument for why I think this belongs in clang >>>> mainline, but it's also no sweat to pull it into the (hopefully soon >>>> available) tooling repo. >>> >>> FWIW, I'd argue against putting this into the tooling repo as well, unless >>> someone is actually going to turn the XML dumper into something that's >>> complete enough, well-documented, well-structured, etc. and could actually >>> form the basis of real tools. But it's currently just a small debugging aid. >>> >>>> There are 2 killer features for this vs. clang -ast-dump-xml: >>>> - clang -ast-dump-xml + grep doesn't scale: outputting a whole AST in >>>> text often produces > 20GB of output and takes a long, long time - >>>> grepping just on the node names is really fast >>> >>> Okay, that's fair; but this could trivially be added as a parameter to the >>> existing XML dumper. We don't need a whole separate, single-purpose tool >>> for this. >> >> True. That still leaves the other points. >> >>>> - clang -ast-dump-xml requires the user to first get a correct -cc1 >>>> invocation, which is non-trivial for people who just write tools >>> >>> -fsyntax-only -Xclang -ast-dump-xml >>> >>> should do the trick. >> >> You still need to get the whole command line, don't you? The >> interesting part about a standalone tool is that you are just >> somewhere in the source tree and type: >> $ tool-name some_source.cpp <+ options> >> and get the output you need. Really easy to explore. >> > > FWIW, the same purpose can be achieve with a simple shell alias, or a simple > script. > > alias tool-name "clang -fsyntax-only -Xclang -ast-dump-xml"
You still need the full compile command line or you'll get header-not-found errors. Anyway, we can build that into clang-check and after some discussion on IRC it seems like that's the way we'll try to aim for. That leaves one unresolved point to me, which is documentation, but I think we can handle that in different ways (having a special tool allows for better integration of documentation into the tool in my opinion). Cheers, /Manuel > > -- Jean-Daniel > > > > _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits