summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-02-02 05:15:53 +0000
committerJordan Rose <jordan_rose@apple.com>2013-02-02 05:15:53 +0000
commite0c260f137eae9c3584cf56f00547f8ccfbf1b30 (patch)
treec9560e2bff04090f8589b9796fbe6dc16ad0eb7f /clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
parentf8933f83f04b133fa3c79cf1f225edadc066cf34 (diff)
downloadbcm5719-llvm-e0c260f137eae9c3584cf56f00547f8ccfbf1b30.tar.gz
bcm5719-llvm-e0c260f137eae9c3584cf56f00547f8ccfbf1b30.zip
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
...again. The problem has not been fixed and our internal buildbot is still getting hangs. This reverts r174212, originally applied in r173951, then reverted in r174069. Will not re-apply until the entire project analyzes successfully on my local machine. llvm-svn: 174265
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp54
1 files changed, 6 insertions, 48 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
index fdd50a6b544..1f0c523ac66 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
@@ -49,35 +49,6 @@ void ExprEngine::CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME,
Bldr.generateNode(ME, Pred, state->BindExpr(ME, LCtx, V));
}
-void ExprEngine::performTrivialCopy(NodeBuilder &Bldr, ExplodedNode *Pred,
- const CXXConstructorCall &Call) {
- const CXXConstructExpr *CtorExpr = Call.getOriginExpr();
- assert(CtorExpr->getConstructor()->isCopyOrMoveConstructor());
- assert(CtorExpr->getConstructor()->isTrivial());
-
- SVal ThisVal = Call.getCXXThisVal();
- const LocationContext *LCtx = Pred->getLocationContext();
-
- ExplodedNodeSet Dst;
- Bldr.takeNodes(Pred);
-
- SVal V = Call.getArgSVal(0);
-
- // Make sure the value being copied is not unknown.
- if (const Loc *L = dyn_cast<Loc>(&V))
- V = Pred->getState()->getSVal(*L);
-
- evalBind(Dst, CtorExpr, Pred, ThisVal, V, true);
-
- PostStmt PS(CtorExpr, LCtx);
- for (ExplodedNodeSet::iterator I = Dst.begin(), E = Dst.end();
- I != E; ++I) {
- ProgramStateRef State = (*I)->getState();
- State = bindReturnValue(Call, LCtx, State);
- Bldr.generateNode(PS, State, *I);
- }
-}
-
void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE,
ExplodedNode *Pred,
ExplodedNodeSet &destNodes) {
@@ -85,7 +56,6 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE,
ProgramStateRef State = Pred->getState();
const MemRegion *Target = 0;
- bool IsArray = false;
switch (CE->getConstructionKind()) {
case CXXConstructExpr::CK_Complete: {
@@ -109,7 +79,6 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE,
Target = State->getLValue(AT->getElementType(),
getSValBuilder().makeZeroArrayIndex(),
Base).getAsRegion();
- IsArray = true;
} else {
Target = State->getLValue(Var, LCtx).getAsRegion();
}
@@ -179,25 +148,14 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *CE,
getCheckerManager().runCheckersForPreCall(DstPreCall, DstPreVisit,
*Call, *this);
- ExplodedNodeSet DstEvaluated;
- StmtNodeBuilder Bldr(DstPreCall, DstEvaluated, *currBldrCtx);
-
- if (CE->getConstructor()->isTrivial() &&
- CE->getConstructor()->isCopyOrMoveConstructor() &&
- !IsArray) {
- // FIXME: Handle other kinds of trivial constructors as well.
- for (ExplodedNodeSet::iterator I = DstPreCall.begin(), E = DstPreCall.end();
- I != E; ++I)
- performTrivialCopy(Bldr, *I, *Call);
-
- } else {
- for (ExplodedNodeSet::iterator I = DstPreCall.begin(), E = DstPreCall.end();
- I != E; ++I)
- defaultEvalCall(Bldr, *I, *Call);
- }
+ ExplodedNodeSet DstInvalidated;
+ StmtNodeBuilder Bldr(DstPreCall, DstInvalidated, *currBldrCtx);
+ for (ExplodedNodeSet::iterator I = DstPreCall.begin(), E = DstPreCall.end();
+ I != E; ++I)
+ defaultEvalCall(Bldr, *I, *Call);
ExplodedNodeSet DstPostCall;
- getCheckerManager().runCheckersForPostCall(DstPostCall, DstEvaluated,
+ getCheckerManager().runCheckersForPostCall(DstPostCall, DstInvalidated,
*Call, *this);
getCheckerManager().runCheckersForPostStmt(destNodes, DstPostCall, CE, *this);
}
OpenPOWER on IntegriCloud