[PATCH] D76622: [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

2020-03-24 Thread Simon Pilgrim via Phabricator via cfe-commits
RKSimon added a comment.

In D76622#1938009 , @NoQ wrote:

> Sounds good but eventually i hope we re-enable this assert in release+assert 
> builds (D57062 ).


SGTM as long as you don't reintroduce a compiler specific guard


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76622/new/

https://reviews.llvm.org/D76622



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76622: [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

2020-03-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment.

Sounds good but eventually i hope we re-enable this assert in release+assert 
builds (D57062 ).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76622/new/

https://reviews.llvm.org/D76622



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76622: [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

2020-03-23 Thread Simon Pilgrim via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a4421a5e860: [analyzer] ConstraintManager - use 
EXPENSIVE_CHECKS instead of (gcc specific)… (authored by RKSimon).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76622/new/

https://reviews.llvm.org/D76622

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


Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
===
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
@@ -96,11 +96,7 @@
 // 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);


Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
===
--- clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
@@ -96,11 +96,7 @@
 // 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);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76622: [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

2020-03-23 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso accepted this revision.
Charusso added a comment.
This revision is now accepted and ready to land.

Nice catch, thanks! We have some FIXMEs about MSVC sadly and I was thinking 
about the same change back in the days.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76622/new/

https://reviews.llvm.org/D76622



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D76622: [analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

2020-03-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment.

SGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76622/new/

https://reviews.llvm.org/D76622



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits