C-Breeze
C Compiler Infrastructure

[ Project home page]

procedureInfo Class Reference

Procedure information. More...

#include <proceduredb.h>

List of all members.

Public Types

typedef map< basicblockNode *,
int > 
worklist_order_map
typedef worklist_order_map::iterator worklist_order_map_p
typedef map< stmtLocation *,
procedureInfo * > 
callsite_map
typedef callsite_map::iterator callsite_map_p
typedef callsite_map::const_iterator callsite_map_cp
typedef map< basicblockLocation *,
memoryblock_set
mergepoint_map
typedef mergepoint_map::iterator mergepoint_map_p
typedef map< stmtLocation *,
memoryblock_set
callsite_changes_map
typedef callsite_changes_map::iterator callsite_changes_map_p
typedef map< procedureInfo *,
int > 
proc_int_map
typedef proc_int_map::iterator proc_int_map_p

Public Member Functions

DFPredsdominance_frontiers () const
 Return the dominance frontiers.
 procedureInfo (procNode *the_proc)
 Create a procedureInfo object for a procedure.
 ~procedureInfo ()
 Destroy a procedureInfo object.
void add_one_ancestor (procedureInfo *ancestor)
 Add one ancestor.
void add_ancestor_set (procedureinfo_set &ancestors)
 Add ancestor set.
void setup_call_at (procedureInfo *caller, stmtLocation *callsite, bool is_recursive_call, bool multiple_target_call)
 Call the procedure.
procNodeproc () const
 Return from the procedureGet the procedure.
string & name ()
 Get the procedure name.
string qualified_name ()
 Qualified name.
const procedureinfo_setancestors () const
 Set of ancestors.
const procedureinfo_setcalls () const
 Return the calls.
const callsite_mapcallsites () const
 Return the set of callsites.
procedureInfofirst_caller () const
 Return the first caller.
bool is_recursive () const
 Is procedure recursive?
void set_recursive ()
 Set recursive flag.
declNodereturn_variable () const
 Return variable.
memoryBlockreturn_block () const
 Return block.
void return_block (memoryBlock *r)
 Set return block.
returnNodereturn_stmt () const
 Return statment.
bool never_returns () const
 Test never returns flag.
void set_never_returns ()
 Set never returns flag.
void set_pending_changes (stmtLocation *callsite, memoryblock_set &changes)
 Set pending changes.
void get_pending_changes (stmtLocation *callsite, memoryblock_set &changes)
 Get pending changes.
procedureInfocaller_at (stmtLocation *callsite)
 Return the current callsiteReturn the current callerReturn the caller.
bool is_ancestor (procedureInfo *other)
 Is ancestor?
procLocationprocedure_location (stmtLocation *callsite)
 Get the procedure location.
int analysis_count () const
 Get the analysis count.
void incr_analysis_count ()
 Increment analysis count.
bool is_verbose () const
 Is verbose?
bool is_library_routine ()
 Is library routine?
void print (ostream &out)
 Output.
void stats (ostream &out)
 Stats.
int count_calling_contexts ()
 Count contexts.
int procedure_size ()
 Procedure size.
void start_self_timer ()
 Start the self timer.
void stop_self_timer ()
 Stop the self timer.
double self_timer ()
 Return the self time.
void start_total_timer ()
 Start the total timer.
void stop_total_timer ()
 Stop the total timer.
double total_timer ()
 Return the total time.
void update_cg_statistics_call (procedureInfo *callee)
void update_cg_statistics_return (procedureInfo *callee)
void get_cg_statistics (int &cg_depth_min, int &cg_depth_max, int &cg_height_min, int &cg_height_max)
Context insensitivity
bool is_context_insensitive () const
 Is context-insensitive.
bool prefer_context_sensitive () const
 Do we prefer context sensitive?
void set_prefer_context_sensitive ()
 Set context-sensitivity preference.
procLocationget_context () const
 Get context-insensitive.
Merge-point management
void setup_merge_point (memoryBlock *block_to_merge, basicblockLocation *cur)
 Set up merge points.
memoryblock_setlookup_merge_point (basicblockLocation *where)
 Lookup a merge point.
void check_merge_point (memoryBlock *block_to_merge, basicblockLocation *cur)
 Check merge point.
