[cfe-dev] [isl-dev] Running Clang Static Analyzer Checker on ISL Codebase

Malhar Thakkar via cfe-dev cfe-dev at lists.llvm.org
Fri May 19 04:05:12 PDT 2017


Thank you so much, Dr. Sven.
Your answer is exactly what I was looking for.

Regards,
Malhar

On May 19, 2017 15:55, "Sven Verdoolaege" <skimo-cfe at kotnet.org> wrote:

> On Fri, May 19, 2017 at 11:37:57AM +0530, 'Malhar Thakkar' via isl
> Development wrote:
> > Hello all,
> >
> > I wish to run Clang Static Analyzer's RetainCountChecker.cpp on the ISL
> > codebase. While trying to test it on a single ISL file (isl_band.c), it
> > asks me to use quotes instead of angular brackets for various header
> files
> > which are in the ISL source directory.
> >
> > In the $LLVM_BUILD/bin directory, I am running the following command
> > *./clang -cc1 -analyze -analyzer-checker=osx.cocoa.RetainCount
> > ../../../isl-0.18/isl_band.c*
> >
> > Also, to run this checker, I have added the following macros to
> *isl_band.c*
> > *#define __isl_take __attribute__((cf_consumed))*
> > *#define __isl_give __attribute__((cf_returns_retained))*
> > *#define __isl_keep*
> >
> > Replacing angular brackets with quotes on the entire codebase will be a
> > tedious task.
> >
> > Could anyone please suggest me an easier way to run
> RetainCountChecker.cpp
> > on the entire ISL codebase?
>
> You are not going to find many experts on the Clang Static Analyzer here.
> AFAIU, you are not supposed to run the analyzer directly
> (unless you know how to set up the right compiler flags).
> According to a message of mine on 6 Jan 2017, this might work:
>
> scan-build -enable-checker osx.cocoa.RetainCount make CC="gcc"
> CFLAGS='-D__isl_give="__attribute__((cf_returns_retained))"
> -D__isl_take="__attribute__((cf_consumed))"'
>
> skimo
>
ᐧ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170519/d6336f22/attachment.html>


More information about the cfe-dev mailing list