[PATCH] [analyzer][Review request] Improved checker naming in CFG dump.

Jordan Rose jordan_rose at apple.com
Fri Feb 14 09:16:53 PST 2014


  I completely forgot about this FIXME! And it will be nice to see it fixed. :-) (Even if it does something a bit weird for checkers that implement multiple checks...it will pick the last one.)


================
Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1741-1742
@@ -1740,3 +1740,4 @@
   if (!Errors.empty()) {
-    static SimpleProgramPointTag Tag("MallocChecker : DeadSymbolsLeak");
+    static SimpleProgramPointTag 
+           Tag(getCheckName().getName() + " : DeadSymbolsLeak");
     N = C.addTransition(C.getState(), C.getPredecessor(), &Tag);
----------------
Ted Kremenek wrote:
> This is a small improvement, but it is still boilerplate.  It also doesn't enforce regularity.  It would be great if I could write:
> 
>   SimpleProgramPointTag Tag(getCheckName(), "DeadSymbolsLeak")
> 
> and then just have the constructor do the string formation.  Going one step further, it would be great if I could just write:
> 
>   SimpleProgramPointTag Tag(this, "DeadSymbolsLeak")
> 
> since "getCheckName()" can easily be called.  That's much simpler and regular. You then don't have to expose string concatenation to the user, and it allows us to change the internal representation of SimpleProgramPointTag later if we should so choose.
I agree, with the note that it should be a separate CheckerProgramPointTag class. ProgramPointTag is already virtual.


http://llvm-reviews.chandlerc.com/D2793



More information about the cfe-commits mailing list