cprover
cpp_typecheck_method_bodies.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: C++ Language Type Checking
4 
5 Author: Daniel Kroening, kroening@cs.cmu.edu
6 
7 \*******************************************************************/
8 
11 
12 #include "cpp_typecheck.h"
13 
15  method_bodiest &bodies)
16 {
17  instantiation_stackt old_instantiation_stack;
18  old_instantiation_stack.swap(instantiation_stack);
19 
20  for(auto &b : bodies)
21  {
22  symbolt &method_symbol=*b.method_symbol;
23  template_map.swap(b.template_map);
24  instantiation_stack.swap(b.instantiation_stack);
25 
26  if(method_symbol.name==ID_main)
27  add_argc_argv(method_symbol);
28 
29  exprt &body=method_symbol.value;
30  if(body.id()=="cpp_not_typechecked")
31  continue;
32 
33  if(body.is_not_nil() && !body.is_zero())
34  convert_function(method_symbol);
35  }
36 
37  old_instantiation_stack.swap(instantiation_stack);
38 }
irep_idt name
The unique identifier.
Definition: symbol.h:43
void convert_function(symbolt &symbol)
bool is_not_nil() const
Definition: irep.h:103
instantiation_stackt instantiation_stack
exprt value
Initial value of symbol.
Definition: symbol.h:37
template_mapt template_map
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
Definition: symbol.h:30
void swap(template_mapt &template_map)
Definition: template_map.h:35
const irep_idt & id() const
Definition: irep.h:189
std::list< instantiationt > instantiation_stackt
C++ Language Type Checking.
void typecheck_method_bodies(method_bodiest &)
Base class for all expressions.
Definition: expr.h:42
void add_argc_argv(const symbolt &main_symbol)
bool is_zero() const
Definition: expr.cpp:161
std::list< method_bodyt > method_bodiest