[PATCH] D42672: [CFG] [analyzer] Heavier CFGConstructor elements.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 4 05:27:55 PST 2018


xazax.hun added inline comments.


================
Comment at: include/clang/Analysis/CFG.h:153
+
+  ConstructionContext() = default;
+  ConstructionContext(CXXConstructExpr *Constructor, Stmt *Trigger)
----------------
Maybe I am getting this wrong, but I think in this case the members will be default initialized and will get indeterminate values.
See: http://en.cppreference.com/w/cpp/language/default_initialization
> Default initialization is performed in three situations:
> ..
> 3) when a base class or a non-static data member is not mentioned in a constructor initializer list and that constructor is called.
> 
> 
> The effects of default initialization are:
> 
> if T is a non-POD (until C++11) class type ...
> 
> if T is an array type, every element of the array is default-initialized;
> 
> otherwise, nothing is done: the objects with automatic storage duration (and their subobjects) are initialized to indeterminate values. 


================
Comment at: lib/Analysis/CFG.cpp:4402
+          stmt = SE->getStmt();
+        else if (auto CE = BI->getAs<CFGConstructor>())
+          stmt = CE->getConstructor();
----------------
So this is one of the places where subclassing would help? Could you measure the compile time regression after making `CFGStmt`'s `isKind` more complex?


https://reviews.llvm.org/D42672





More information about the cfe-commits mailing list