External input and output management
Manage external inputs and outputs when working in context-insensitive mode.

const memoryblock_setexternal_inputs () const
 Get external inputs.
const memoryblock_setexternal_outputs () const
 Get external outputs.
bool add_external_input (memoryBlock *block)
 Add an external input.
bool add_external_output (memoryBlock *block)
 Add an external output.
void record_input_to_value (memoryBlock *block, stmtLocation *loc, memoryblock_set points_to)
 Record points-to set of input blocks to this procedure.
memoryblock_set input_to_value (memoryBlock *block) const
 Get recorded points-to set of input blocks to this procedure.
memoryblock_set input_to_value (memoryBlock *block, stmtLocation *loc) const
 Get recorded points-to set of input blocks to this procedure, for a particular site.
Worklist management
basicblockNodeget_next_block (Direction dir)
 Get the next block on the worklist.
void add_block (basicblockNode *block, Direction dir)
 Add a block to the worklist.
void add_reachable_blocks (basicblockNode *block, Direction dir)
 Add all reachable blocks to the worklist.
void add_all_blocks ()
 Add all blocks.
void add_start_block (Direction dir)
 Add the start node.
bool is_empty () const
 Test for empty worklist.
void remove_branch_blocks (basicblockNode *cond, basicblockNode *branch_taken, basicblockNode *branch_not_taken)
 Remove branch.
void update_conditional_worklist (basicblockNode *block, bool has_truth_value, bool which_branch)
 Conditional worklist algorithm.
cfg_edge_setactive_edges ()
 Active edges.

Private Types

typedef pair< memoryBlock *,
stmtLocation * > 
block_loc_pair
typedef map< basicblockNode *,
basicblockNode * > 
true_branch_map
 True branches.
typedef true_branch_map::iterator true_branch_map_p

Private Member Functions

int count_calling_contexts_rec (proc_int_map &count, stmtNode *callsite)
 Count contexts.
void reverse_post_order (Direction dir, basicblockNode *cur, basicblock_set &visited, basicblock_list &order)
 Compute a reverse post-ordering of the basic blocks.
void dfs_dominators (Direction dir, basicblockNode *cur, basicblock_set &visited, basicblock_list &order, basicblock_list &rpo_order)
 Alternative ordering.
int block_position (basicblockNode *block, Direction dir)
basicblockNodeblock_at (int position, Direction dir)
void add_reachable_blocks_rec (Direction dir, basicblockNode *cur, worklist_set &temp, bool first)

Private Attributes

procNode_proc
 A pointer to the procedure definition.
workList _worklist
 The worklist of basic blocks.
worklist_order_map _forward_worklist_order
 The forward ordering of basic blocks in the worklist.
vector< basicblockNode * > _forward_basicblock_order
 The forward enumeration of basic blocks.
worklist_order_map _backward_worklist_order
 The backward ordering of basic blocks in the worklist.
vector< basicblockNode * > _backward_basicblock_order
 The backward enumeration of basic blocks.
mergepoint_map _merge_points
 Merge points.
DFPreds_dominance_frontiers
 Dominance frontiers.
loopTree_loops
 Loop tree.
callsite_map _callsites
 Call sites.
declNode_return_variable
 Return value variable.
memoryBlock_return_block
 Block for return value variable.
returnNode_return_stmt
 Return statement.
bool _never_returns
 Never returns.
callsite_changes_map _pending_changes
 Pending changes.
bool _context_insensitive
 Current call siteContext insensitive.
bool _prefer_context_sensitive
 Prefer context sensitive.
TREE procLocation_only_context
 Only context.
memoryblock_set _external_inputs
 External inputs.
memoryblock_set _external_outputs
 External outputs.
map< memoryBlock *, memoryblock_set_input_values
 Points-to set of input blocks to this procedure.
map< block_loc_pair, memoryblock_set_input_site_values
 Points-to set of input blocks to this procedure, for a particular callsite. Used by adaptor.
procedureinfo_set _ancestors
 Ancestors.
procedureinfo_set _decestors
 Ancestors.
procedureInfo_first_caller
 First caller.
procedureinfo_set _calls
 Called procedures.
bool _is_recursive
 Called recursively.
basicblock_set _blocks_to_skip
 Blocks to skip.
cfg_edge_set _active_edges
 Active edges.
