PandA-2024.02
|
This struct specifies the ssa_name node. More...
#include <tree_node.hpp>
Public Types | |
enum | { GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0 } |
visitor enum More... | |
Public Member Functions | |
ssa_name (unsigned int i) | |
constructor More... | |
void | AddUseStmt (const tree_nodeRef &use_stmt) |
Add use of this SSA. More... | |
const TreeNodeMap< size_t > & | CGetUseStmts () const |
Return the use stmts. More... | |
size_t | CGetNumberUses () const |
Return the number of uses. More... | |
void | RemoveUse (const tree_nodeRef &use_stmt) |
Remove a use of this SSA. More... | |
void | SetDefStmt (const tree_nodeRef &def) |
Set the def stmt erasing the old definitions. More... | |
void | AddDefStmt (const tree_nodeRef &def) |
Add a def stmt. More... | |
void | visit (tree_node_visitor *const v) const override |
Redefinition of get_kind_text. More... | |
const tree_nodeRef | CGetDefStmt () const |
Return the def stmt (checking that is unique) More... | |
const TreeNodeSet | CGetDefStmts () const |
Return the set of definition statements. More... | |
Public Member Functions inherited from tree_node | |
tree_node (unsigned int i) | |
Constructor. More... | |
virtual | ~tree_node ()=default |
Destructor. More... | |
virtual enum kind | get_kind () const =0 |
Virtual function returning the type of the actual class. More... | |
virtual std::string | get_kind_text () const =0 |
Virtual function returning the name of the actual class. More... | |
std::string | ToString () const |
Print this node as string in gimple format. More... | |
Data Fields | |
tree_nodeRef | type |
starting from GCC 4.7.2 ssa_name has a type More... | |
tree_nodeRef | var |
var is the variable being referenced (macro SSA_NAME_VAR). More... | |
unsigned int | vers |
vers is the SSA version number of this SSA name. More... | |
unsigned int | orig_vers |
original SSA version number from GCC More... | |
bool | volatile_flag |
in case a ssa_name is never defined this Boolean member is true More... | |
bool | virtual_flag |
flag for virtual SSA More... | |
bool | default_flag |
Nonzero if this SSA_NAME is the default definition for the underlying symbol. More... | |
tree_nodeRef | min |
minimum values this SSA may reach More... | |
tree_nodeRef | max |
maximum values this SSA may reach More... | |
std::string | bit_values |
for each bit of the SSA variable tells if it is equal to U,X,0,1 More... | |
RangeRef | range |
Range information about numerical values of the SSA variable. More... | |
PointToSolutionRef | use_set |
point to solution More... | |
Data Fields inherited from tree_node | |
const unsigned int | index |
Represent the index read from the raw file and the index-1 of the vector of tree_node associated to the functions vector present in the tree_manager. More... | |
Private Attributes | |
TreeNodeMap< size_t > | use_stmts |
The uses of this SSA: it is a map since the same SSA can be used multiple times in the same statement Key is the index of the tree node instead of tree node because in this way gimple_node can updated uses of a SSA without using the tree manager to get the tree re-index of itself. More... | |
TreeNodeSet | def_stmts |
in case ssa_name is not volatile the statement which defines it; statements could be more than one because of gimple_phi splitting More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from tree_node | |
static enum kind | get_kind (const std::string &name) |
Given a string, return the corresponding kind. More... | |
static std::string | GetString (const enum kind k) |
Given a kind, return the corresponding string. More... | |
This struct specifies the ssa_name node.
Variable references for SSA analysis. New SSA names are created every time a variable is assigned a new value. The SSA builder uses SSA_NAME nodes to implement SSA versioning. The tree walker structure of this node is: #(TOK_SSA_NAME var vers)
Definition at line 4523 of file tree_node.hpp.
anonymous enum |
visitor enum
Enumerator | |
---|---|
GETID | |
GETID | |
GETID | |
GETID | |
GETID | |
GETID | |
GETID |
Definition at line 4643 of file tree_node.hpp.
|
explicit |
constructor
Definition at line 1232 of file tree_node.cpp.
void ssa_name::AddDefStmt | ( | const tree_nodeRef & | def | ) |
Add a def stmt.
def | is a def statement. |
Definition at line 1332 of file tree_node.cpp.
References def_stmts.
void ssa_name::AddUseStmt | ( | const tree_nodeRef & | use_stmt | ) |
Add use of this SSA.
statement | is the statement which used this SSA |
Definition at line 1279 of file tree_node.cpp.
References GET_CONST_NODE, tree_node::index, STR, THROW_UNREACHABLE, tree_node::ToString(), use_stmts, and virtual_flag.
const tree_nodeRef ssa_name::CGetDefStmt | ( | ) | const |
Return the def stmt (checking that is unique)
Definition at line 1256 of file tree_node.cpp.
References def_stmts, STR, THROW_ASSERT, THROW_UNREACHABLE, and tree_node::ToString().
Referenced by soft_float_cg_ext::ssa_lowering().
const TreeNodeSet ssa_name::CGetDefStmts | ( | ) | const |
Return the set of definition statements.
Definition at line 1274 of file tree_node.cpp.
References def_stmts.
Referenced by dead_code_elimination::InternalExec(), and raw_writer::write_when_not_null_point_to().
size_t ssa_name::CGetNumberUses | ( | ) | const |
Return the number of uses.
Definition at line 1348 of file tree_node.cpp.
References use_stmts.
Referenced by dead_code_elimination::InternalExec().
const TreeNodeMap< size_t > & ssa_name::CGetUseStmts | ( | ) | const |
Return the use stmts.
Definition at line 1343 of file tree_node.cpp.
References use_stmts.
Referenced by dead_code_elimination::InternalExec(), Bit_Value_opt::propagateValue(), soft_float_cg_ext::ssa_lowering(), and raw_writer::write_when_not_null_point_to().
void ssa_name::RemoveUse | ( | const tree_nodeRef & | use_stmt | ) |
Remove a use of this SSA.
use_stmt | is the statement which uses this SSA |
Definition at line 1358 of file tree_node.cpp.
References INDENT_DBG_MEX, STR, THROW_UNREACHABLE, tree_node::ToString(), and use_stmts.
void ssa_name::SetDefStmt | ( | const tree_nodeRef & | def | ) |
Set the def stmt erasing the old definitions.
a | is a def statement. |
Definition at line 1337 of file tree_node.cpp.
References def_stmts.
|
overridevirtual |
Redefinition of get_kind_text.
Redefinition of get_kind. virtual function used to traverse the tree_node data structure.
v | is a reference to the tree_node visitor class |
Reimplemented from tree_node.
Definition at line 1243 of file tree_node.cpp.
References ALL_VISIT, def_stmts, max, min, SEQ_VISIT_MEMBER, type, use_set, var, VISIT_MEMBER, and VISIT_SC.
Referenced by GimpleWriter::GimpleWriter(), statement_list::visit(), string_cst::visit(), gimple_switch::visit(), target_expr::visit(), template_decl::visit(), template_parm_index::visit(), tree_list::visit(), tree_vec::visit(), try_block::visit(), type_decl::visit(), union_type::visit(), and lut_expr::visit().
std::string ssa_name::bit_values |
for each bit of the SSA variable tells if it is equal to U,X,0,1
Definition at line 4598 of file tree_node.hpp.
Referenced by Bit_Value_opt::constrainSSA(), VarNode::updateIR(), and raw_writer::write_when_not_null_point_to().
|
private |
in case ssa_name is not volatile the statement which defines it; statements could be more than one because of gimple_phi splitting
Definition at line 4533 of file tree_node.hpp.
Referenced by AddDefStmt(), CGetDefStmt(), CGetDefStmts(), SetDefStmt(), and visit().
bool ssa_name::default_flag |
Nonzero if this SSA_NAME is the default definition for the underlying symbol.
A default SSA name is created for symbol S if the very first reference to S in the function is a read operation. Default definitions are always created by an empty statement and belong to no basic block.
Definition at line 4565 of file tree_node.hpp.
Referenced by GimpleWriter::GimpleWriter(), and raw_writer::write_when_not_null_point_to().
tree_nodeRef ssa_name::max |
maximum values this SSA may reach
Definition at line 4595 of file tree_node.hpp.
Referenced by Bit_Value_opt::constrainSSA(), visit(), and raw_writer::write_when_not_null_point_to().
tree_nodeRef ssa_name::min |
minimum values this SSA may reach
Definition at line 4592 of file tree_node.hpp.
Referenced by Bit_Value_opt::constrainSSA(), visit(), and raw_writer::write_when_not_null_point_to().
unsigned int ssa_name::orig_vers |
original SSA version number from GCC
Definition at line 4550 of file tree_node.hpp.
Referenced by GimpleWriter::GimpleWriter(), and raw_writer::write_when_not_null_point_to().
RangeRef ssa_name::range |
Range information about numerical values of the SSA variable.
Definition at line 4601 of file tree_node.hpp.
Referenced by Bit_Value_opt::constrainSSA().
tree_nodeRef ssa_name::type |
starting from GCC 4.7.2 ssa_name has a type
Definition at line 4540 of file tree_node.hpp.
Referenced by Bit_Value_opt::constrainSSA(), GimpleWriter::GimpleWriter(), soft_float_cg_ext::lowering_needed(), soft_float_cg_ext::ssa_lowering(), VarNode::updateIR(), visit(), template_parm_index::visit(), and raw_writer::write_when_not_null_point_to().
PointToSolutionRef ssa_name::use_set |
point to solution
Definition at line 4604 of file tree_node.hpp.
Referenced by visit(), and raw_writer::write_when_not_null_point_to().
|
private |
The uses of this SSA: it is a map since the same SSA can be used multiple times in the same statement Key is the index of the tree node instead of tree node because in this way gimple_node can updated uses of a SSA without using the tree manager to get the tree re-index of itself.
Definition at line 4529 of file tree_node.hpp.
Referenced by AddUseStmt(), CGetNumberUses(), CGetUseStmts(), and RemoveUse().
tree_nodeRef ssa_name::var |
var is the variable being referenced (macro SSA_NAME_VAR).
Definition at line 4543 of file tree_node.hpp.
Referenced by GimpleWriter::GimpleWriter(), VarDeclFix::recursive_examinate(), soft_float_cg_ext::ssa_lowering(), visit(), and raw_writer::write_when_not_null_point_to().
unsigned int ssa_name::vers |
vers is the SSA version number of this SSA name.
(macro SSA_NAME_VERSION). Note that in tree SSA, version numbers are not per variable and may be recycled
Definition at line 4547 of file tree_node.hpp.
Referenced by GimpleWriter::GimpleWriter(), and raw_writer::write_when_not_null_point_to().
bool ssa_name::virtual_flag |
flag for virtual SSA
Definition at line 4556 of file tree_node.hpp.
Referenced by AddUseStmt(), and raw_writer::write_when_not_null_point_to().
bool ssa_name::volatile_flag |
in case a ssa_name is never defined this Boolean member is true
Definition at line 4553 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().