cprover
ci_lazy_methods.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Context-insensitive lazy methods container
4 
5 Author: Chris Smowton, chris.smowton@diffblue.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_JAVA_BYTECODE_CI_LAZY_METHODS_H
13 #define CPROVER_JAVA_BYTECODE_CI_LAZY_METHODS_H
14 
15 #include <vector>
16 #include <set>
17 #include <util/symbol_table.h>
18 
20 {
21 public:
23  std::vector<irep_idt> &_needed_methods,
24  std::set<irep_idt> &_needed_classes,
25  symbol_tablet &_symbol_table):
26  needed_methods(_needed_methods),
27  needed_classes(_needed_classes),
28  symbol_table(_symbol_table)
29  {}
30 
31  void add_needed_method(const irep_idt &);
32  // Returns true if new
33  bool add_needed_class(const irep_idt &);
34 
35 private:
36  // needed_methods is a vector because it's used as a work-list
37  // which is periodically cleared. It can't be relied upon to
38  // contain all methods that have previously been elaborated.
39  // It should be changed to a set if we develop the need to use
40  // it that way.
41  std::vector<irep_idt> &needed_methods;
42  // needed_classes on the other hand is a true set of every class
43  // found so far, so we can use a membership test to avoid
44  // repeatedly exploring a class hierarchy.
45  std::set<irep_idt> &needed_classes;
47 };
48 
49 #endif
bool add_needed_class(const irep_idt &)
Notes class class_symbol_name will be instantiated, or a static field belonging to it will be accesse...
void add_needed_method(const irep_idt &)
Notes method_symbol_name is referenced from some reachable function, and should therefore be elaborat...
ci_lazy_methodst(std::vector< irep_idt > &_needed_methods, std::set< irep_idt > &_needed_classes, symbol_tablet &_symbol_table)
symbol_tablet & symbol_table
std::vector< irep_idt > & needed_methods
The symbol table.
Definition: symbol_table.h:52
Symbol table.
std::set< irep_idt > & needed_classes