[cfe-commits] [PATCH] Initial version of formatting library

Sean Silva silvas at purdue.edu
Wed Nov 14 13:53:58 PST 2012


Manuel, what you're saying makes sense to me. I guess I was
misunderstanding the direction set forth in the design document.
Partially the reason I commented also (the comment was on a particular
part of the source code) which had a big "EXPERIMENTAL" warning, which
made it seem like the author didn't necessarily want it to be in tree.
IMO if it's going to be in tree, then the EXPERIMENTAL should go away.

Also, I think you're totally right Manuel that we need as many eyes on
this as possible. I think that having a tool in tools/ (not
clang-tools-extra) which builds on this library would greatly improve
the reach of people giving it a shot. Even if it doesn't do a
fantastic job (or any real job) at first, at least something that we
can throw random bits of code at and see them get transformed would be
nice. For example, I can easily see myself throwing my "~/test.cc"
little throwaway test file at it every once in a while when I'm
feeling bored or after/during a rebuild of the world ("oh hey, it
actually formatted that declaration this time, neat"); that would give
it a fair amount of extra exposure I think.

-- Sean Silva



On Wed, Nov 14, 2012 at 4:03 PM, Manuel Klimek <klimek at google.com> wrote:
>
>   Sean, this has been discussed multiple times now and there was general agreement that formatting will be needed by many tools (basically every time you refactor something, you'll need to fix up your formatting), and thus that it'd make sense to have it as a library.
>
>   The second thing is that we would really appreciate some eyes on the basic assumptions we make to make sure we learn of possible problems down the path early on. I expect this to be a much higher probability if we develop it in clang directly.
>
>   Lastly, if we agree that we'll want it to be in a library anyway, it seems to be a waste of effort to move stuff around later if there's not a strong argument for not having it in the main repo right away.
>
>   I'm also not sure where you see the main-in-a-library pattern. Having a SourceManager with sources that you'll want to re-indent is exactly the state you're in after using the refactoring library to change your code.
>
> http://llvm-reviews.chandlerc.com/D80




More information about the cfe-commits mailing list