[PATCH] D37470: [analyzer] Handle ObjC messages conservatively in CallDescription

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 05:51:57 PDT 2017


xazax.hun created this revision.
Herald added subscribers: baloghadamsoftware, whisperity.

The users of CallDescription no longer need to make sure that the called function is a C function. This makes the API usage easier and it conservatively will never match ObjC Messages. In the future, this construct might be extended to support overloading, ctors, dtors, messages.


Repository:
  rL LLVM

https://reviews.llvm.org/D37470

Files:
  lib/StaticAnalyzer/Core/CallEvent.cpp


Index: lib/StaticAnalyzer/Core/CallEvent.cpp
===================================================================
--- lib/StaticAnalyzer/Core/CallEvent.cpp
+++ lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -211,7 +211,9 @@
 }
 
 bool CallEvent::isCalled(const CallDescription &CD) const {
-  assert(getKind() != CE_ObjCMessage && "Obj-C methods are not supported");
+  // FIXME: Add ObjC Message support.
+  if (getKind() == CE_ObjCMessage)
+    return false;
   if (!CD.IsLookupDone) {
     CD.IsLookupDone = true;
     CD.II = &getState()->getStateManager().getContext().Idents.get(CD.FuncName);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37470.113843.patch
Type: text/x-patch
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170905/a5a18216/attachment.bin>


More information about the cfe-commits mailing list