true_branch_map _true_branches
int _analysis_count
 Analysis count.
bool _verbose
 Verbose.
cbzTimer _self_timer
 Self timer.
cbzTimer _total_timer
 Total timer.
int _cg_depth_min
 Depth in call graph.
int _cg_depth_max
 Depth in call graph.
int _cg_height_min
 Height in call graph to a leaf.
int _cg_height_max
 Height in call graph to a leaf.


Detailed Description

Procedure information.

This class holds information about a single procedure definition, including:

_unit : the unit in which it is defined _worklist_order : the best ordering of its basic blocks for the worklist _dominance_frontiers : the precomputed dominance frontiers _callsites : the set of places this procedure is called

At the start of analysis, only the first two fields are filled. When a procedure is actually encountered during analysis, then the worklist order and dominance frontiers are computed.

Definition at line 76 of file proceduredb.h.


Member Typedef Documentation

typedef pair<memoryBlock*,stmtLocation*> procedureInfo::block_loc_pair [private]
 

Definition at line 276 of file proceduredb.h.

typedef map< stmtLocation *, memoryblock_set> procedureInfo::callsite_changes_map
 

Definition at line 94 of file proceduredb.h.

typedef callsite_changes_map::iterator procedureInfo::callsite_changes_map_p
 

Definition at line 95 of file proceduredb.h.

typedef map< stmtLocation *, procedureInfo *> procedureInfo::callsite_map
 

Definition at line 85 of file proceduredb.h.

typedef callsite_map::const_iterator procedureInfo::callsite_map_cp
 

Definition at line 87 of file proceduredb.h.

typedef callsite_map::iterator procedureInfo::callsite_map_p
 

Definition at line 86 of file proceduredb.h.

typedef map< basicblockLocation *, memoryblock_set > procedureInfo::mergepoint_map
 

Definition at line 89 of file proceduredb.h.

typedef mergepoint_map::iterator procedureInfo::mergepoint_map_p
 

Definition at line 90 of file proceduredb.h.

typedef map< procedureInfo *, int > procedureInfo::proc_int_map
 

Definition at line 99 of file proceduredb.h.

typedef proc_int_map::iterator procedureInfo::proc_int_map_p
 

Definition at line 100 of file proceduredb.h.

typedef map< basicblockNode *, basicblockNode * > procedureInfo::true_branch_map [private]
 

True branches.

This sucks: keep a mapping from conditionals to the true branches. Apparently there is no convention in the dismantler/cfg.

Definition at line 327 of file proceduredb.h.

typedef true_branch_map::iterator procedureInfo::true_branch_map_p [private]
 

Definition at line 328 of file proceduredb.h.

typedef map< basicblockNode *, int > procedureInfo::worklist_order_map
 

Definition at line 80 of file proceduredb.h.

typedef worklist_order_map::iterator procedureInfo::worklist_order_map_p
 

Definition at line 81 of file proceduredb.h.


Constructor & Destructor Documentation

procedureInfo::procedureInfo procNode the_proc  ) 
 

Create a procedureInfo object for a procedure.

This constructor creates a new instance, and precomputes the worklist orderings, and the dominance frontiers.

procedureInfo::~procedureInfo  ) 
 

Destroy a procedureInfo object.


Member Function Documentation

cfg_edge_set& procedureInfo::active_edges  )  [inline]
 

Active edges.

Return the set of active edges.

Definition at line 734 of file proceduredb.h.

References _active_edges.

void procedureInfo::add_all_blocks  ) 
 

Add all blocks.

Add all blocks in the procedure to the worklist

void procedureInfo::add_ancestor_set procedureinfo_set ancestors  ) 
 

Add ancestor set.

(Only called once by the procedureDB::build method). Add the list of ancestors. This list is used to force reanalysis to reach the procedure.

void procedureInfo::add_block basicblockNode block,
Direction  dir
 

Add a block to the worklist.

Add a block, fixing the position as necessary to point to the earliest block on the list.

bool procedureInfo::add_external_input memoryBlock block  ) 
 

Add an external input.

This method is called by Pointers::record_external_inputs_and_outputs when it finds a use whose reaching definition is outside the current procedure. This method adds that variable as an external input.

Return true if the input wasn't already there.

bool procedureInfo::add_external_output memoryBlock block  ) 
 

