From: Zhongxing Xu Date: Wed, 28 Dec 2011 04:38:46 +0000 (+0000) Subject: Enable the user to control whether CXXConstructExpr will be added as a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72b20ff76a9070c1a481331e857aa825ae37c97f;p=clang Enable the user to control whether CXXConstructExpr will be added as a block-level expr. Currently CXXConstructExpr is always added as a block-level expr. This caused two problems for the analyzer (and potentially for the CFG-based codegen). 1. We have no way to know whether a ctor call is base or complete. 2. We have no way to know the destination object being contructed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147306 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 5bbccf53c5..df8d7011af 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -2768,7 +2768,7 @@ CFGBlock *CFGBuilder::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E, CFGBlock *CFGBuilder::VisitCXXConstructExpr(CXXConstructExpr *C, AddStmtChoice asc) { autoCreateBlock(); - if (!C->isElidable()) + if (!C->isElidable() && asc.alwaysAdd(*this, C)) appendStmt(Block, C); return VisitChildren(C);