summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-09-15 03:28:27 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-09-15 03:28:27 +0000
commit676a58c9b2cd290dea5db3fd5a185654fae9511c (patch)
treec9d34c4faaaf0afc19057c70ea60671ae36b00aa /clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
parent1cbe80408d1e24126b4eb1ee19466fd23f9ec255 (diff)
downloadbcm5719-llvm-676a58c9b2cd290dea5db3fd5a185654fae9511c.tar.gz
bcm5719-llvm-676a58c9b2cd290dea5db3fd5a185654fae9511c.zip
[analyzer] Restore behavior change introduced by r247657.
r247657 fixed warnings about unused variables when compiling without asserts but changed behavior. This commit restores the old behavior but still suppresses the warnings. llvm-svn: 247660
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
index eb035acee96..92c5fe6b6f1 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
@@ -182,10 +182,11 @@ void ExprEngine::VisitObjCMessage(const ObjCMessageExpr *ME,
// Receiver is definitely nil, so run ObjCMessageNil callbacks and return.
if (nilState && !notNilState) {
StmtNodeBuilder Bldr(Pred, Dst, *currBldrCtx);
+ bool HasTag = Pred->getLocation().getTag();
Pred = Bldr.generateNode(ME, Pred, nilState, nullptr,
ProgramPoint::PreStmtKind);
- assert((Pred || Pred->getLocation().getTag()) &&
- "Should have cached out already!");
+ assert((Pred || HasTag) && "Should have cached out already!");
+ (void)HasTag;
if (!Pred)
return;
getCheckerManager().runCheckersForObjCMessageNil(Dst, Pred,
@@ -198,9 +199,10 @@ void ExprEngine::VisitObjCMessage(const ObjCMessageExpr *ME,
// Generate a transition to the non-nil state, dropping any potential
// nil flow.
if (notNilState != State) {
+ bool HasTag = Pred->getLocation().getTag();
Pred = Bldr.generateNode(ME, Pred, notNilState);
- assert((Pred || Pred->getLocation().getTag()) &&
- "Should have cached out already!");
+ assert((Pred || HasTag) && "Should have cached out already!");
+ (void)HasTag;
if (!Pred)
return;
}
OpenPOWER on IntegriCloud