Add an external output.

This method is called by Pointers::record_external_inputs_and_outputs when it finds a def that could be accessed outside the current procedure. This method adds that variable as an extern output.

If the output is the result of a weak update, then we also add to the external inputs, and return whether or not this created a new input.

void procedureInfo::add_one_ancestor procedureInfo ancestor  ) 
 

Add one ancestor.

Add one ancestor. This is called when new call edges are discovered during analysis (discovery of targets of function pointers). This procedure's decestors also get that ancestors set updated.

void procedureInfo::add_reachable_blocks basicblockNode block,
Direction  dir
 

Add all reachable blocks to the worklist.

Add all the blocks reachable from the given block, NOT including the block itself.

void procedureInfo::add_reachable_blocks_rec Direction  dir,
basicblockNode cur,
worklist_set temp,
bool  first
[private]
 

void procedureInfo::add_start_block Direction  dir  ) 
 

Add the start node.

This is either the entry node (for forward analysis) or the exit node (for backward analysis).

int procedureInfo::analysis_count  )  const [inline]
 

Get the analysis count.

Definition at line 740 of file proceduredb.h.

References _analysis_count.

const procedureinfo_set& procedureInfo::ancestors  )  const [inline]
 

Set of ancestors.

Definition at line 435 of file proceduredb.h.

References _ancestors.

basicblockNode* procedureInfo::block_at int  position,
Direction  dir
[private]
 

int procedureInfo::block_position basicblockNode block,
Direction  dir
[private]
 

procedureInfo* procedureInfo::caller_at stmtLocation callsite  ) 
 

Return the current callsiteReturn the current callerReturn the caller.

Given a callsite, return the caller at that callsite.

const procedureinfo_set& procedureInfo::calls  )  const [inline]
 

Return the calls.

Return the set of procedures that this one calls.

Definition at line 441 of file proceduredb.h.

References _calls.

const callsite_map& procedureInfo::callsites  )  const [inline]
 

Return the set of callsites.

Definition at line 445 of file proceduredb.h.

References _callsites.

void procedureInfo::check_merge_point memoryBlock block_to_merge,
basicblockLocation cur
 

Check merge point.

This method is used only for debugging to make sure we aren't finding new things to merge.

int procedureInfo::count_calling_contexts  ) 
 

Count contexts.

Count the number of calling contexts for the given procedure.

int procedureInfo::count_calling_contexts_rec proc_int_map count,
stmtNode callsite
[private]
 

Count contexts.

Count the number of calling contexts for the given procedure.

void procedureInfo::dfs_dominators Direction  dir,
basicblockNode cur,
basicblock_set visited,
basicblock_list order,
basicblock_list rpo_order
[private]
 

Alternative ordering.

Depth-first search of the dominator tree.

DFPreds* procedureInfo::dominance_frontiers  )  const [inline]
 

Return the dominance frontiers.

Definition at line 370 of file proceduredb.h.

References _dominance_frontiers.

const memoryblock_set& procedureInfo::external_inputs  )  const [inline]
 

Get external inputs.

Definition at line 615 of file proceduredb.h.

References _external_inputs.

const memoryblock_set& procedureInfo::external_outputs  )  const [inline]
 

Get external outputs.

Definition at line 619 of file proceduredb.h.

References _external_outputs.

procedureInfo* procedureInfo::first_caller  )  const [inline]
 

Return the first caller.

Definition at line 449 of file proceduredb.h.

References _first_caller.

void procedureInfo::get_cg_statistics int &  cg_depth_min,
int &  cg_depth_max,
int &  cg_height_min,
int &  cg_height_max
 

procLocation* procedureInfo::get_context  )  const [inline]
 

Get context-insensitive.

Return the context-insensitive callsite, or null if there is none.

Definition at line 573 of file proceduredb.h.

References _only_context.

basicblockNode* procedureInfo::get_next_block Direction  dir  ) 
 

Get the next block on the worklist.

Return the next block on the worklist, and update the position.

void procedureInfo::get_pending_changes stmtLocation callsite,
memoryblock_set changes
 

Get pending changes.

Check the current callsite to see if changes were left behind by a previous analysis in a different context. If so, get the changes now and merge them in.

void procedureInfo::incr_analysis_count  )  [inline]
 

