Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
InitializerDismantle Class Reference#include <dismantle.h>
Inheritance diagram for InitializerDismantle:
List of all members.
|
Public Types |
enum | Order { Preorder,
Postorder,
Both
} |
enum | Depth { Subtree,
NodeOnly
} |
Public Member Functions |
| InitializerDismantle (void) |
virtual Node * | at_block (blockNode *, Order) |
virtual Node * | at_decl (declNode *, Order) |
|
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.
|
bool | delete_old () const |
| Return whether this Changer deletes Nodes which are removed from the AST by "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 Node * | at_node (Node *the_node, Order ord) |
virtual Node * | at_unit (unitNode *the_unit, Order ord) |
virtual Node * | at_def (defNode *the_def, Order ord) |
virtual Node * | at_subdecl (subdeclNode *the_subdecl, Order ord) |
virtual Node * | at_proc (procNode *the_proc, Order ord) |
virtual Node * | at_type (typeNode *the_type, Order ord) |
virtual Node * | at_prim (primNode *the_prim, Order ord) |
virtual Node * | at_tdef (tdefNode *the_tdef, Order ord) |
virtual Node * | at_ptr (ptrNode *the_ptr, Order ord) |
virtual Node * | at_array (arrayNode *the_array, Order ord) |
virtual Node * | at_func (funcNode *the_func, Order ord) |
virtual Node * | at_sue (sueNode *the_sue, Order ord) |
virtual Node * | at_struct (structNode *the_struct, Order ord) |
virtual Node * | at_union (unionNode *the_union, Order ord) |
virtual Node * | at_enum (enumNode *the_enum, Order ord) |
virtual Node * | at_suespec (suespecNode *the_suespec, Order ord) |
virtual Node * | at_expr (exprNode *the_expr, Order ord) |
virtual Node * | at_index (indexNode *the_index, Order ord) |
virtual Node * | at_const (constNode *the_const, Order ord) |
virtual Node * | at_id (idNode *the_id, Order ord) |
virtual Node * | at_binary (binaryNode *the_binary, Order ord) |
virtual Node * | at_unary (unaryNode *the_unary, Order ord) |
virtual Node * | at_cast (castNode *the_cast, Order ord) |
virtual Node * | at_comma (commaNode *the_comma, Order ord) |
virtual Node * | at_ternary (ternaryNode *the_ternary, Order ord) |
virtual Node * | at_call (callNode *the_call, Order ord) |
virtual Node * | at_initializer (initializerNode *the_initializer, Order ord) |
virtual Node * | at_stmt (stmtNode *the_stmt, Order ord) |
virtual Node * | at_basicblock (basicblockNode *the_basicblock, Order ord) |
virtual Node * | at_exprstmt (exprstmtNode *the_exprstmt, Order ord) |
virtual Node * | at_target (targetNode *the_target, Order ord) |
virtual Node * | at_label (labelNode *the_label, Order ord) |
virtual Node * | at_case (caseNode *the_case, Order ord) |
virtual Node * | at_selection (selectionNode *the_selection, Order ord) |
virtual Node * | at_if (ifNode *the_if, Order ord) |
virtual Node * | at_switch (switchNode *the_switch, Order ord) |
virtual Node * | at_loop (loopNode *the_loop, Order ord) |
virtual Node * | at_while (whileNode *the_while, Order ord) |
virtual Node * | at_do (doNode *the_do, Order ord) |
virtual Node * | at_for (forNode *the_for, Order ord) |
virtual Node * | at_jump (jumpNode *the_jump, Order ord) |
virtual Node * | at_goto (gotoNode *the_goto, Order ord) |
virtual Node * | at_continue (continueNode *the_continue, Order ord) |
virtual Node * | at_break (breakNode *the_break, Order ord) |
virtual Node * | at_return (returnNode *the_return, Order ord) |
virtual Node * | at_attrib (attribNode *the_attrib, Order ord) |
virtual Node * | at_operand (operandNode *the_oper, Order ord) |
virtual Node * | at_conditiongoto (conditiongotoNode *the_condgoto, Order ord) |
virtual Node * | at_threeAddr (threeAddrNode *the_3addr, Order ord) |
virtual Node * | at_text (textNode *the_text, Order ord) |
Private Member Functions |
exprNode * | eval_or_cast (exprNode *, typeNode *) |
void | init_scalar (declNode *, exprNode *) |
initializerNode * | init_array (arrayNode *, expr_list_p &, expr_list_p, bool inSublist) |
initializerNode * | init_struct (structNode *, expr_list_p &, expr_list_p, bool inSublist) |
bool | isStringLiteral (exprNode *) |
initializerNode * | strLit2Init (const char *) |
Private Attributes |
map< blockNode *, blockNode * > | _assgblock |
stack< blockNode * > | _blockStack |
Member Enumeration Documentation
enum Changer::Depth [inherited]
|
|
|
- Enumeration values:
-
Definition at line 148 of file changer.h. |
enum Changer::Order [inherited]
|
|
|
- Enumeration values:
-
Definition at line 147 of file changer.h.
Referenced by whileNode::change(), unitNode::change(), unionNode::change(), unaryNode::change(), threeAddrNode::change(), textNode::change(), ternaryNode::change(), tdefNode::change(), switchNode::change(), suespecNode::change(), subdeclNode::change(), structNode::change(), returnNode::change(), ptrNode::change(), procNode::change(), primNode::change(), operandNode::change(), metastmtNode::change(), metaexprNode::change(), labelNode::change(), initializerNode::change(), ifNode::change(), idNode::change(), gotoNode::change(), funcNode::change(), forNode::change(), exprstmtNode::change(), enumNode::change(), doNode::change(), declNode::change(), continueNode::change(), constNode::change(), conditiongotoNode::change(), commaNode::change(), castNode::change(), caseNode::change(), callNode::change(), breakNode::change(), blockNode::change(), binaryNode::change(), basicblockNode::change(), attribNode::change(), and arrayNode::change(). |
Constructor & Destructor Documentation
InitializerDismantle::InitializerDismantle |
( |
void |
|
) |
|
|
Member Function Documentation
virtual Node* Changer::at_array |
( |
arrayNode * |
the_array, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_attrib |
( |
attribNode * |
the_attrib, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_binary |
( |
binaryNode * |
the_binary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_break |
( |
breakNode * |
the_break, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_call |
( |
callNode * |
the_call, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_case |
( |
caseNode * |
the_case, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_cast |
( |
castNode * |
the_cast, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_comma |
( |
commaNode * |
the_comma, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_const |
( |
constNode * |
the_const, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_continue |
( |
continueNode * |
the_continue, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
|
Reimplemented from Changer.
Definition at line 293 of file dismantle-init.cc.
References Array, Node::coord(), CBZ::Error(), expr_list_p, initializerNode::exprs(), declNode::init(), init_array(), init_scalar(), init_struct(), Initializer, typeNode::is_aggregate(), typeNode::is_scalar(), isStringLiteral(), declNode::no_tdef_type(), Changer::Preorder, strLit2Init(), and Node::typ(). |
virtual Node* Changer::at_def |
( |
defNode * |
the_def, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_do |
( |
doNode * |
the_do, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_enum |
( |
enumNode * |
the_enum, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_expr |
( |
exprNode * |
the_expr, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_exprstmt |
( |
exprstmtNode * |
the_exprstmt, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_for |
( |
forNode * |
the_for, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_func |
( |
funcNode * |
the_func, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_goto |
( |
gotoNode * |
the_goto, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_id |
( |
idNode * |
the_id, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_if |
( |
ifNode * |
the_if, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_index |
( |
indexNode * |
the_index, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_jump |
( |
jumpNode * |
the_jump, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_label |
( |
labelNode * |
the_label, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_loop |
( |
loopNode * |
the_loop, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_node |
( |
Node * |
the_node, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_operand |
( |
operandNode * |
the_oper, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_prim |
( |
primNode * |
the_prim, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_proc |
( |
procNode * |
the_proc, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
|
Reimplemented in Dismantle, StaticToGlobalDismantle, ControlDismantle, ReturnDismantle, FlattenDismantle, function_inline, cfg_changer, copyPropChanger, deadCodeEliminationChanger, UnusedDeclarationCleanupChanger, LocalCopyPropChanger, CFS_Changer, and Optimizer.
Definition at line 238 of file changer.h.
References Changer::at_def().
Referenced by procNode::change(). |
virtual Node* Changer::at_ptr |
( |
ptrNode * |
the_ptr, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_return |
( |
returnNode * |
the_return, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_stmt |
( |
stmtNode * |
the_stmt, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_struct |
( |
structNode * |
the_struct, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_subdecl |
( |
subdeclNode * |
the_subdecl, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_sue |
( |
sueNode * |
the_sue, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_suespec |
( |
suespecNode * |
the_suespec, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_switch |
( |
switchNode * |
the_switch, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_target |
( |
targetNode * |
the_target, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_tdef |
( |
tdefNode * |
the_tdef, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_ternary |
( |
ternaryNode * |
the_ternary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_text |
( |
textNode * |
the_text, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_type |
( |
typeNode * |
the_type, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_unary |
( |
unaryNode * |
the_unary, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_union |
( |
unionNode * |
the_union, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_unit |
( |
unitNode * |
the_unit, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
virtual Node* Changer::at_while |
( |
whileNode * |
the_while, |
|
|
Order |
ord |
|
) |
[inline, virtual, inherited] |
|
bool Changer::delete_old |
( |
|
) |
const [inline, inherited] |
|
Depth Changer::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 204 of file changer.h. |
|
Definition at line 97 of file dismantle-init.cc.
References primNode::basic(), constant::cast(), Node::coord(), arrayNode::dim(), CBZ::Error(), exprNode::eval(), eval_or_cast(), expr_list_p, initializerNode::exprs(), init_struct(), constant::Integer(), isStringLiteral(), typeNode::no_tdef_type(), constant::no_val(), strLit2Init(), typeNode::type(), and exprNode::value().
Referenced by at_decl(), and init_struct(). |
|
Definition at line 76 of file dismantle-init.cc.
References _assgblock, _blockStack, declNode::BLOCK, Node::coord(), declNode::decl_location(), eval_or_cast(), declNode::init(), declNode::no_tdef_type(), blockNode::stmts(), declNode::TOP, declNode::type(), and exprNode::type().
Referenced by at_decl(). |
|
Definition at line 192 of file dismantle-init.cc.
References primNode::basic(), constant::cast(), Node::coord(), decl_list_p, CBZ::Error(), eval_or_cast(), expr_list_p, initializerNode::exprs(), suespecNode::fields(), init_array(), and sueNode::spec().
Referenced by at_decl(), and init_array(). |
bool InitializerDismantle::isStringLiteral |
( |
exprNode * |
|
) |
[private] |
|
Order Changer::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 196 of file changer.h.
Referenced by whileNode::change(), unitNode::change(), unionNode::change(), unaryNode::change(), threeAddrNode::change(), textNode::change(), ternaryNode::change(), tdefNode::change(), switchNode::change(), suespecNode::change(), subdeclNode::change(), structNode::change(), returnNode::change(), ptrNode::change(), procNode::change(), primNode::change(), operandNode::change(), metastmtNode::change(), metaexprNode::change(), labelNode::change(), initializerNode::change(), ifNode::change(), idNode::change(), gotoNode::change(), funcNode::change(), forNode::change(), exprstmtNode::change(), enumNode::change(), doNode::change(), declNode::change(), continueNode::change(), constNode::change(), conditiongotoNode::change(), commaNode::change(), castNode::change(), caseNode::change(), callNode::change(), breakNode::change(), blockNode::change(), binaryNode::change(), basicblockNode::change(), attribNode::change(), and arrayNode::change(). |
initializerNode * InitializerDismantle::strLit2Init |
( |
const char * |
|
) |
[private] |
|
Member Data Documentation
stack<blockNode *> InitializerDismantle::_blockStack [private]
|
|
The documentation for this class was generated from the following files:
|