UnificationBasedPtr Class Reference#include <unification.h>
Inheritance diagram for UnificationBasedPtr:
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 |
Unify_ECR * | ecr (declNode *decl) const |
Unify_ECR * | ecr (threeAddrNode *alloc_site) const |
UnifyType * | proctype (procNode *p) |
void | createProcBlock (procNode *, memoryModel &, procLocation *) |
virtual void | mark_alloc (stmtNode *stmt, declNode *source_decl, declNode *target_decl) |
void | ensure_no_bottom (Unify_ECR *tao, declNode *decl, UnifyType *parent) |
virtual bool | isField (declNode *f, bool &from_annotation) const |
Unify_ECR * | ecrField (UnifyType *container, declNode *field, bool field_from_annotation) |
Unify_ECR * | ecrDeref (UnifyType *container) |
Alpha * | string_alpha (constNode *con) |
set< Unify_ECR * > | unique_ecr () const |
procNode * | synthetic_proc (declNode *d) |
void | print_ecr () |
|
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.
|
|
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_def (defNode *the_def, Order ord) |
virtual void | at_subdecl (subdeclNode *the_subdecl, 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_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_text (textNode *the_text, Order ord) |
Static Public Member Functions |
static UnificationBasedPtr * | analyze_all (Linker &) |
static bool | reachable (UnifyType *src, UnifyTypes &targets, UnifyTypes &visited) |
static bool | compatible_type (typeNode *, typeNode *) |
Static Public Attributes |
static int | unify_points_to_max |
Protected Member Functions |
| UnificationBasedPtr (Linker &l) |
void | at_unit (unitNode *u, Order) |
void | at_proc (procNode *, Order) |
void | at_decl (declNode *, Order) |
void | at_suespec (suespecNode *, Order) |
void | at_threeAddr (threeAddrNode *, Order) |
void | at_allocation (threeAddrNode *, Unify_Size) |
void | at_call (threeAddrNode *, Unify_Size) |
void | at_initializer (initializerNode *init, typeNode *init_type, Unify_ECR *init_ecr) |
void | mergeOperand (operandNode *lhs, operandNode *rhs, Unify_Size) |
Alpha * | alpha (operandNode *, Unify_Size) |
Unify_ECR * | ecr (operandNode *, Unify_Size, Unify_Offset **offset=NULL) |
Unify_ECR * | ecr1 (declNode *decl) |
void | join (Alpha *a1, Alpha *a2, bool *recursion_detected=NULL) |
void | join (Unify_ECR *e1, Unify_ECR *e2, bool *recursion_detected=NULL) |
void | join (Lambda *l1, Lambda *l2) |
void | settype (Unify_ECR *e, UnifyType *t) |
void | settype (Lambda *l, int n, int m, Unify_ECR **t, Unify_ECR *r, bool ellipse) |
void | ensure_sim_obj (Unify_ECR *tao, Unify_Size &s) |
Unify_Structure * | ensure_struct_obj (Unify_ECR *tao, suespecNode *sue, bool redo_pending=false) |
void | expand (Unify_ECR *e) |
void | promote (Unify_ECR *e, Unify_Size &s) |
void | collapse (Unify_ECR *e) |
void | make_unknown (Unify_Offset *o) |
void | unless_zero (Unify_Offset *o, Unify_ECR *tao) |
void | cjoin (Unify_Size &s, Unify_ECR *e1, Unify_ECR *e2) |
UnifyType * | unify (UnifyType *t1, UnifyType *t2) |
bool | make_compatible (declSet n, Unify_Structure *s, Unify_ECR *container, bool force=false) |
void | merge_EltMap (UnifyType *t1, UnifyType *t2, Unify_Structure *) |
void | finalize () |
procNode * | create_synthetic_proc (declNode *) |
declNode * | unique_field_defn (declNode *d) |
suespecNode * | field2sue (declNode *d) |
virtual bool | annotation_returns_object (procNode *proc) const |
virtual void | annotation_call_arg (procNode *, int arg, typeNode *, Unify_ECR *) |
virtual void | annotation_call_arg (procNode *, int arg, typeNode *, Alpha *) |
virtual void | annotation_ret_val (procNode *, Unify_ECR *taoR, unitNode *unit) |
virtual void | annotation_init_global (declNode *global) |
Static Protected Member Functions |
static bool | is_va_list (declNode *decl) |
Protected Attributes |
TREE map< declNode *, Unify_ECR * > | _ecr |
TREE map< procNode *, UnifyType * > | _proctype |
TREE map< threeAddrNode *,
Unify_ECR * > | _alloc |
TREE map< constNode *, Alpha * > | _string_alpha |
TREE int | _dismantler_tmp |
TREE map< declNode *, suespecNode * > | _field2sue |
TREE map< declNode *, decl_list > | _fieldpos |
TREE set< suespecNode * > | _unique_sue |
TREE set< suespecNode * > | _visited_sue |
TREE map< declNode *, declNode * > | _unique_field_defn |
map< threeAddrNode *, UnifyType * > | _ptr_call |
unitNode * | cur_unit |
procNode * | cur_proc |
bool | inside_call_func |
bool | finalizing |
bool | serve_again |
bool | new_pending |
set< Unify_Pending * > | more_pending |
Linker & | linker |
map< declNode *, procNode * > | _synthetic_proc |
set< procNode * > | _analyzed_proc |
map< declNode *, int > | _assignments |
map< declNode *, bool > | _uses |
Member Enumeration Documentation
|
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. |
|
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
UnificationBasedPtr::UnificationBasedPtr |
( |
Linker & |
l |
) |
[inline, protected] |
|
Member Function Documentation
virtual void UnificationBasedPtr::annotation_call_arg |
( |
procNode * |
, |
|
|
int |
arg, |
|
|
typeNode * |
, |
|
|
Alpha * |
|
|
) |
[inline, protected, virtual] |
|
virtual void UnificationBasedPtr::annotation_call_arg |
( |
procNode * |
, |
|
|
int |
arg, |
|
|
typeNode * |
, |
|
|
Unify_ECR * |
|
|
) |
[inline, protected, virtual] |
|
virtual void UnificationBasedPtr::annotation_init_global |
( |
declNode * |
global |
) |
[inline, protected, virtual] |
|
virtual void UnificationBasedPtr::annotation_ret_val |
( |
procNode * |
, |
|
|
Unify_ECR * |
taoR, |
|
|
unitNode * |
unit |
|
) |
[inline, protected, virtual] |
|
virtual bool UnificationBasedPtr::annotation_returns_object |
( |
procNode * |
proc |
) |
const [inline, protected, virtual] |
|
virtual void Walker::at_array |
( |
arrayNode * |
the_array, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_attrib |
( |
attribNode * |
the_attrib, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_basicblock |
( |
basicblockNode * |
the_basicblock, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_binary |
( |
binaryNode * |
the_binary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_block |
( |
blockNode * |
the_block, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_break |
( |
breakNode * |
the_break, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_call |
( |
callNode * |
the_call, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_case |
( |
caseNode * |
the_case, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_cast |
( |
castNode * |
the_cast, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_comma |
( |
commaNode * |
the_comma, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_conditiongoto |
( |
conditiongotoNode * |
the_condgoto, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_const |
( |
constNode * |
the_const, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_continue |
( |
continueNode * |
the_continue, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void UnificationBasedPtr::at_decl |
( |
declNode * |
, |
|
|
Order |
|
|
) |
[protected, virtual] |
|
virtual void Walker::at_def |
( |
defNode * |
the_def, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_do |
( |
doNode * |
the_do, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_enum |
( |
enumNode * |
the_enum, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_expr |
( |
exprNode * |
the_expr, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_exprstmt |
( |
exprstmtNode * |
the_exprstmt, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_for |
( |
forNode * |
the_for, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_func |
( |
funcNode * |
the_func, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_goto |
( |
gotoNode * |
the_goto, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_id |
( |
idNode * |
the_id, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_if |
( |
ifNode * |
the_if, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_index |
( |
indexNode * |
the_index, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_initializer |
( |
initializerNode * |
the_initializer, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_jump |
( |
jumpNode * |
the_jump, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_label |
( |
labelNode * |
the_label, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_loop |
( |
loopNode * |
the_loop, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
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] |
|
virtual void Walker::at_prim |
( |
primNode * |
the_prim, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void UnificationBasedPtr::at_proc |
( |
procNode * |
, |
|
|
Order |
|
|
) |
[protected, virtual] |
|
virtual void Walker::at_ptr |
( |
ptrNode * |
the_ptr, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_return |
( |
returnNode * |
the_return, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_selection |
( |
selectionNode * |
the_selection, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_stmt |
( |
stmtNode * |
the_stmt, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_struct |
( |
structNode * |
the_struct, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_subdecl |
( |
subdeclNode * |
the_subdecl, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_sue |
( |
sueNode * |
the_sue, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void UnificationBasedPtr::at_suespec |
( |
suespecNode * |
, |
|
|
Order |
|
|
) |
[protected, virtual] |
|
virtual void Walker::at_switch |
( |
switchNode * |
the_switch, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_target |
( |
targetNode * |
the_target, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_tdef |
( |
tdefNode * |
the_tdef, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_ternary |
( |
ternaryNode * |
the_ternary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_text |
( |
textNode * |
the_text, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_type |
( |
typeNode * |
the_type, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_unary |
( |
unaryNode * |
the_unary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual void Walker::at_union |
( |
unionNode * |
the_union, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void UnificationBasedPtr::at_unit |
( |
unitNode * |
u, |
|
|
Order |
|
|
) |
[inline, protected, virtual] |
|
virtual void Walker::at_while |
( |
whileNode * |
the_while, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
void UnificationBasedPtr::collapse |
( |
Unify_ECR * |
e |
) |
[protected] |
|
static bool UnificationBasedPtr::compatible_type |
( |
typeNode * |
, |
|
|
typeNode * |
|
|
) |
[static] |
|
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. |
void UnificationBasedPtr::expand |
( |
Unify_ECR * |
e |
) |
[protected] |
|
void UnificationBasedPtr::finalize |
( |
|
) |
[protected] |
|
static bool UnificationBasedPtr::is_va_list |
( |
declNode * |
decl |
) |
[static, protected] |
|
virtual bool UnificationBasedPtr::isField |
( |
declNode * |
f, |
|
|
bool & |
from_annotation |
|
) |
const [inline, virtual] |
|
void UnificationBasedPtr::join |
( |
Lambda * |
l1, |
|
|
Lambda * |
l2 |
|
) |
[protected] |
|
void UnificationBasedPtr::join |
( |
Unify_ECR * |
e1, |
|
|
Unify_ECR * |
e2, |
|
|
bool * |
recursion_detected = NULL |
|
) |
[protected] |
|
void UnificationBasedPtr::join |
( |
Alpha * |
a1, |
|
|
Alpha * |
a2, |
|
|
bool * |
recursion_detected = NULL |
|
) |
[protected] |
|
void UnificationBasedPtr::make_unknown |
( |
Unify_Offset * |
o |
) |
[protected] |
|
virtual void UnificationBasedPtr::mark_alloc |
( |
stmtNode * |
stmt, |
|
|
declNode * |
source_decl, |
|
|
declNode * |
target_decl |
|
) |
[inline, virtual] |
|
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 UnificationBasedPtr::print_ecr |
( |
|
) |
|
|
set<Unify_ECR*> UnificationBasedPtr::unique_ecr |
( |
|
) |
const |
|
declNode* UnificationBasedPtr::unique_field_defn |
( |
declNode * |
d |
) |
[inline, protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
|