Increment analysis count.

Definition at line 744 of file proceduredb.h.

References _analysis_count.

memoryblock_set procedureInfo::input_to_value memoryBlock block,
stmtLocation loc
const [inline]
 

Get recorded points-to set of input blocks to this procedure, for a particular site.

Definition at line 661 of file proceduredb.h.

References _input_site_values.

memoryblock_set procedureInfo::input_to_value memoryBlock block  )  const [inline]
 

Get recorded points-to set of input blocks to this procedure.

Definition at line 652 of file proceduredb.h.

References _input_values.

bool procedureInfo::is_ancestor procedureInfo other  ) 
 

Is ancestor?

Return true if the given procedure is an ancestor in the call graph.

bool procedureInfo::is_context_insensitive  )  const [inline]
 

Is context-insensitive.

Definition at line 559 of file proceduredb.h.

References _context_insensitive.

bool procedureInfo::is_empty  )  const
 

Test for empty worklist.

Return true if the worklist is empty, which typically indicates that we are done analyzing this particular procedure.

bool procedureInfo::is_library_routine  )  [inline]
 

Is library routine?

Test the decl_location of the procedure declaration.

Definition at line 754 of file proceduredb.h.

References proc(), and declNode::UNKNOWN.

bool procedureInfo::is_recursive  )  const [inline]
 

Is procedure recursive?

This boolean is set if the analyzer discovers that the procedure is part of a recursive cycle.

Definition at line 456 of file proceduredb.h.

References _is_recursive.

bool procedureInfo::is_verbose  )  const [inline]
 

Is verbose?

Definition at line 748 of file proceduredb.h.

References _verbose.

memoryblock_set* procedureInfo::lookup_merge_point basicblockLocation where  ) 
 

Lookup a merge point.

Given a particular basic block, see if there are any objects to be merged at its entry.

string& procedureInfo::name  )  [inline]
 

Get the procedure name.

Definition at line 424 of file proceduredb.h.

References proc().

bool procedureInfo::never_returns  )  const [inline]
 

Test never returns flag.

When true, it indicates that this procedure never returns, probably because it always calls exit() or abort().

Definition at line 496 of file proceduredb.h.

References _never_returns.

bool procedureInfo::prefer_context_sensitive  )  const [inline]
 

Do we prefer context sensitive?

Definition at line 563 of file proceduredb.h.

References _prefer_context_sensitive.

void procedureInfo::print ostream &  out  ) 
 

Output.

procNode* procedureInfo::proc  )  const [inline]
 

Return from the procedureGet the procedure.

Definition at line 420 of file proceduredb.h.

References _proc.

Referenced by is_library_routine(), and name().

procLocation* procedureInfo::procedure_location stmtLocation callsite  ) 
 

Get the procedure location.

For a given callsite, return the corresponding procLocation of the called procedure. For context-insensitive procedures, we just return the one context.

int procedureInfo::procedure_size  ) 
 

Procedure size.

Count the number of statements in the dismantled form of the procedure.

string procedureInfo::qualified_name  ) 
 

Qualified name.

Includes either (I), (S), or (R) for context-insensitive, context-sensitive, or recursive.

void procedureInfo::record_input_to_value memoryBlock block,
stmtLocation loc,
memoryblock_set  points_to
[inline]
 

Record points-to set of input blocks to this procedure.

Definition at line 644 of file proceduredb.h.

References _input_site_values, and _input_values.

void procedureInfo::remove_branch_blocks basicblockNode cond,
basicblockNode branch_taken,
basicblockNode branch_not_taken
 

Remove branch.

This routine removes basic blocks that will not be visited when the direction of a branch can be determined.

void procedureInfo::return_block memoryBlock r  )  [inline]
 

Set return block.

Set the block for return variable.

Definition at line 483 of file proceduredb.h.

References _return_block.

memoryBlock* procedureInfo::return_block  )  const [inline]
 

Return block.

Get the block for return variable.

Definition at line 477 of file proceduredb.h.

References _return_block.

returnNode* procedureInfo::return_stmt  )  const [inline]
 

Return statment.

Get a pointer to the returnNode (there should only be one!)

Definition at line 489 of file proceduredb.h.

References _return_stmt.

declNode* procedureInfo::return_variable  )  const [inline]
 

