[cfe-dev] Clang as a compiler-only tool
rdivacky at freebsd.org
Mon Nov 19 04:42:02 PST 2012
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
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. ?
More information about the cfe-dev