C-Breeze
C Compiler Infrastructure

[ Project home page]

procedureDB Class Reference

Database of procedures. More...

#include <proceduredb.h>

Inheritance diagram for procedureDB:

Walker List of all members.

Public Types

enum  Order { Preorder, Postorder, Both }
 The order in which AST Nodes should be visited. More...
enum  Depth { Subtree, NodeOnly }
 Which Nodes in the AST tree should be visited. More...

Public Member Functions

 procedureDB ()
 Create a new procedureDB.
 ~procedureDB ()
 Destroy the procedure database.
void build (procNode *root, Linker &linker)
 Build database.
void clear ()
 Clear.
void add_procedure (procNode *proc)
 Add a procedure to the database.
procedureInfolookup (procNode *proc)
 Lookup procedure-specific information.
const procedurecall_stackcallstack () const
 Call stack.
bool is_recursive_call (procedureInfo *callee, int &num_instances)
 Is recursive call?
void setup_analysis ()
 Set up analysis.
procedureInfonext_procedure_on_worklist ()
 Next procedure.
bool is_procedure_on_worklist (procedureInfo *info)
 Is procedure on the worklist?
void add_procedure_to_worklist (procedureInfo *info)
 Add a procedure to the worklist.
void call_to (stmtLocation *callsite, procedureInfo *callee)
 Call a procedure.
void return_from ()
 Return from a procedure.
bool is_visible_to_caller (procedureInfo *info, memoryBlock *block)
 Is variable in the caller's scope.
bool is_visible_to (procedureInfo *info, memoryBlock *block)
 Is variable visible?
stmtLocationcurrent_callsite ()
 Return the current callsite.
procedureInfocurrent_caller ()
 Return the current caller.
void clear_call_stack ()
 Clear the call stack.
void print_call_stack (ostream &out)
 Print call stack.
void progress_meter (ostream &out)
 Progress meter.
void mark_for_reanalysis (procedureInfo *info, stmtLocation *callsite, bool include_self)
 Mark procedure for reanalysis.
void mark_one_for_reanalysis (procedureInfo *info)
 Mark one procedure for reanalysis.
bool is_reanalysis_required (procedureInfo *info)
 Has reanalysis been forced?
void print_leftovers ()
 Print left-overs.
int times_called (procedureInfo *info)
 Times called.
void stats (ostream &out)
 Print some statistics.
int size () const
 Return the number of procedures.
void number_of_procedures (int &total, int &analyzed, int &context_insensitive, int &recursive, int &unanalyzed, int &program_size)
 Get the number of procedures.
proc_info_map procedures () const
 Return all the procedures.
Accessors
Methods to get and set fields in the class.

Order order () const
 Return the order in which Nodes of an AST should be visited.
Depth depth () const
 Return which Nodes of an AST should be visited.
"at_" methods
These methods define the functions that should be performed when different classes of Nodes are encountered in the AST. The most specific "at_" method that matches a given Node's class will be called.

