r247660 - [analyzer] Restore behavior change introduced by r247657.
NAKAMURA Takumi via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 20:34:15 PDT 2015
Sorry, I didn't notice while I was checking.
2015年9月15日(火) 12:29 Devin Coughlin via cfe-commits <
cfe-commits at lists.llvm.org>:
> Author: dcoughlin
> Date: Mon Sep 14 22:28:27 2015
> New Revision: 247660
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247660&view=rev
> Log:
> [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.
>
> Modified:
> cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp?rev=247660&r1=247659&r2=247660&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp Mon Sep 14
> 22:28:27 2015
> @@ -182,10 +182,11 @@ void ExprEngine::VisitObjCMessage(const
> // 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
> // 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;
> }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150915/7a5f3b36/attachment-0001.html>
More information about the cfe-commits
mailing list