[PATCH] D48249: [analyzer] Add stubs for argument construction contexts for arguments of C++ constructors and Objective-C messages.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 3 11:34:27 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added a comment.
This revision now requires changes to proceed.

Minor nit: request for code reuse.



================
Comment at: lib/Analysis/CFG.cpp:694
+                std::is_same<CallLikeExpr, CXXConstructExpr>::value ||
+                std::is_same<CallLikeExpr, ObjCMessageExpr>::value>>
+  void findConstructionContextsForArguments(CallLikeExpr *E) {
----------------
Who needs inheritance if one has templates.
This is pretty bad though, I wish we could add another interface to those three, if anything just to have `arguments()`


================
Comment at: lib/Analysis/ConstructionContext.cpp:115
         // This is a constructor into a function argument. Not implemented yet.
-        if (isa<CallExpr>(ParentLayer->getTriggerStmt()))
+        if (isa<CallExpr>(ParentLayer->getTriggerStmt()) ||
+            isa<CXXConstructExpr>(ParentLayer->getTriggerStmt()) ||
----------------
Could we refactor the check into `isCallable` or whatever would be the appropriate name here?


https://reviews.llvm.org/D48249





More information about the cfe-commits mailing list