virtual void at_node (Node *the_node, Order ord)
virtual void at_unit (unitNode *the_unit, Order ord)
virtual void at_def (defNode *the_def, Order ord)
virtual void at_decl (declNode *the_decl, Order ord)
virtual void at_subdecl (subdeclNode *the_subdecl, Order ord)
virtual void at_proc (procNode *the_proc, Order ord)
virtual void at_type (typeNode *the_type, Order ord)
virtual void at_prim (primNode *the_prim, Order ord)
virtual void at_tdef (tdefNode *the_tdef, Order ord)
virtual void at_ptr (ptrNode *the_ptr, Order ord)
virtual void at_array (arrayNode *the_array, Order ord)
virtual void at_func (funcNode *the_func, Order ord)
virtual void at_sue (sueNode *the_sue, Order ord)
virtual void at_struct (structNode *the_struct, Order ord)
virtual void at_union (unionNode *the_union, Order ord)
virtual void at_enum (enumNode *the_enum, Order ord)
virtual void at_suespec (suespecNode *the_suespec, Order ord)
virtual void at_expr (exprNode *the_expr, Order ord)
virtual void at_index (indexNode *the_index, Order ord)
virtual void at_const (constNode *the_const, Order ord)
virtual void at_id (idNode *the_id, Order ord)
virtual void at_binary (binaryNode *the_binary, Order ord)
virtual void at_unary (unaryNode *the_unary, Order ord)
virtual void at_cast (castNode *the_cast, Order ord)
virtual void at_comma (commaNode *the_comma, Order ord)
virtual void at_ternary (ternaryNode *the_ternary, Order ord)
virtual void at_call (callNode *the_call, Order ord)
virtual void at_initializer (initializerNode *the_initializer, Order ord)
virtual void at_stmt (stmtNode *the_stmt, Order ord)
virtual void at_block (blockNode *the_block, Order ord)
virtual void at_basicblock (basicblockNode *the_basicblock, Order ord)
virtual void at_exprstmt (exprstmtNode *the_exprstmt, Order ord)
virtual void at_target (targetNode *the_target, Order ord)
virtual void at_label (labelNode *the_label, Order ord)
virtual void at_case (caseNode *the_case, Order ord)
virtual void at_selection (selectionNode *the_selection, Order ord)
virtual void at_if (ifNode *the_if, Order ord)
virtual void at_switch (switchNode *the_switch, Order ord)
virtual void at_loop (loopNode *the_loop, Order ord)
virtual void at_while (whileNode *the_while, Order ord)
virtual void at_do (doNode *the_do, Order ord)
virtual void at_for (forNode *the_for, Order ord)
virtual void at_jump (jumpNode *the_jump, Order ord)
virtual void at_goto (gotoNode *the_goto, Order ord)
virtual void at_continue (continueNode *the_continue, Order ord)
virtual void at_break (breakNode *the_break, Order ord)
virtual void at_return (returnNode *the_return, Order ord)
virtual void at_attrib (attribNode *the_attrib, Order ord)
virtual void at_operand (operandNode *the_oper, Order ord)
virtual void at_conditiongoto (conditiongotoNode *the_condgoto, Order ord)
virtual void at_threeAddr (threeAddrNode *the_3addr, Order ord)
virtual void at_text (textNode *the_text, Order ord)

Private Attributes

proc_info_map _procedures
 All procedures.
callGraph_callgraph
 Call graph.
procedureinfo_set _need_reanalysis
 Need reanalysis.
procedureInfo_root
 Root procedure.
procedurecall_stack _callstack
 Call stack.
proc_info_list _worklist
 Procedure worklist.

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.

Definition at line 870 of file proceduredb.h.


Member Enumeration Documentation

enum Walker::Depth [inherited]
 

Which Nodes in the AST tree should be visited.

Enumeration values:
Subtree  The entire AST should be traversed.
NodeOnly  Only the root Node should be visited.

Definition at line 155 of file walker.h.

enum Walker::Order [inherited]
 

The order in which AST Nodes should be visited.

Enumeration values:
Preorder  Nodes should be visited before their children.
Postorder  Nodes should be visited after their children.
Both  Nodes should be visited both before and after their children.

Definition at line 147 of file walker.h.


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::add_procedure_to_worklist procedureInfo info  ) 
 

Add a procedure to the worklist.

virtual void Walker::at_array arrayNode the_array,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 254 of file walker.h.

References Walker::at_type().

virtual void Walker::at_attrib attribNode the_attrib,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 365 of file walker.h.

References Walker::at_stmt().

virtual void Walker::at_basicblock basicblockNode the_basicblock,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker, LivenessWalker, LivenessComments, and reachingDefinitionsWalker.

Definition at line 314 of file walker.h.

References Walker::at_block().

virtual void Walker::at_binary binaryNode the_binary,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in gcWalker, id_lookup_walker, TreeChecker, and print_walker.

Definition at line 287 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_block blockNode the_block,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in scope_walker, and print_walker.

Definition at line 311 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_basicblock().

virtual void Walker::at_break breakNode the_break,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in ref_fix_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 359 of file walker.h.

References Walker::at_jump().

virtual void Walker::at_call callNode the_call,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in id_lookup_walker, Linker, ref_fix_walker, TreeChecker, and print_walker.

Definition at line 302 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_case caseNode the_case,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in ref_fix_walker, semcheck_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 326 of file walker.h.

References Walker::at_target().

virtual void Walker::at_cast castNode the_cast,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 293 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_comma commaNode the_comma,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 296 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_conditiongoto conditiongotoNode the_condgoto,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, print_walker, LivenessWalker, and LivenessComments.

Definition at line 371 of file walker.h.

References Walker::at_goto().

virtual void Walker::at_const constNode the_const,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 281 of file walker.h.

References Walker::at_index().

