zaks.anna added inline comments.

================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:309
@@ -286,1 +308,3 @@
 
+  /// \brief Returns true if the CallEvent is call to a function that matches
+  /// the CallDescription.
----------------
"is call" -> "is a call"

================
Comment at: lib/StaticAnalyzer/Core/CheckerContext.cpp:41
@@ +40,3 @@
+                              const CallDescription &CD) {
+  assert(Call.getKind() != CE_ObjCMessage);
+  if (!CD.II)
----------------
Please, add && "ObjC Methods are not supported"

================
Comment at: lib/StaticAnalyzer/Core/CheckerContext.cpp:47
@@ +46,3 @@
+    return false;
+  return Call.getCalleeIdentifier() == CD.II;
+}
----------------
You can micro optimize by checking if the identifier matches first (and only 
checking arguments later); in most cases it won't.

================
Comment at: lib/StaticAnalyzer/Core/CheckerContext.cpp:57
@@ +56,3 @@
+    return false;
+  return Call.getSelector() == getASTContext().Selectors.getSelector(0, 
&CD.II);
+}
----------------
This will only match against the first part of the ObjC method name. Also, this 
is not tested. I am Ok with adding the ObjC support later and adding an assert 
above to error out if this is used for ObjC.


http://reviews.llvm.org/D15921



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to