[cfe-commits] [PATCH] CFGElement print

Ted Kremenek kremenek at apple.com
Mon Sep 20 22:54:22 PDT 2010


On Sep 20, 2010, at 10:05 PM, Marcin Świderski wrote:

> Added comments.

Thanks Marcin.  The contents of the patch look good to me.

> 
> I thought about tests myself but don't really know how should we go about them? I mean that for now destructors will probably be off by default. How to print CFG using the driver? How to set up testing the output?

The CFG can be printed from the command line thusly:

$ clang -cc1 -analyze -cfg-dump <file.cpp>

we can then check the output using FileCheck.  A good analogous test is plist-output.m, which tests the plist output of the analyzer that is currently used for rendering paths in Xcode (and potentially other clients).

> 
> W dniu 21 września 2010 03:24 użytkownik Ted Kremenek <kremenek at apple.com> napisał:
> Looks great!
> 
> Please add doxygen comments about CFGInitializer and CFGAutomaticObjDtor respectively.  We should get in the habit of documenting such core classes in the static analyzer.
> 
> We also should probably add a FileCheck-based test to test/Analysis that tests CFG printing (particularly these new pieces), since it has broken in the past.  Now that we're adding new CFGElements, now seems like a good time to start testing this.
> 
> On Sep 20, 2010, at 4:42 PM, Marcin Świderski wrote:
> 
> > This patch:
> > - defines interfaces for CFGInitializer and CFGAutomaticObjDtor,
> > - adds support for above classes to print_elem function (renamed print_stmt)
> >
> > I've extended StmtPrinterHelper to print locations of VarDecls for destructors.
> >
> > Please aprove for commit,
> >
> > Marcin
> > <cfg-print-elem.patch>
> 
> 
> <cfg-print-elem.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100920/08aa8663/attachment.html>


More information about the cfe-commits mailing list