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)
29  return bvtypet::IS_VERILOG_SIGNED;
30  else if(type.id()==ID_verilog_unsignedbv)
31  return bvtypet::IS_VERILOG_UNSIGNED;
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 }
typet
The type of an expression, extends irept.
Definition: type.h:29
boolbv_type.h
get_bvtype
bvtypet get_bvtype(const typet &type)
Definition: boolbv_type.cpp:12
bvtypet::IS_BV
@ IS_BV
bvtypet
bvtypet
Definition: boolbv_type.h:17
irept::id
const irep_idt & id() const
Definition: irep.h:418