[cfe-dev] Cannot run Clang Analyzer

austin seipp as at hacks.yi.org
Tue Jul 5 12:06:02 PDT 2011


> The main reason why I have rebuilt Clang in the first place was because I
> created a new checker and I wanted to test it out on some code that I wrote.
> Is there any way to get scan-build to point to my executable of clang in my
> build directory?

I'd guess that scan-build will use whatever clang executable it finds
first on your PATH. Perhaps just set your PATH to point to your clang
build before any other, and then try?

Note: I can't verify this, it's just reasonable speculation. Ted or
someone would have to chime in to tell you the truth with any
confidence.

> Just for some context, I created the checker.cpp file,
> added it to checker directory and added a new line in checkers.td then
> subsequently built llvm+clang. All and all, my primary goal is to extend
> clang in terms of new checkers and have been trying to get the analysis to
> run with these new checkers. If there is any advice or guidance it would be
> greatly appreciated! Thanks again for taking your time to help!
>

I've written a few checkers in my spare time too and honestly I
normally end up putting them in the 'Core' package (in Checkers.td)
during development so they are always on by default and I can just use
'scan-build,' and move them to other packages (like core.experimental)
later once I'm done. Granted I only wrote tiny ones that I didn't push
upstream (because coincidentally, other people ended up
re-implementing them within the same day or two. :)

--
Regards,
Austin



More information about the cfe-dev mailing list