From e584e48e4cb31bdb313ca5978410634a6fe25bef Mon Sep 17 00:00:00 2001 From: Devin Coughlin Date: Tue, 15 Sep 2015 03:28:27 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247660 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/ExprEngineObjC.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp b/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp index eb035acee9..92c5fe6b6f 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp +++ b/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; } -- 2.40.0