[cfe-commits] r112578 - in /cfe/trunk: lib/Analysis/CFG.cpp test/Analysis/temporaries.cpp
Douglas Gregor
dgregor at apple.com
Mon Aug 30 22:10:27 PDT 2010
Author: dgregor
Date: Tue Aug 31 00:10:27 2010
New Revision: 112578
URL: http://llvm.org/viewvc/llvm-project?rev=112578&view=rev
Log:
Teach the CFGBuilder not do die on CXXBindTemporaryExpr, CXXOperatorCallExpr. Fixes a Boost.Graph crasher.
Added:
cfe/trunk/test/Analysis/temporaries.cpp (with props)
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=112578&r1=112577&r2=112578&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Tue Aug 31 00:10:27 2010
@@ -370,6 +370,7 @@
return VisitBreakStmt(cast<BreakStmt>(S));
case Stmt::CallExprClass:
+ case Stmt::CXXOperatorCallExprClass: // FIXME: handle specially?
return VisitCallExpr(cast<CallExpr>(S), asc);
case Stmt::CaseStmtClass:
@@ -396,6 +397,12 @@
return Visit(cast<CXXExprWithTemporaries>(S)->getSubExpr());
}
+ case Stmt::CXXBindTemporaryExprClass: {
+ // FIXME: Handle temporary binding. For now, just visit the subexpression
+ // so we don't artificially create extra blocks.
+ return Visit(cast<CXXBindTemporaryExpr>(S)->getSubExpr());
+ }
+
case Stmt::CXXMemberCallExprClass:
return VisitCXXMemberCallExpr(cast<CXXMemberCallExpr>(S), asc);
Added: cfe/trunk/test/Analysis/temporaries.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/temporaries.cpp?rev=112578&view=auto
==============================================================================
--- cfe/trunk/test/Analysis/temporaries.cpp (added)
+++ cfe/trunk/test/Analysis/temporaries.cpp Tue Aug 31 00:10:27 2010
@@ -0,0 +1,13 @@
+// // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
+
+// FIXME: Super-simple test to make sure we don't die on temporaries.
+
+struct X {
+ X();
+ ~X();
+ X operator++(int);
+};
+
+int f(X x, X y) {
+ for (; ; x++) { }
+}
Propchange: cfe/trunk/test/Analysis/temporaries.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/trunk/test/Analysis/temporaries.cpp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cfe/trunk/test/Analysis/temporaries.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the cfe-commits
mailing list