virtual void Walker::at_continue continueNode the_continue,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in ref_fix_walker, set_container_walker, TreeChecker, and print_walker.

Definition at line 356 of file walker.h.

References Walker::at_jump().

virtual void Walker::at_decl declNode the_decl,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in id_lookup_walker, name_mangle_walker, semcheck_walker, TreeChecker, ProcWalker, print_walker, has_struct_walker, and UnificationBasedPtr.

Definition at line 233 of file walker.h.

References Walker::at_def().

Referenced by Walker::at_subdecl().

virtual void Walker::at_def defNode the_def,
Order  ord
[inline, virtual, inherited]
 

Definition at line 230 of file walker.h.

References Walker::at_node().

Referenced by Walker::at_decl(), and Walker::at_proc().

virtual void Walker::at_do doNode the_do,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 344 of file walker.h.

References Walker::at_loop().

virtual void Walker::at_enum enumNode the_enum,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in enum_value_walker, and id_lookup_walker.

Definition at line 269 of file walker.h.

References Walker::at_sue().

virtual void Walker::at_expr exprNode the_expr,
Order  ord
[inline, virtual, inherited]
 

Definition at line 275 of file walker.h.

References Walker::at_node().

Referenced by Walker::at_binary(), Walker::at_call(), Walker::at_cast(), Walker::at_comma(), Walker::at_index(), Walker::at_initializer(), Walker::at_operand(), Walker::at_ternary(), and Walker::at_unary().

virtual void Walker::at_exprstmt exprstmtNode the_exprstmt,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in semcheck_walker, and print_walker.

Definition at line 317 of file walker.h.

References Walker::at_stmt().

virtual void Walker::at_for forNode the_for,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in semcheck_walker, TreeChecker, and print_walker.

Definition at line 347 of file walker.h.

References Walker::at_loop().

virtual void Walker::at_func funcNode the_func,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in scope_walker, TreeChecker, print_walker, and has_struct_walker.

Definition at line 257 of file walker.h.

References Walker::at_type().

virtual void Walker::at_goto gotoNode the_goto,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in goto_label_walker, fix_goto_walker, ref_fix_walker, TreeChecker, ProcWalker, and print_walker.

Definition at line 353 of file walker.h.

References Walker::at_jump().

Referenced by Walker::at_conditiongoto().

virtual void Walker::at_id idNode the_id,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in callGraph, id_lookup_walker, Linker, name_mangle_walker, ref_fix_walker, TreeChecker, and print_walker.

Definition at line 284 of file walker.h.

References Walker::at_index().

virtual void Walker::at_if ifNode the_if,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 332 of file walker.h.

References Walker::at_selection().

virtual void Walker::at_index indexNode the_index,
Order  ord
[inline, virtual, inherited]
 

Definition at line 278 of file walker.h.

References Walker::at_expr().

Referenced by Walker::at_const(), and Walker::at_id().

virtual void Walker::at_initializer initializerNode the_initializer,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 305 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_jump jumpNode the_jump,
Order  ord
[inline, virtual, inherited]
 

Definition at line 350 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_break(), Walker::at_continue(), Walker::at_goto(), and Walker::at_return().

virtual void Walker::at_label labelNode the_label,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in goto_label_walker, name_mangle_walker, TreeChecker, ProcWalker, and print_walker.

Definition at line 323 of file walker.h.

References Walker::at_target().

virtual void Walker::at_loop loopNode the_loop,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in semcheck_walker, set_container_walker, TreeChecker, and init_flowproblem_walker.

Definition at line 338 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_do(), Walker::at_for(), and Walker::at_while().

virtual void Walker::at_node Node the_node,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in gcWalker, goto_label_walker, set_container_walker, sue_complete_walker, TreeChecker, and df_number_walker.

Definition at line 223 of file walker.h.

Referenced by Walker::at_def(), Walker::at_expr(), Walker::at_stmt(), Walker::at_text(), Walker::at_type(), and Walker::at_unit().

virtual void Walker::at_operand operandNode the_oper,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 368 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_prim primNode the_prim,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 245 of file walker.h.

References Walker::at_type().

virtual void Walker::at_proc procNode the_proc,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in vcgWalker, id_lookup_walker, name_mangle_walker, ref_fix_walker, scope_walker, set_container_walker, TreeChecker, UnitWalker, print_walker, init_flowproblem_walker, LivenessWalker, LivenessComments, reachingDefinitionsWalker, and UnificationBasedPtr.

