PandA-2024.02
Public Types | Public Member Functions | Data Fields | Private Attributes
ssa_name Struct Reference

This struct specifies the ssa_name node. More...

#include <tree_node.hpp>

Inheritance diagram for ssa_name:
Inheritance graph
[legend]
Collaboration diagram for ssa_name:
Collaboration graph
[legend]

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_tuse_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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

visitor enum

Enumerator
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 

Definition at line 4643 of file tree_node.hpp.

Constructor & Destructor Documentation

◆ ssa_name()

ssa_name::ssa_name ( unsigned int  i)
explicit

constructor

Definition at line 1232 of file tree_node.cpp.

Member Function Documentation

◆ AddDefStmt()

void ssa_name::AddDefStmt ( const tree_nodeRef def)

Add a def stmt.

Parameters
defis a def statement.

Definition at line 1332 of file tree_node.cpp.

References def_stmts.

◆ AddUseStmt()

void ssa_name::AddUseStmt ( const tree_nodeRef use_stmt)

Add use of this SSA.

Parameters
statementis 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.

Here is the call graph for this function:

◆ CGetDefStmt()

const tree_nodeRef ssa_name::CGetDefStmt ( ) const

Return the def stmt (checking that is unique)

Returns
the definition statement

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CGetDefStmts()

const TreeNodeSet ssa_name::CGetDefStmts ( ) const

Return the set of definition statements.

Returns
the 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().

Here is the caller graph for this function:

◆ CGetNumberUses()

size_t ssa_name::CGetNumberUses ( ) const

Return the number of uses.

Returns
the number of uses

Definition at line 1348 of file tree_node.cpp.

References use_stmts.

Referenced by dead_code_elimination::InternalExec().

Here is the caller graph for this function:

◆ CGetUseStmts()

const TreeNodeMap< size_t > & ssa_name::CGetUseStmts ( ) const

Return the use stmts.

Returns
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().

Here is the caller graph for this function:

◆ RemoveUse()

void ssa_name::RemoveUse ( const tree_nodeRef use_stmt)

Remove a use of this SSA.

Parameters
use_stmtis 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.

Here is the call graph for this function:

◆ SetDefStmt()

void ssa_name::SetDefStmt ( const tree_nodeRef def)

Set the def stmt erasing the old definitions.

Parameters
ais a def statement.

Definition at line 1337 of file tree_node.cpp.

References def_stmts.

◆ visit()

void ssa_name::visit ( tree_node_visitor *const  v) const
overridevirtual

Redefinition of get_kind_text.

Redefinition of get_kind. virtual function used to traverse the tree_node data structure.

Parameters
vis 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().

Here is the caller graph for this function:

Field Documentation

◆ bit_values

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().

◆ def_stmts

TreeNodeSet ssa_name::def_stmts
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().

◆ default_flag

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().

◆ max

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().

◆ min

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().

◆ orig_vers

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().

◆ range

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().

◆ type

tree_nodeRef ssa_name::type

◆ use_set

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().

◆ use_stmts

TreeNodeMap<size_t> ssa_name::use_stmts
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().

◆ var

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().

◆ vers

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().

◆ virtual_flag

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().

◆ volatile_flag

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().


The documentation for this struct was generated from the following files:

Generated on Mon Feb 12 2024 13:04:03 for PandA-2024.02 by doxygen 1.8.13