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.

llvm-svn: 147306
This commit is contained in:
Zhongxing Xu 2011-12-28 04:38:46 +00:00
parent a71989c94e
commit 86a68d078c
1 changed files with 1 additions and 1 deletions

View File

@ -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);