From 86a68d078c08af24ddc58833d8c10c14f79d21ce Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Wed, 28 Dec 2011 04:38:46 +0000 Subject: 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 --- clang/lib/Analysis/CFG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 5bbccf53c54..df8d7011af0 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/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); -- cgit v1.2.3