diff options
-rw-r--r-- | src/base/check.h | 17 | ||||
-rw-r--r-- | src/include/cvc5_public.h | 17 | ||||
-rw-r--r-- | src/theory/theory.h | 5 | ||||
-rw-r--r-- | test/unit/theory/theory_white.cpp | 6 |
4 files changed, 17 insertions, 28 deletions
diff --git a/src/base/check.h b/src/base/check.h index 91b492c45..916d6a6a1 100644 --- a/src/base/check.h +++ b/src/base/check.h @@ -39,23 +39,6 @@ #include "base/exception.h" #include "cvc5_export.h" -// Define CVC5_PREDICT_FALSE(x) that helps the compiler predict that x will be -// false (if there is compiler support). -#ifdef __has_builtin -#if __has_builtin(__builtin_expect) -#define CVC5_PREDICT_FALSE(x) (__builtin_expect(x, false)) -#define CVC5_PREDICT_TRUE(x) (__builtin_expect(x, true)) -#else -#define CVC5_PREDICT_FALSE(x) x -#define CVC5_PREDICT_TRUE(x) x -#endif -#else -#define CVC5_PREDICT_FALSE(x) x -#define CVC5_PREDICT_TRUE(x) x -#endif - -#define CVC5_FALLTHROUGH [[fallthrough]] - namespace cvc5 { // Implementation notes: diff --git a/src/include/cvc5_public.h b/src/include/cvc5_public.h index 4109c013f..7b43739ae 100644 --- a/src/include/cvc5_public.h +++ b/src/include/cvc5_public.h @@ -20,6 +20,23 @@ #include <stddef.h> #include <stdint.h> +// Define CVC5_PREDICT_FALSE(x) that helps the compiler predict that x will be +// false (if there is compiler support). +#ifdef __has_builtin +#if __has_builtin(__builtin_expect) +#define CVC5_PREDICT_FALSE(x) (__builtin_expect(x, false)) +#define CVC5_PREDICT_TRUE(x) (__builtin_expect(x, true)) +#else +#define CVC5_PREDICT_FALSE(x) x +#define CVC5_PREDICT_TRUE(x) x +#endif +#else +#define CVC5_PREDICT_FALSE(x) x +#define CVC5_PREDICT_TRUE(x) x +#endif + +#define CVC5_FALLTHROUGH [[fallthrough]] + // CVC5_UNUSED is to mark something (e.g. local variable, function) // as being _possibly_ unused, so that the compiler generates no // warning about it. This might be the case for e.g. a variable diff --git a/src/theory/theory.h b/src/theory/theory.h index b49d838b4..ccda5fa77 100644 --- a/src/theory/theory.h +++ b/src/theory/theory.h @@ -440,11 +440,6 @@ class Theory : protected EnvObj EFFORT_LAST_CALL = 200 }; /* enum Effort */ - static bool standardEffortOrMore(Effort e) { return e >= EFFORT_STANDARD; } - static bool standardEffortOnly(Effort e) - { - return e >= EFFORT_STANDARD && e < EFFORT_FULL; - } static bool fullEffort(Effort e) { return e == EFFORT_FULL; } /** diff --git a/test/unit/theory/theory_white.cpp b/test/unit/theory/theory_white.cpp index 915b469db..eb80723fd 100644 --- a/test/unit/theory/theory_white.cpp +++ b/test/unit/theory/theory_white.cpp @@ -61,14 +61,8 @@ TEST_F(TestTheoryWhite, effort) Theory::Effort s = Theory::EFFORT_STANDARD; Theory::Effort f = Theory::EFFORT_FULL; - ASSERT_TRUE(Theory::standardEffortOnly(s)); - ASSERT_FALSE(Theory::standardEffortOnly(f)); - ASSERT_FALSE(Theory::fullEffort(s)); ASSERT_TRUE(Theory::fullEffort(f)); - - ASSERT_TRUE(Theory::standardEffortOrMore(s)); - ASSERT_TRUE(Theory::standardEffortOrMore(f)); } TEST_F(TestTheoryWhite, done) |