Definition at line 239 of file walker.h.

References Walker::at_def().

virtual void Walker::at_ptr ptrNode the_ptr,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 251 of file walker.h.

References Walker::at_type().

virtual void Walker::at_return returnNode the_return,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in ref_fix_walker, semcheck_walker, set_container_walker, TreeChecker, print_walker, LivenessWalker, and LivenessComments.

Definition at line 362 of file walker.h.

References Walker::at_jump().

virtual void Walker::at_selection selectionNode the_selection,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in semcheck_walker.

Definition at line 329 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_if(), and Walker::at_switch().

virtual void Walker::at_stmt stmtNode the_stmt,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in init_flowproblem_walker, and LivenessWalker.

Definition at line 308 of file walker.h.

References Walker::at_node().

Referenced by Walker::at_attrib(), Walker::at_block(), Walker::at_exprstmt(), Walker::at_jump(), Walker::at_loop(), Walker::at_selection(), Walker::at_target(), and Walker::at_threeAddr().

virtual void Walker::at_struct structNode the_struct,
Order  ord
[inline, virtual, inherited]
 

Definition at line 263 of file walker.h.

References Walker::at_sue().

virtual void Walker::at_subdecl subdeclNode the_subdecl,
Order  ord
[inline, virtual, inherited]
 

Definition at line 236 of file walker.h.

References Walker::at_decl().

virtual void Walker::at_sue sueNode the_sue,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in id_lookup_walker, print_walker, and has_struct_walker.

Definition at line 260 of file walker.h.

References Walker::at_type().

Referenced by Walker::at_enum(), Walker::at_struct(), and Walker::at_union().

virtual void Walker::at_suespec suespecNode the_suespec,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in scope_walker, semcheck_walker, sue_complete_walker, print_walker, and UnificationBasedPtr.

Definition at line 272 of file walker.h.

References Walker::at_type().

virtual void Walker::at_switch switchNode the_switch,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in set_container_walker, TreeChecker, ProcWalker, print_walker, and init_flowproblem_walker.

Definition at line 335 of file walker.h.

References Walker::at_selection().

virtual void Walker::at_target targetNode the_target,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in init_flowproblem_walker.

Definition at line 320 of file walker.h.

References Walker::at_stmt().

Referenced by Walker::at_case(), and Walker::at_label().

virtual void Walker::at_tdef tdefNode the_tdef,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in id_lookup_walker, ref_fix_walker, TreeChecker, and print_walker.

Definition at line 248 of file walker.h.

References Walker::at_type().

virtual void Walker::at_ternary ternaryNode the_ternary,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 299 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_text textNode the_text,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 377 of file walker.h.

References Walker::at_node().

virtual void Walker::at_threeAddr threeAddrNode the_3addr,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in Linker, TreeChecker, print_walker, LivenessWalker, LivenessComments, and UnificationBasedPtr.

Definition at line 374 of file walker.h.

References Walker::at_stmt().

virtual void Walker::at_type typeNode the_type,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker.

Definition at line 242 of file walker.h.

References Walker::at_node().

Referenced by Walker::at_array(), Walker::at_func(), Walker::at_prim(), Walker::at_ptr(), Walker::at_sue(), Walker::at_suespec(), and Walker::at_tdef().

virtual void Walker::at_unary unaryNode the_unary,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in TreeChecker, and print_walker.

Definition at line 290 of file walker.h.

References Walker::at_expr().

virtual void Walker::at_union unionNode the_union,
Order  ord
[inline, virtual, inherited]
 

Definition at line 266 of file walker.h.

References Walker::at_sue().

virtual void Walker::at_unit unitNode the_unit,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in gcWalker, TreeChecker, print_walker, and UnificationBasedPtr.

Definition at line 227 of file walker.h.

References Walker::at_node().

virtual void Walker::at_while whileNode the_while,
Order  ord
[inline, virtual, inherited]
 

Reimplemented in print_walker.

Definition at line 341 of file walker.h.

References Walker::at_loop().

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::call_to stmtLocation callsite,
procedureInfo callee
 

Call a procedure.

This method is called when analysis is entering a new procedure. It pushes the procedure on the stack and sets up the procedure for analysis.

const procedurecall_stack& procedureDB::callstack  )  const [inline]
 

Call stack.

Return a const reference to the call stack.

Definition at line 950 of file proceduredb.h.

References _callstack.

void procedureDB::clear  ) 
 

