status of C++ analyzer support, list of what is still needed?

Hello all,

I realize C++ support isn’t yet complete for the static analyzer, but is there a place where I can go to see the status, and what needs to be finished?

Also, I’m assuming that the C++ functionality is based on “checkers”, is that the case? I ask because I was looking over the notes from the 2012 llvm meeting specifically the talk titled “Building a Checker in 24 hours”. Thanks for any pointers, I’m new to clang but would like to use it to analyze C++ code.

-Tim

Hi,

Since nobody replied yet, perhaps these pages can get you started ?

http://clang-analyzer.llvm.org/checker_dev_manual.html
http://clang-analyzer.llvm.org/potential_checkers.html

Regards,

John Smith.

On Behalf Of Tim Stowell

would like to use it to analyze C++ code.

... aand if you just want to use the current checker on your code, then
this may be the best starting point on obtaining and using the analyzer:

http://clang-analyzer.llvm.org/installation.html

Regards,

John Smith

Hi, Tim. The 3.2 release of LLVM brought a wealth of C++ understanding to the analyzer, so while support is still incomplete, it should now already be a useful tool for C++. It just might not find as much as it could in theory.

I think your idea of a status page is a good one, but I am a bit hesitant about committing to it, mainly because saying the analyzer “supports” something is a bit nebulous. There are many constructs we “support” but do not model very precisely. That said, there are known deficiencies which we have definite plans to improve, the most immediate one being the inlining of constructors and destructors for local variables. We have only so much manpower, though.

I’m glad you saw our talk already. Unfortunately, what we consider “C++ support” is work that happens in the analyzer core, rather than in checkers. Checkers affect how the analyzer processes a statement, but it’s the core that actually determines what statements to process (e.g. inlining, taking branches, etc). As John pointed out, however, there are plenty of C+±related checks that need to be implemented before the analyzer can be considered a first-class C++ analysis tool—we don’t even pair “new” and “delete” right now.

So I’d say use the analyzer we have today, and update every so often to get our latest improvements.

Does that help?
Jordan

Hi, Tim. The 3.2 release of LLVM brought a wealth of C++ understanding to the analyzer,

http://clang-analyzer.llvm.org/dev_cxx.html still says “Support for analyzing C++ and Objective-C++ files is currently extremely limited”. Should that be updated?

Ha. Yes. I should probably take some time today to just comb through all of www/analyzer/. Thanks, Nico.

Thanks all for the responses, and the explanation of the analyzer core vs the checkers. I understand your hesitation for a status page, I’ll keep updating clang as it becomes available. Oh, if I’m able to contribute at some point, is there any way to find out who is working on what checkers? Thanks!

-Tim