diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-12-06 18:58:01 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-12-06 18:58:01 +0000 |
commit | 047208027abb2ba26b866ddb63d7b17dd31e23c1 (patch) | |
tree | 208038467e3eae3e04139e89b13e5b8dc7f326f0 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 65ca2fb9e670029166ac39549e1b0ef7b8989bb8 (diff) | |
download | bcm5719-llvm-047208027abb2ba26b866ddb63d7b17dd31e23c1.tar.gz bcm5719-llvm-047208027abb2ba26b866ddb63d7b17dd31e23c1.zip |
[analyzer] Remove bindExprAndLocation, which does extra work for no gain.
This feature was probably intended to improve diagnostics, but was currently
only used when dumping the Environment. It shows what location a given value
was loaded from, e.g. when evaluating an LValueToRValue cast.
llvm-svn: 169522
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index b0cd6487cb3..ade44567f1c 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1736,20 +1736,15 @@ void ExprEngine::evalLoadCommon(ExplodedNodeSet &Dst, state = (*NI)->getState(); const LocationContext *LCtx = (*NI)->getLocationContext(); - if (location.isUnknown()) { - // This is important. We must nuke the old binding. - Bldr.generateNode(NodeEx, *NI, - state->BindExpr(BoundEx, LCtx, UnknownVal()), - tag, ProgramPoint::PostLoadKind); - } - else { + SVal V = UnknownVal(); + if (location.isValid()) { if (LoadTy.isNull()) LoadTy = BoundEx->getType(); - SVal V = state->getSVal(cast<Loc>(location), LoadTy); - Bldr.generateNode(NodeEx, *NI, - state->bindExprAndLocation(BoundEx, LCtx, location, V), - tag, ProgramPoint::PostLoadKind); + V = state->getSVal(cast<Loc>(location), LoadTy); } + + Bldr.generateNode(NodeEx, *NI, state->BindExpr(BoundEx, LCtx, V), tag, + ProgramPoint::PostLoadKind); } } |