[cfe-dev] codechecker into clang/LLVM?

Dániel Krupp via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 16 04:55:08 PST 2015


Hi Devin,

If I understand you correctly, you mean that in certain cases the build cannot be “replayed”
if some source files are deleted during the build.

I can think of the following possible solutions:

a)      Even with the LD_PRELOAD technique we could solve the interposition by executing the clang analyzer command (instead of logging) before calling the real compiler (gcc).  This might not work on windows.

b)      Another possibility is that - similarly to scan-build- overriding the CC and CXX env variables to point to an “interposition” script which calls clang analyzer and then the original compiler. The drawback of this solution is that not all build system uses these env variables.

c)       What we also tried earlier is to add the interposition script on names gcc and g++ to the beginning of the PATH, so the build system finds those instead of the real compilers. This relies on gcc to be called by the build system from the PATH.

Since  build systems are so much different all three options could be useful in certain situations.

I created a “paste” thread for this in phabricator to continue this discussion in a more structured way.
http://reviews.llvm.org/P367


Regards,
Daniel




From: dcoughlin at apple.com [mailto:dcoughlin at apple.com]
Sent: 2015. november 11. 22:58
To: Dániel Krupp
Cc: ganna at apple.com; cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] codechecker into clang/LLVM?


On Nov 11, 2015, at 9:07 AM, Dániel Krupp via cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>> wrote:

Hi Anna,

First, thanks for looking into this.
We are open to any suggestions that you feel necessary to get this accepted to LLVM/Clang as a bug-tracking solution…

>- What would it take for this to replace scan-build?...
We’ve been mainly targeting (I mean test it on ) Linux, but Mac and Windows support can be easily added too.
Since the whole thing is in python, the only  issue here could be the “build interposition”, as you pointed out. Other than that, it’s pretty much platform independent.

One important use case that scan-build/ccc-analyzer supports but that the LD_PRELOAD + compilation database approach doesn’t is running the analyzer as the code is being built rather than replaying the build commands later. This is important build systems that move or modify build system intermediates. I think it would be good to continue to have a way to support such projects.

Devin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151116/733ff3cd/attachment.html>


More information about the cfe-dev mailing list