cprover
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 
10 #include "boolbv_type.h"
11 
12 bvtypet get_bvtype(const typet &type)
13 {
14  if(type.id()==ID_signedbv)
15  return bvtypet::IS_SIGNED;
16  else if(type.id()==ID_unsignedbv)
17  return bvtypet::IS_UNSIGNED;
18  else if(type.id()==ID_c_bool)
19  return bvtypet::IS_C_BOOL;
20  else if(type.id() == ID_c_enum || type.id() == ID_c_enum_tag)
21  return bvtypet::IS_C_ENUM;
22  else if(type.id()==ID_floatbv)
23  return bvtypet::IS_FLOAT;
24  else if(type.id()==ID_fixedbv)
25  return bvtypet::IS_FIXED;
26  else if(type.id()==ID_bv)
27  return bvtypet::IS_BV;
28  else if(type.id()==ID_verilog_signedbv)
30  else if(type.id()==ID_verilog_unsignedbv)
32  else if(type.id()==ID_range)
33  return bvtypet::IS_RANGE;
34  else if(type.id()==ID_c_bit_field)
36 
37  return bvtypet::IS_UNKNOWN;
38 }
bvtypet::IS_SIGNED
@ IS_SIGNED
typet
The type of an expression, extends irept.
Definition: type.h:29
bvtypet::IS_FIXED
@ IS_FIXED
bvtypet::IS_C_BIT_FIELD
@ IS_C_BIT_FIELD
boolbv_type.h
get_bvtype
bvtypet get_bvtype(const typet &type)
Definition: boolbv_type.cpp:12
bvtypet::IS_VERILOG_SIGNED
@ IS_VERILOG_SIGNED
bvtypet::IS_RANGE
@ IS_RANGE
bvtypet::IS_UNSIGNED
@ IS_UNSIGNED
bvtypet::IS_BV
@ IS_BV
bvtypet
bvtypet
Definition: boolbv_type.h:17
bvtypet::IS_VERILOG_UNSIGNED
@ IS_VERILOG_UNSIGNED
bvtypet::IS_FLOAT
@ IS_FLOAT
bvtypet::IS_C_BOOL
@ IS_C_BOOL
irept::id
const irep_idt & id() const
Definition: irep.h:418
bvtypet::IS_C_ENUM
@ IS_C_ENUM
bvtypet::IS_UNKNOWN
@ IS_UNKNOWN