[cfe-commits] r147306 - /cfe/trunk/lib/Analysis/CFG.cpp

Zhongxing Xu xuzhongxing at foxmail.com
Tue Dec 27 20:38:46 PST 2011


Author: zhongxingxu
Date: Tue Dec 27 22:38:46 2011
New Revision: 147306

URL: http://llvm.org/viewvc/llvm-project?rev=147306&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Analysis/CFG.cpp

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=147306&r1=147305&r2=147306&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Tue Dec 27 22:38:46 2011
@@ -2768,7 +2768,7 @@
 CFGBlock *CFGBuilder::VisitCXXConstructExpr(CXXConstructExpr *C,
                                             AddStmtChoice asc) {
   autoCreateBlock();
-  if (!C->isElidable())
+  if (!C->isElidable() && asc.alwaysAdd(*this, C))
     appendStmt(Block, C);
 
   return VisitChildren(C);





More information about the cfe-commits mailing list