[PATCH] D43428: [CFG] [analyzer] NFC: Allow more complicated construction contexts.

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 20:39:48 PST 2018


dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.

It seems kind of sketchy to me that we're recursing over an expression to find construction contexts and then later doing it again for sub-expressions. I guess there is precedent here with `VisitForTemporaryDtors()`, but we should think about whether there is a better way to do this.



================
Comment at: lib/Analysis/CFG.cpp:1160
+            ConstructionContextMap.lookup(CE)) {
+      // We might have visited this child when we were finding construction
+      // contexts within its parents.
----------------
This is kind of scary since it means we'll be recursing over subexpressions repeatedly. I guess VisitForTemporaryDtors() does this too, but it sounds like we're wasting a lot of computation visiting the subtrees over and over again.


https://reviews.llvm.org/D43428





More information about the cfe-commits mailing list