CBMC
call_graph_test_utils.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Call graph test utils
4 
5 Author: Chris Smowton, chris.smowton@diffblue.com
6 
7 \*******************************************************************/
8 
10 
11 #include <util/std_code.h>
12 
13 symbolt
14 create_void_function_symbol(const irep_idt &name, const codet &code)
15 {
16  const code_typet void_function_type({}, empty_typet());
17  symbolt function;
18  function.name = name;
19  function.type = void_function_type;
20  function.mode = ID_java;
21  function.value = code;
22  return function;
23 }
24 
26  const std::multimap<irep_idt, irep_idt> &map,
27  const irep_idt &key,
28  const std::set<irep_idt> &values)
29 {
30  auto matching_values = map.equal_range(key);
31  std::set<irep_idt> matching_set;
32  for(auto it = matching_values.first; it != matching_values.second; ++it)
33  matching_set.insert(it->second);
34  return matching_set == values;
35 }
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
empty_typet
The empty type.
Definition: std_types.h:50
code_typet
Base type of functions.
Definition: std_types.h:538
std_code.h
call_graph_test_utils.h
symbolt
Symbol table entry.
Definition: symbol.h:27
create_void_function_symbol
symbolt create_void_function_symbol(const irep_idt &name, const codet &code)
Definition: call_graph_test_utils.cpp:14
symbolt::name
irep_idt name
The unique identifier.
Definition: symbol.h:40
multimap_key_matches
bool multimap_key_matches(const std::multimap< irep_idt, irep_idt > &map, const irep_idt &key, const std::set< irep_idt > &values)
Definition: call_graph_test_utils.cpp:25
codet
Data structure for representing an arbitrary statement in a program.
Definition: std_code_base.h:28