[clang] 1a4421a - [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 23 14:04:18 PDT 2020


Author: Simon Pilgrim
Date: 2020-03-23T21:03:14Z
New Revision: 1a4421a5e860ffc63c77594c9fb40787f84241aa

URL: https://github.com/llvm/llvm-project/commit/1a4421a5e860ffc63c77594c9fb40787f84241aa
DIFF: https://github.com/llvm/llvm-project/commit/1a4421a5e860ffc63c77594c9fb40787f84241aa.diff

LOG: [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

Added: 
    

Modified: 
    clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h

Removed: 
    


################################################################################
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 @@ class ConstraintManager {
     // 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);


        


More information about the cfe-commits mailing list