Clear.

Remove all procedureInfo objects and delete them.

void procedureDB::clear_call_stack  ) 
 

Clear the call stack.

WARNING: Only use this routine at the end of an analysis pass.

procedureInfo* procedureDB::current_caller  ) 
 

Return the current caller.

Return the caller of the current procedure in the call stack.

stmtLocation* procedureDB::current_callsite  )  [inline]
 

Return the current callsite.

Definition at line 1018 of file proceduredb.h.

References _callstack.

Depth Walker::depth  )  const [inline, inherited]
 

Return which Nodes of an AST should be visited.

A value of SubTree specifies that the entire AST should be traversed. A value of NodeOnly specifies that only the root Node in the AST should be visited.

Definition at line 211 of file walker.h.

References Walker::_depth.

bool procedureDB::is_procedure_on_worklist procedureInfo info  ) 
 

Is procedure on the worklist?

If so, remove it and return true.

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.

bool procedureDB::is_recursive_call procedureInfo callee,
int &  num_instances
 

Is recursive call?

Return true if calling the given procedure would create a recursive cycle in the call stack.

bool procedureDB::is_visible_to procedureInfo info,
memoryBlock block
 

Is variable visible?

Check to see if the given variable could be accessed in the given procedure, or in any of its ancestors in the callgraph. If it is, then we need to pass it as an external output.

bool procedureDB::is_visible_to_caller procedureInfo info,
memoryBlock block
 

Is variable in the caller's scope.

Check to see if the variable is visible to procedures earlier in the call stack.

procedureInfo* procedureDB::lookup procNode proc  ) 
 

Lookup procedure-specific information.

void procedureDB::mark_for_reanalysis procedureInfo info,
stmtLocation callsite,
bool  include_self
 

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. This method does not add the given procedure itself unless the include_self flag is true.

void procedureDB::mark_one_for_reanalysis procedureInfo info  ) 
 

Mark one procedure for reanalysis.

Add the given procedure to the list of those needing reanalysis.

procedureInfo* procedureDB::next_procedure_on_worklist  ) 
 

Next procedure.

Grab the next procedure from the work-list.

void procedureDB::number_of_procedures int &  total,
int &  analyzed,
int &  context_insensitive,
int &  recursive,
int &  unanalyzed,
int &  program_size
 

Get the number of procedures.

This version only counts procedures that have been analyzed.

Order Walker::order  )  const [inline, inherited]
 

Return the order in which Nodes of an AST should be visited.

Nodes can be visited before their children (Preorder), after their children (Postorder), or both (Both).

Definition at line 203 of file walker.h.

References Walker::_order.

Referenced by df_number_walker::at_node().

void procedureDB::print_call_stack ostream &  out  ) 
 

Print call stack.

void procedureDB::print_leftovers  ) 
 

Print left-overs.

proc_info_map procedureDB::procedures  )  const [inline]
 

Return all the procedures.

Definition at line 1098 of file proceduredb.h.

References _procedures.

Referenced by Pointers::procedures().

void procedureDB::progress_meter ostream &  out  ) 
 

Progress meter.

void procedureDB::return_from  ) 
 

Return from a procedure.

This method is called when analysis of a procedure is complete. It just pops the current procedure off the stack.

void procedureDB::setup_analysis  ) 
 

Set up analysis.

Add all procedures to the _needs_analysis list.

int procedureDB::size void   )  const [inline]
 

Return the number of procedures.

Definition at line 1084 of file proceduredb.h.

References _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.

Definition at line 882 of file proceduredb.h.

procedurecall_stack procedureDB::_callstack [private]
 

Call stack.

Maintain a call stack during interprocedural analysis. Each entry consists of a callsite and a called procedure.

Definition at line 902 of file proceduredb.h.

Referenced by callstack(), and current_callsite().

procedureinfo_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.

Definition at line 891 of file proceduredb.h.

proc_info_map procedureDB::_procedures [private]
 

All procedures.

A mapping from procedure definitions to procedure info objects

Definition at line 878 of file proceduredb.h.

Referenced by procedures(), and size().

procedureInfo* procedureDB::_root [private]
 

Root procedure.

Definition at line 895 of file proceduredb.h.

proc_info_list procedureDB::_worklist [private]
 

Procedure worklist.

Definition at line 908 of file proceduredb.h.


The documentation for this class was generated from the following file:

Generated on February 1, 2006
Back to the C-Breeze home page