From 1a4421a5e860ffc63c77594c9fb40787f84241aa Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 23 Mar 2020 21:02:54 +0000 Subject: [PATCH] [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard This was noticed on D71817, which removed another use of __OPTIMIZE__ Differential Revision: https://reviews.llvm.org/D76622 --- .../StaticAnalyzer/Core/PathSensitive/ConstraintManager.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h index f85c37379158..935b2bb7b937 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h @@ -96,11 +96,7 @@ public: // If StTrue is infeasible, asserting the falseness of Cond is unnecessary // because the existing constraints already establish this. if (!StTrue) { -#ifndef __OPTIMIZE__ - // This check is expensive and should be disabled even in Release+Asserts - // builds. - // FIXME: __OPTIMIZE__ is a GNU extension that Clang implements but MSVC - // does not. Is there a good equivalent there? +#ifdef EXPENSIVE_CHECKS assert(assume(State, Cond, false) && "System is over constrained."); #endif return ProgramStatePair((ProgramStateRef)nullptr, State);