Return variable.

For procedures with a return value this field holds the declaration of the special dismantler-created variable to hold that value. Such variables are flagged as return values in their declaration.

Definition at line 471 of file proceduredb.h.

References _return_variable.

void procedureInfo::reverse_post_order Direction  dir,
basicblockNode cur,
basicblock_set visited,
basicblock_list order
[private]
 

Compute a reverse post-ordering of the basic blocks.

This routine builds a reverse-post-order traversal of the control-flow graph. The direction argument is used to produce an ordering for the regular CFG as well as the reverse CFG (for backward analysis).

double procedureInfo::self_timer  )  [inline]
 

Return the self time.

Definition at line 790 of file proceduredb.h.

References _self_timer, and cbzTimer::time().

void procedureInfo::set_never_returns  )  [inline]
 

Set never returns flag.

Setting this flag indicates that the procedure never returns. This is caused by a call to exit() or abort() that dominates the end of the procedure.

Definition at line 504 of file proceduredb.h.

References _never_returns.

void procedureInfo::set_pending_changes stmtLocation callsite,
memoryblock_set changes
 

Set pending changes.

In context-sensitive analysis when we pass external outputs back to other callsites, we need to collect those changes so that the calling procedure will see them when it's analyzed. This routine stores that set of changes for the caller according to the callsite.

void procedureInfo::set_prefer_context_sensitive  )  [inline]
 

Set context-sensitivity preference.

Definition at line 567 of file proceduredb.h.

References _prefer_context_sensitive.

void procedureInfo::set_recursive  )  [inline]
 

Set recursive flag.

Set by the analyzer when it discovers that the procedure is part of a recrusive cycle.

Definition at line 463 of file proceduredb.h.

References _is_recursive.

void procedureInfo::setup_call_at procedureInfo caller,
stmtLocation callsite,
bool  is_recursive_call,
bool  multiple_target_call
 

Call the procedure.

Set up the procedure at the given callsite. This method performs many tasks, including making the procedure context-insensitive, if that's called for.

void procedureInfo::setup_merge_point memoryBlock block_to_merge,
basicblockLocation cur
 

Set up merge points.

When a memory block changes during pointer analysis, this method sets up merg points for the block in the dominance frontier of the procedure.

void procedureInfo::start_self_timer  )  [inline]
 

Start the self timer.

Definition at line 782 of file proceduredb.h.

References _self_timer, and cbzTimer::start().

void procedureInfo::start_total_timer  )  [inline]
 

Start the total timer.

Definition at line 794 of file proceduredb.h.

References _total_timer, and cbzTimer::start().

void procedureInfo::stats ostream &  out  ) 
 

Stats.

Output a whole bunch of statistics about this procedure (particularly useful after analysis is complete).

void procedureInfo::stop_self_timer  )  [inline]
 

Stop the self timer.

Definition at line 786 of file proceduredb.h.

References _self_timer, and cbzTimer::stop().

void procedureInfo::stop_total_timer  )  [inline]
 

Stop the total timer.

Definition at line 798 of file proceduredb.h.

References _total_timer, and cbzTimer::stop().

double procedureInfo::total_timer  )  [inline]
 

Return the total time.

Definition at line 802 of file proceduredb.h.

References _total_timer, and cbzTimer::time().

void procedureInfo::update_cg_statistics_call procedureInfo callee  ) 
 

void procedureInfo::update_cg_statistics_return procedureInfo callee  ) 
 

void procedureInfo::update_conditional_worklist basicblockNode block,
bool  has_truth_value,
bool  which_branch
 

Conditional worklist algorithm.

Process a conditional branch.


Member Data Documentation

cfg_edge_set procedureInfo::_active_edges [private]
 

Active edges.

Definition at line 320 of file proceduredb.h.

Referenced by active_edges().

int procedureInfo::_analysis_count [private]
 

Analysis count.

Count the number of times the procedure is analyzed.

Definition at line 336 of file proceduredb.h.

Referenced by analysis_count(), and incr_analysis_count().

procedureinfo_set procedureInfo::_ancestors [private]
 

Ancestors.

Maintain a set of ancestors in the call graph. This makes searching the scope and updating the worklist faster.

Definition at line 287 of file proceduredb.h.

Referenced by ancestors().

