Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

procedureDB Class Reference

Database of procedures. More...

#include <proceduredb.h>

Inheritance diagram for procedureDB::

Walker List of all members.

Public Methods

 procedureDB ()
 Create a new procedureDB. More...

 ~procedureDB ()
 Destroy the procedure database. More...

void build (procNode *root, Linker &linker)
 Build database. More...

void clear ()
 Clear. More...

void add_procedure (procNode *proc)
 Add a procedure to the database. More...

procedureInfolookup (procNode *proc)
 Lookup procedure-specific information. More...

void setup_analysis ()
 Set up analysis. More...

bool is_in_scope (procedureInfo *info, memoryBlock *block)
 Is variable in scope. More...

void mark_for_reanalysis (procedureInfo *info)
 Mark procedure for reanalysis. More...

bool is_reanalysis_required (procedureInfo *info)
 Has reanalysis been forced? More...

int times_called (procedureInfo *info)
 Times called. More...

void stats (ostream &out)
 Print some statistics. More...

int size () const
 Return the number of procedures. More...


Static Public Attributes

bool _debug = false

Private Attributes

proc_info_map _procedures
 All procedures. More...

callGraph_callgraph
 Call graph. More...

procedureInfo::procedure_set _need_reanalysis
 Need reanalysis. More...


Detailed Description

Database of procedures.

This class holds all of the procedureInfo instances. It also contains an instance of the Linker class, which connects up declarations across translation units. We also use it to look up procNodes given their declarations.


Constructor & Destructor Documentation

procedureDB::procedureDB  
 

Create a new procedureDB.

The constructor does not create the database

procedureDB::~procedureDB  
 

Destroy the procedure database.


Member Function Documentation

void procedureDB::add_procedure procNode   proc
 

Add a procedure to the database.

void procedureDB::build procNode   root,
Linker   linker
 

Build database.

This method first visits all the procedures currently parsed and builds a procedureInfo object for each. It uses the Linker object, which has already traversed the entire system and fixed the linkages between symbol references and externally defined symbols.

void procedureDB::clear  
 

Clear.

Remove all procedureInfo objects and delete them.

bool procedureDB::is_in_scope procedureInfo   info,
memoryBlock   block
 

Is variable in scope.

Check to see if the variable is accessible in the given procedure. We do this by seeing if it is local in this procedure, or any of the possible callers of this procedure.

bool procedureDB::is_reanalysis_required procedureInfo   info
 

Has reanalysis been forced?

At a procedure call, check to see if this particular procedure is on the _needs_reanalysis list, indicating that we cannot skip analyzing it, even if the inputs appear not to have changed.

procedureInfo * procedureDB::lookup procNode   proc
 

Lookup procedure-specific information.

void procedureDB::mark_for_reanalysis procedureInfo   info
 

Mark procedure for reanalysis.

Record that particular procedure needs to be reanalyzed. Add all of it's ancestors to the list as well to ensure that we actually reach it again.

void procedureDB::setup_analysis  
 

Set up analysis.

Add all procedures to the _needs_analysis list.

int procedureDB::size   const [inline]
 

Return the number of procedures.

void procedureDB::stats ostream &    out
 

Print some statistics.

int procedureDB::times_called procedureInfo   info
 

Times called.

Use the callgraph to estimate the number of paths from main down to the given procedure. We'll use this to decide when to make a procedure context insensitive. The basic heuristic is that if a procedure is small, and called in many places, then leave it context sensitive.


Member Data Documentation

callGraph* procedureDB::_callgraph [private]
 

Call graph.

bool procedureDB::_debug = false [static]
 

procedureInfo::procedure_set procedureDB::_need_reanalysis [private]
 

Need reanalysis.

In context-insensitive mode, we may need to revisit procedures because of changes in other calling contexts. Whenever a non-local change occurs, we add the procedure and all of it's ancestors back on this list. This ensures that we will revisit the procedure at some point.

proc_info_map procedureDB::_procedures [private]
 

All procedures.

A mapping from procedure definitions to procedure info objects


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 12:06:32 2002 for C-Breeze by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001