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

Konstantin Tokarev annulen at yandex.ru
Mon Nov 19 05:07:21 PST 2012

19.11.2012, 17:01, "Roman Divacky" <rdivacky at freebsd.org>:
> On Mon, Nov 19, 2012 at 02:13:01PM +0200, Dmitri Gribenko wrote:
>>  On Mon, Nov 19, 2012 at 1:53 PM, Roman Divacky <rdivacky at freebsd.org> wrote:
>>>  Ok, I made it emit an error like this:
>>>  witten ~/llvm$ ./Release+Asserts/bin/clang -cc1 -analyze -analyzer-checker=alpha.cplusplus.VirtualCall -analyzer-store region tools/clang/test/Analysis/virtualcall.cpp
>>>  error: action RunAnalysis not compiled in
>>>  This happens to uncover a small bug though. We are emitting diagnostics in
>>>  ExecuteCompilerInvocation.cpp which then gets warn about with -verify:
>>>  witten ~/llvm$ ./Release+Asserts/bin/clang -cc1 -fsyntax-only -load /tmp/bah -plugin foobar -verify ~/hello.c
>>>  error: 'error' diagnostics seen but not expected:
>>>    (frontend): unable to load plugin '/tmp/bah': '/tmp/bah: cannot open shared object file: No such file or directory'
>>>  but thats a separate issue, just fwiw :)
>>>  With the patch like that (#ifndef + emitting diagnostic), is it ok?
>>  Much better now!
>>  How will you pass this #define to the source file?  A special
>>  ./configure argument or just CXXFLAGS?  And what about the change to
>>  exclude unneeded directories from compiling/linking?  And, of course,
>>  will you be able to run regression tests with such a compiler?  (How
>>  to exclude tests for functionality that was not built?)
> As I said, I intend this to be used in FreeBSD buildsystem, I dont plan
> to use it with configure/cmake at all. Thus I dont have any opinion
> on that.
> I dont know how to exclude such tests nor how to even detect it was not
> compiled in. I just see value in having clang-lite for FreeBSD.
> Thats why I asked on cfe-dev@ :) Is there a value in making this
> ./configure option which doesnt compile/link StaticAnalyzer/ARCMT etc. ?

I'd appreciated such option(s), if it was possible to keep StaticAnalyzer and Rewriter
and remove everything else from your list.


More information about the cfe-dev mailing list