vector< basicblockNode * > procedureInfo::_backward_basicblock_order [private]
 

The backward enumeration of basic blocks.

This maps basic blocks to bit positions in the worklist.

Definition at line 136 of file proceduredb.h.

worklist_order_map procedureInfo::_backward_worklist_order [private]
 

The backward ordering of basic blocks in the worklist.

We precompute this ordering to favor quick convergence of dataflow problems. It's just a depth-first ordering.

Definition at line 130 of file proceduredb.h.

basicblock_set procedureInfo::_blocks_to_skip [private]
 

Blocks to skip.

In conditional mode, this tells us which blocks are currently being skipped because they are on branches that are not taken. We need this list in order to set up the merge points properly.

Definition at line 314 of file proceduredb.h.

procedureinfo_set procedureInfo::_calls [private]
 

Called procedures.

The procedures directly called by this one.

Definition at line 300 of file proceduredb.h.

Referenced by calls().

callsite_map procedureInfo::_callsites [private]
 

Call sites.

This set holds all of the statements that are determined to be calls to this procedure. The map is from callsites to the procedure making the call (the context).

Definition at line 168 of file proceduredb.h.

Referenced by callsites().

int procedureInfo::_cg_depth_max [private]
 

Depth in call graph.

Definition at line 360 of file proceduredb.h.

int procedureInfo::_cg_depth_min [private]
 

Depth in call graph.

Definition at line 360 of file proceduredb.h.

int procedureInfo::_cg_height_max [private]
 

Height in call graph to a leaf.

Definition at line 363 of file proceduredb.h.

int procedureInfo::_cg_height_min [private]
 

Height in call graph to a leaf.

Definition at line 363 of file proceduredb.h.

bool procedureInfo::_context_insensitive [private]
 

Current call siteContext insensitive.

Set to true if this procedure is analyzed context insensitively.

Definition at line 230 of file proceduredb.h.

Referenced by is_context_insensitive().

procedureinfo_set procedureInfo::_decestors [private]
 

Ancestors.

Maintain a set of ancestors in the call graph. This makes searching the scope and updating the worklist faster.

Definition at line 287 of file proceduredb.h.

DFPreds* procedureInfo::_dominance_frontiers [private]
 

Dominance frontiers.

This is a special version of dominance frontiers. For each node X in the dominance frontier of some node Y, it also provide the particular immediate predecessor of Y that is dominated by X.

Definition at line 152 of file proceduredb.h.

Referenced by dominance_frontiers().

memoryblock_set procedureInfo::_external_inputs [private]
 

External inputs.

When a procedure is analyzed without context sensitivity, we need to record those objects that enter the procedure from outside. We can think of these objects as inputs to the procedure that are not represented in the parameter list (e.g, a global variable). Since each context could have a different reaching def, we need to merge together those reaching defs before entering the procedure. This works a bit like a merge-point.

Definition at line 260 of file proceduredb.h.

Referenced by external_inputs().

memoryblock_set procedureInfo::_external_outputs [private]
 

External outputs.

Like the external inputs, when we're using context insensitive mode, defs inside the procedure can reach outside the procedure. We can think of these objects as outputs from the procedure. In order to make sure that those defs reach the right uses, we create a def at the callsite with a use whose reaching definition is inside the procedure.

Definition at line 271 of file proceduredb.h.

Referenced by external_outputs().

procedureInfo* procedureInfo::_first_caller [private]
 

First caller.

Creates a minimum spanning tree of the call graph. We use this to mark for reanalysis.

Definition at line 294 of file proceduredb.h.

Referenced by first_caller().

vector< basicblockNode * > procedureInfo::_forward_basicblock_order [private]
 

The forward enumeration of basic blocks.

This maps basic blocks to bit positions in the worklist.

Definition at line 123 of file proceduredb.h.

worklist_order_map procedureInfo::_forward_worklist_order [private]
 

The forward ordering of basic blocks in the worklist.

We precompute this ordering to favor quick convergence of dataflow problems. It's just a depth-first ordering.

Definition at line 117 of file proceduredb.h.

map<block_loc_pair,memoryblock_set> procedureInfo::_input_site_values [private]
 

Points-to set of input blocks to this procedure, for a particular callsite. Used by adaptor.

Definition at line 280 of file proceduredb.h.

