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

Ted Kremenek kremenek at apple.com
Thu Feb 13 15:28:38 PST 2014



================
Comment at: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:3348-3351
@@ -3343,4 +3347,6 @@
 
-      static SimpleProgramPointTag
-             ReturnNotOwnedTag("RetainCountChecker : ReturnNotOwnedForOwned");
+      SmallString<55> TagBuf;
+      llvm::raw_svector_ostream TagOs(TagBuf);
+      TagOs << getCheckName().getName() << " : ReturnNotOwnedForOwned";
+      static SimpleProgramPointTag ReturnNotOwnedTag(TagOs.str());
       ExplodedNode *N = C.addTransition(state, Pred, &ReturnNotOwnedTag);
----------------
This is a performance regression.  The string is constructed every time this block of code runs, whereas before the static variable was initialized once.  If we hoist the string logic inside the initialization then there won't be a regression here.  Constructing the string every time is very bad for performance.


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



More information about the cfe-commits mailing list