[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
This commit is contained in:
Simon Pilgrim 2020-03-23 21:02:54 +00:00
parent 66073953a5
commit 1a4421a5e8
1 changed files with 1 additions and 5 deletions

View File

@ -96,11 +96,7 @@ public:
// If StTrue is infeasible, asserting the falseness of Cond is unnecessary // If StTrue is infeasible, asserting the falseness of Cond is unnecessary
// because the existing constraints already establish this. // because the existing constraints already establish this.
if (!StTrue) { if (!StTrue) {
#ifndef __OPTIMIZE__ #ifdef EXPENSIVE_CHECKS
// 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?
assert(assume(State, Cond, false) && "System is over constrained."); assert(assume(State, Cond, false) && "System is over constrained.");
#endif #endif
return ProgramStatePair((ProgramStateRef)nullptr, State); return ProgramStatePair((ProgramStateRef)nullptr, State);