Referenced by input_to_value(), and record_input_to_value().

map<memoryBlock*,memoryblock_set> procedureInfo::_input_values [private]
 

Points-to set of input blocks to this procedure.

Definition at line 274 of file proceduredb.h.

Referenced by input_to_value(), and record_input_to_value().

bool procedureInfo::_is_recursive [private]
 

Called recursively.

Record if this procedure is recursive.

Definition at line 306 of file proceduredb.h.

Referenced by is_recursive(), and set_recursive().

loopTree* procedureInfo::_loops [private]
 

Loop tree.

This object contains all the information we need about the loops in this procedure. In addition, it provides a classification of all edges in the control-flow graph.

Definition at line 160 of file proceduredb.h.

mergepoint_map procedureInfo::_merge_points [private]
 

Merge points.

These are the phi functions for this procedure. Note that since a procedure may be called in many different contexts, we need to separate the merge points out.

Definition at line 144 of file proceduredb.h.

bool procedureInfo::_never_returns [private]
 

Never returns.

When this flag is set true it indicates that the given procedure never returns. This can happen if a procedure always calls exit(), for example. We'll use this information to prune the control-flow graph.

Definition at line 197 of file proceduredb.h.

Referenced by never_returns(), and set_never_returns().

TREE procLocation* procedureInfo::_only_context [private]
 

Only context.

For context insensitive procedures, we build a separate location tree that holds all of the context insensitive uses and defs.

Note that since this location is removed from the location tree, this object actually owns it.

Definition at line 248 of file proceduredb.h.

Referenced by get_context().

callsite_changes_map procedureInfo::_pending_changes [private]
 

Pending changes.

When this procedure calls a procedure that is context-insensitive, it is possible that other callsites will produce changes that are propagated here. For example:

foo() { bar(); } baz() { bar(); }

Assume bar() is context-insensitive. While analyzing bar() in the baz() context, we may need to propagate changes to the foo() callsite. The reason that this isn't a problem in the baz() context is that we actually pass the changes back to baz() as the external_changes set.

The solution is to store the changes produced by passing the external output in this map, and then pick them up when we actually revisit the context.

Definition at line 218 of file proceduredb.h.

bool procedureInfo::_prefer_context_sensitive [private]
 

Prefer context sensitive.

This flag is set at the beginning of the analysis to indicate that the preferred mode for this procedure is context sensitive. We only check this flag during context insensitive analysis.

Definition at line 238 of file proceduredb.h.

Referenced by prefer_context_sensitive(), and set_prefer_context_sensitive().

procNode* procedureInfo::_proc [private]
 

A pointer to the procedure definition.

Definition at line 106 of file proceduredb.h.

Referenced by proc().

memoryBlock* procedureInfo::_return_block [private]
 

Block for return value variable.

Store the block for special return value variable so that we can easily get it when we need to retrieve the return value.

Definition at line 182 of file proceduredb.h.

Referenced by return_block().

returnNode* procedureInfo::_return_stmt [private]
 

Return statement.

Store a pointer to the return statement (there should only be one!)

Definition at line 188 of file proceduredb.h.

Referenced by return_stmt().

declNode* procedureInfo::_return_variable [private]
 

Return value variable.

Store the special return value variable so that we can easily get it when we need to retrieve the return value.

Definition at line 175 of file proceduredb.h.

Referenced by return_variable().

cbzTimer procedureInfo::_self_timer [private]
 

Self timer.

Keep track of the total time spent analyzing this routine (not including called routines).

Definition at line 350 of file proceduredb.h.

Referenced by self_timer(), start_self_timer(), and stop_self_timer().

cbzTimer procedureInfo::_total_timer [private]
 

Total timer.

Keep track of the total time spend analyzing this routine, including procedures that it calls.

Definition at line 357 of file proceduredb.h.

Referenced by start_total_timer(), stop_total_timer(), and total_timer().

true_branch_map procedureInfo::_true_branches [private]
 

Definition at line 330 of file proceduredb.h.

bool procedureInfo::_verbose [private]
 

Verbose.

When true, turn on verbose output when we're analyzing this procedure.

Definition at line 343 of file proceduredb.h.

Referenced by is_verbose().

workList procedureInfo::_worklist [private]
 

The worklist of basic blocks.

Definition at line 110 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