cprover
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 symbolt
12 create_void_function_symbol(const irep_idt &name, const codet &code)
13 {
14  const code_typet void_function_type({}, empty_typet());
15  symbolt function;
16  function.name = name;
17  function.type = void_function_type;
18  function.mode = ID_java;
19  function.value = code;
20  return function;
21 }
22 
24  const std::multimap<irep_idt, irep_idt> &map,
25  const irep_idt &key,
26  const std::set<irep_idt> &values)
27 {
28  auto matching_values = map.equal_range(key);
29  std::set<irep_idt> matching_set;
30  for(auto it = matching_values.first; it != matching_values.second; ++it)
31  matching_set.insert(it->second);
32  return matching_set == values;
33 }
irep_idt name
The unique identifier.
Definition: symbol.h:43
Base type of functions.
Definition: std_types.h:764
symbolt create_void_function_symbol(const irep_idt &name, const codet &code)
bool multimap_key_matches(const std::multimap< irep_idt, irep_idt > &map, const irep_idt &key, const std::set< irep_idt > &values)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
Definition: symbol.h:30
The empty type.
Definition: std_types.h:54
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
Definition: dstring.h:33
A statement in a programming language.
Definition: std_code.h:21