CBMC
boolbv_type.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 #include "boolbv_type.h"
10 
11 #include <util/type.h>
12 
13 bvtypet get_bvtype(const typet &type)
14 {
15  if(type.id()==ID_signedbv)
16  return bvtypet::IS_SIGNED;
17  else if(type.id()==ID_unsignedbv)
18  return bvtypet::IS_UNSIGNED;
19  else if(type.id()==ID_c_bool)
20  return bvtypet::IS_C_BOOL;
21  else if(type.id() == ID_c_enum || type.id() == ID_c_enum_tag)
22  return bvtypet::IS_C_ENUM;
23  else if(type.id()==ID_floatbv)
24  return bvtypet::IS_FLOAT;
25  else if(type.id()==ID_fixedbv)
26  return bvtypet::IS_FIXED;
27  else if(type.id()==ID_bv)
28  return bvtypet::IS_BV;
29  else if(type.id()==ID_verilog_signedbv)
31  else if(type.id()==ID_verilog_unsignedbv)
33  else if(type.id()==ID_range)
34  return bvtypet::IS_RANGE;
35  else if(type.id()==ID_c_bit_field)
37 
38  return bvtypet::IS_UNKNOWN;
39 }
bvtypet get_bvtype(const typet &type)
Definition: boolbv_type.cpp:13
bvtypet
Definition: boolbv_type.h:17
@ IS_VERILOG_UNSIGNED
@ IS_VERILOG_SIGNED
@ IS_C_BIT_FIELD
const irep_idt & id() const
Definition: irep.h:388
The type of an expression, extends irept.
Definition: type.h:29
Defines typet, type_with_subtypet and type_with_subtypest.