[cfe-dev] Clang as a compiler-only tool

Jordan Rose jordan_rose at apple.com
Wed Dec 12 09:25:49 PST 2012


Serialization isn't about rewriting; it's for PCH (and modules). So it can be taken out of the comment in the Makefile.

It's weird how many disparate things depend on libRewrite, but I guess it makes sense.

If you want to be even more aggressive, you can condition the parsing of analyzer and migrator arguments. That means they'll come up as unclaimed arguments if you try to use them, but I think that's fine.

I don't speak autoconf well enough to check that part of the patch, but it's looking good now. Wish we could conditionally disable the ARCMigrate and Rewrite pieces of libclang as well, but I think it's okay not to have that when this first goes into trunk.

Jordan


On Dec 12, 2012, at 6:51 , Roman Divacky <rdivacky at freebsd.org> wrote:

> The last iteration of the patch. I hope I addressed all the concerns.
> 
> Here are some numbers:
> 
> llvm/clang r169861
> 
> ./configure --enable-optimized
> 
> clang size = 38268039
> 
> ./configure --enable-optimized --enable-clang-arcmt=no
> 
> clang size = 36951527
> 
> ./configure --enable-optimized --enable-clang-static-analyzer=no
> 
> clang size = 35998310
> 
> ./configure --enable-optimized --enable-clang-arcmt=no --enable-clang-rewriter=no --enable-clang-static-analyzer=no
> 
> clang size = 34175606
> 
> 
> So without all that we cut off ~4MB of ~36MB binary. Not bad.
> 
> Please review. Roman
> 
> 
> On Tue, Dec 04, 2012 at 01:49:21PM -0500, Rafael Esp??ndola wrote:
>>> Two patches attaches - one for clang that splits CLANG_IS_COMPILER_ONLY to
>>> CLANG_DISABLE_REWRITER, CLANG_DISABLE_ARCMT and CLANG_DISABLE_STATIC_ANALYZER.
>>> 
>>> And one for llvm that attempts to introduce --disable-clang-arcmt,
>>> --disable-clang-rewriter and --disable-clang-static-analyzer to llvm
>>> configure.
>>> 
>>> I only need the clang part to be committed but I tried to provide
>>> autoconf part too.
>> 
>> I think I agree with Douglas that positive flags would be better than
>> negative ones. Can you change the patch to have, for example, a
>> --enable-clang-rewriter that defaults to true? The way that
>> AC_ARG_ENABLE works you should write just
>> 
>> AC_ARG_ENABLE(clang-rewriter, ...)
>> 
>> Remember to regenerate configure :-)
>> 
>> LGTM with those changes.
>> 
>>> Is it ok like this? Roman
>> 
>> Cheers,
>> Rafael
> <clang-diet.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list