[PATCH] D50866: [analyzer] CFRetainReleaseChecker: Avoid checking C++ methods with the same name.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 16:05:55 PDT 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp:537
+  mutable APIMisuse BT{this, "null passed to CF memory management function"};
+  CallDescription CFRetain{"CFRetain", 1},
+                  CFRelease{"CFRelease", 1},
----------------
george.karpenkov wrote:
> I personally would prefer being less fancy, and avoiding the comma operator, but I suppose it's a matter of style.
This isn't comma operator, just initializer list.

Alternatives are:

- `CallDescription CFRetain = {"CFRetain", 1}` (longer but looks the same)

- `CallDescription CFRetain = CallDescription("CFRetain", 1), ...` (longer and duplicates type)

- `CallDescription CFRetain;` `CFRetainReleaseChecker(): CFRetain("CFRetain", 1)` (longer and duplicates variable name)



================
Comment at: lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp:567
+  ProgramStateRef stateNonNull, stateNull;
+  std::tie(stateNonNull, stateNull) = state->assume(*DefArgVal);
 
----------------
george.karpenkov wrote:
> There's also DefArgVal
?


Repository:
  rC Clang

https://reviews.llvm.org/D50866





More information about the cfe-commits mailing list