aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-12-21 18:26:48 +0000
committerJordan Rose <jordan_rose@apple.com>2012-12-21 18:26:48 +0000
commit30f102b2782d08eb3ea61dd20a2ff7326a15fe1e (patch)
treee2ddba3d7bb51debee692281a1721d0f5e635b82
parentb23ae0c5104a4fec4c2ff603143fe142ec409249 (diff)
[analyzer] Don't perform an expensive assertion in release builds.
Unfortunately, we don't seem to have a standard way to do this. I'm using the __OPTIMIZE__ GNU extension that Clang also defines, but that doesn't help MSVC. I suppose we could remove the check entirely, but it's useful for developing new constraint managers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170915 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
index 7b03b901b6..5153bcd87c 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
@@ -78,9 +78,13 @@ public:
// If StTrue is infeasible, asserting the falseness of Cond is unnecessary
// because the existing constraints already establish this.
if (!StTrue) {
- // FIXME: This is fairly expensive and should be disabled even in
- // Release+Asserts builds.
+#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?
assert(assume(State, Cond, false) && "System is over constrained.");
+#endif
return ProgramStatePair((ProgramStateRef)NULL, State);
}