[PATCH] D47616: [CFG] [analyzer] Explain copy elision through construction contexts.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 15:10:10 PDT 2018


NoQ added inline comments.


================
Comment at: lib/Analysis/CFG.cpp:1320
+        auto *MTE = cast<MaterializeTemporaryExpr>(Child);
+        findConstructionContexts(ConstructionContextLayer::create(
+                                     cfg->getBumpVectorContext(), MTE, Layer),
----------------
george.karpenkov wrote:
> There are three repeated calls to `findConstructionContexts`, with only the second argument changing. Perhaps a helper lambda closure would help?
I'll look into this later for the whole function.


================
Comment at: lib/Analysis/CFG.cpp:4959
+  const Stmt *S1 = nullptr, *S2 = nullptr, *S3 = nullptr;
+  const ConstructionContext *CC1 = nullptr;
   switch (CC->getKind()) {
----------------
george.karpenkov wrote:
> begs for a comment differentiating CC from CC1
This variable was in fact unused.


https://reviews.llvm.org/D47616





More information about the cfe-commits mailing list