Chris Lattner wrote:
On May 26, 2009, at 11:43 AM, David Mandelin wrote:
Ted Kremenek wrote:
C++ support in Clang is rapidly progressing,
Cool. Is there a page with notes on the design? I'm curious what approach you are using. Elsa's GLR design seems like a good approach, but it doesn't cover all the latest complicated template features, and the latest problems I saw seemed difficult to solve in that design. (It was long enough ago that I don't remember the exact problem.)
We use a straight-forward recursive descent parser (like GCC and EDG). Is there a specific design point you're interested?
That was the basic question. I've generally suspected that recursive descent is better than a parser generator for real compilers, so now I have yet another point in favor. :-)
but because the Clang static analyzer performs static analysis at the source level simply having C++ parsing support does not imply immediate support in the analyzer. Bringing that feature up will likely require active participation from the open source community.
What about running over a language-independent IR instead? That's the approach we've used in Treehydra and it seems like it would be even better because I think you have much cleaner IRs in LLVM.
There definitely is work on static and dynamic analysis built on llvm (e.g. see http://klee.llvm.org/ ). The major difference between building it on Clang and on LLVM is that Clang gives dramatically more source level information, which makes the user interface possibilities more rich. The advantage of building on LLVM is that an analysis can work on much more than just C, including Fortran, Ada, Pure, and various other languages that target llvm.
I know what you mean about the source loc info. It seems possible to carry through most of the information, although GCC does not, apparently because of desire to save memory and perform early optimizations. Not having implemented a C++ AST->CFG translation myself, I could imagine there are other hard problems too.

Dave

_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis

Reply via email to