[cfe-dev] Passing Arguments to Checker

Tarun Sethi tarunsethi01 at gmail.com
Mon Aug 8 18:17:52 PDT 2011


Thanks Jordy for the prompt response.

I am facing another problem. My checker makes function calls into some
utility C++ code (which is independent of clang). I want the utility code to
be compiled as a separate library (say abc.a) and abc.a could be linked to
the clangStaticAnalyzerCheckers.a (the checkers library).

I have been able to build the utility C++ code into a library (abc.a)
through the
clang Make system by following the structure of clang Makefiles. I placed
the utility code at the clang/lib/StaticAnalyzer directory (along with
Checkers dir) for that.

I used the USEDLIBS option in the StaticAnalyzer/Checkers/Makefile i.e.
USELIBS:=abc.a

But, I get linker error when I refer something in the utility code from the
checker, because clangStaticAnalyzerCheckers.a is not linked to my abc.a

Thanks again!


Tarun




On Mon, Aug 8, 2011 at 8:40 PM, Jordy Rose <jediknil at belkadan.com> wrote:

> As of yet, no. We've talked about it some (most recently off-list) and
> agreed that it's probably useful, but there's no facility for it yet. Of
> course, suggestions on how this should work are always welcome; patches are
> even better.
>
> Meanwhile, if you're looking for a boolean toggle or a choice between a
> small set of values, you can fake it by having several registration
> functions that actually register the same checker. See NSErrorChecker for an
> example of this.
>
> There should probably be a report about this on Bugzilla...
>
> Jordy
>
>
> On Aug 8, 2011, at 17:22, Tarun Sethi wrote:
>
> > Hello,
> >
> > I have written a checker and I am wondering if there is anyway to pass an
> argument to the checker (constructor of my checker class), the scan-build
> command line being the source of the argument ?
> >
> > Thanks in advance,
> >
> > Tarun
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110808/92f16a8c/attachment.html>


More information about the cfe-dev mailing list