Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
Location Class Reference#include <location.h>
Inheritance diagram for Location:
List of all members.
Member Enumeration Documentation
enum Location::LocationKind
|
|
|
Kind of location.
- Enumeration values:
-
Statement |
|
BasicBlock |
|
Procedure |
|
Definition at line 93 of file location.h. |
Constructor & Destructor Documentation
Location::~Location |
( |
|
) |
[virtual] |
|
Member Function Documentation
virtual void Location::adjust_depth |
( |
|
) |
[pure virtual] |
|
void Location::clear_dominator |
( |
|
) |
|
|
void Location::decrement_children |
( |
|
) |
[inline] |
|
bool Location::dominates |
( |
const Location * |
dom, |
|
|
const Location * |
cur |
|
) |
[static] |
|
Location* Location::dominator |
( |
|
) |
const [inline] |
|
void Location::finish |
( |
|
) |
|
|
void Location::increment_children |
( |
|
) |
[inline] |
|
bool Location::is_prefix |
( |
const Location * |
prefix, |
|
|
const Location * |
longer |
|
) |
[static] |
|
unsigned int Location::next_tree_number |
( |
|
) |
[inline, static, protected] |
|
int Location::num_children |
( |
|
) |
const [inline] |
|
Location& Location::operator= |
( |
const Location & |
other |
) |
[inline, private] |
|
Location* Location::parent |
( |
|
) |
const [inline] |
|
virtual void Location::print |
( |
ostream & |
o |
) |
const [pure virtual] |
|
virtual void Location::print_path |
( |
ostream & |
o |
) |
const [pure virtual] |
|
procLocation * Location::procedure |
( |
Location * |
where |
) |
[static] |
|
|
Find the enclosing procedure.
Definition at line 395 of file location.cc.
References BasicBlock, stmtLocation::block_location(), kind(), basicblockLocation::proc_location(), Procedure, and Statement.
Referenced by Pointers::compute_accuracy(), memoryModel::create_memory_object(), Pointers::determine_call_targets(), Pointers::eval(), memoryModel::lookup(), and memoryBlock::name(). |
void Location::set_dominator |
( |
Location * |
d |
) |
|
|
void Location::set_tree_max |
( |
unsigned int |
m |
) |
[inline] |
|
void Location::set_tree_min |
( |
unsigned int |
m |
) |
[inline] |
|
void Location::stats |
( |
|
) |
[static] |
|
bool Location::strictly_dominates |
( |
const Location * |
dom, |
|
|
const Location * |
cur |
|
) |
[static] |
|
unsigned int Location::subtree_id |
( |
|
) |
const [inline] |
|
unsigned int Location::tree_max |
( |
|
) |
const [inline] |
|
unsigned int Location::tree_min |
( |
|
) |
const [inline] |
|
Friends And Related Function Documentation
ostream& operator<< |
( |
ostream & |
o, |
|
|
const Location & |
loc |
|
) |
[friend] |
|
Member Data Documentation
Location* Location::_dominator [protected]
|
|
|
Immediate dominator.
This points to the immediate dominator of this node. It is set up during the construction of the location tree. It embodies the dominance rules discussed above.
Definition at line 178 of file location.h.
Referenced by clear_dominator(), and set_dominator(). |
unsigned int Location::_kind [protected]
|
|
|
The kind of location.
There are only three kinds, so we only need two bits.
Definition at line 129 of file location.h.
Referenced by kind(). |
unsigned int Location::_num_children [protected]
|
|
|
Number of dominator children.
This is the number of locations immediately dominated by this one. We use this number to control the depth-first tree numbering algorithm. When the number is greater than one, we know that we still have dominator subtrees to number. Each time we finish a subtree, we decrement this number on the immediate dominator. When it reaches zero, the whole subtree is numbered.
We limit this field to 8 bits, which only allows a node to immediately dominate 256 other nodes. This is probably way higher than it needs to be, but we'll play it safe.
Definition at line 170 of file location.h.
Referenced by decrement_children(), increment_children(), and num_children(). |
Location* Location::_parent [protected]
|
|
|
Parent.
A pointer to the containing location (strictly in terms of program structure). For stmtLocations, this points to the containing basic block. For basicblockLocations, it points to the procLocation. For procLocations, it points to the callsite stmtLocation (if there is one).
Reimplemented in Path.
Definition at line 123 of file location.h.
Referenced by procLocation::adjust_depth(), basicblockLocation::adjust_depth(), stmtLocation::adjust_depth(), stmtLocation::block_location(), procLocation::parent_proc(), basicblockLocation::proc_location(), procLocation::remove_from_tree(), and procLocation::stmt_location(). |
unsigned int Location::_subtree_id [protected]
|
|
unsigned int Location::_tree_max [protected]
|
|
unsigned int Location::_tree_min [protected]
|
|
|
Tree numbering
These two numbers implement the tree numbering scheme (from communication from Mark Wegman) that allows a constant time interprocedural dominance test. The scheme works as follows: we perform a depth-first traversal of the dominator tree, both pre-order and post-order, assigning consecutive numbers to "tree min" value on the way down, and the "tree max" value on the way up.
This numbering results in the following invariant: the min-max range of each node contains the min-max ranges of all nodes that it dominates.
Since we compute this numbering on-line, we need to test dominance for nodes on the way down the tree. This means we have to do without a tree max value in some cases. Therefore, we have a special case: the tree max defaults to MAX_INT until it is given a specific value.
These number can get large, so we use full 32-bit ints (limits us to 4 billion program locations).
Definition at line 203 of file location.h. |
unsigned int Location::block_count = 0 [static]
|
|
unsigned int Location::current_subtree_id = 0 [static, protected]
|
|
unsigned int Location::current_tree_number = 0 [static, protected]
|
|
unsigned int Location::dom_calls = 0 [static]
|
|
unsigned int Location::proc_count = 0 [static]
|
|
unsigned int Location::stmt_count = 0 [static]
|
|
The documentation for this class was generated from the following files:
|