[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 Jun 26 18:17:05 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Analysis/CFG.cpp:2397
+  for (auto Arg: C->arguments())
+    if (Arg->getType()->getAsCXXRecordDecl() && !Arg->isGLValue())
+      findConstructionContexts(
----------------
Would appreciate a top-level comment that this is specifically for constructors passing arguments by value.


================
Comment at: lib/Analysis/CFG.cpp:4284
+          ConstructionContextLayer::create(cfg->getBumpVectorContext(), C),
+          Arg);
+
----------------
I think we can do better then duplicating the same code block three times with an exact comment as well. I do understand that it's painful due to call expressions not having a common superclass, but maybe it would be sufficient to just have a function iterating over arguments?


https://reviews.llvm.org/D48249





More information about the cfe-commits mailing list