From 3bde08e7cc5f52ceb4cfd13ec055e9b12d0302e4 Mon Sep 17 00:00:00 2001 From: Daniel Kroening Date: Wed, 8 Feb 2017 22:32:07 +0000 Subject: [PATCH] Revert "direct support for ID_c_bool in exprt" --- src/util/expr.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/util/expr.cpp b/src/util/expr.cpp index 7f77a06457c..b317b434e41 100644 --- a/src/util/expr.cpp +++ b/src/util/expr.cpp @@ -245,18 +245,9 @@ Function: exprt::is_true bool exprt::is_true() const { - if(is_constant()) - { - if(type().id()==ID_bool) - return get(ID_value)!=ID_false; - else if(type().id()==ID_c_bool) - { - mp_integer i; - to_integer(*this, i); - return i!=mp_integer(0); - } - } - return false; + return is_constant() && + type().id()==ID_bool && + get(ID_value)!=ID_false; } /*******************************************************************\ @@ -273,14 +264,9 @@ Function: exprt::is_false bool exprt::is_false() const { - if(is_constant()) - { - if(type().id()==ID_bool) - return get(ID_value)==ID_false; - else if(type().id()==ID_c_bool) - return !is_true(); - } - return false; + return is_constant() && + type().id()==ID_bool && + get(ID_value)==ID_false; } /*******************************************************************\