Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CCDGNode Class Reference

#include <nodes.h>

Inheritance diagram for CCDGNode:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base class for code regions in CDG.


Public Member Functions

void Calculate_Segment_Times ()
 Recursively calculates the start time with respect to the start of the segment, end time from start of segment, and the duration of the segment.

 CCDGNode ()
virtual ~CCDGNode ()
 CCDGNode (CCDGNode &orig, CCDGNode &parent)
CCDGNodeCopy_Derived (CCDGNode &parent)
 CCDGNode (char *name)
bool Check (void)
void Add_Aliases (CLabelList *alias_list)
CStringListGet_Aliases ()
void PreTraverse_C_C (char *(*func)(char *, const char *), const char *char_arg)
void TraverseMethod_V_N (void(*func)(CCDGNode *), bool pre)
void TraverseMethod_V_N_N (void(*func)(CCDGNode *, CCDGNode *), CCDGNode *node_arg, bool pre)
void Set_Name (char *name)
char * Get_Name ()
char * Get_Type_String ()
void Print_Name_And_Type (ostream &s)
void Append_Suffix_To_Name (char *str)
void Append_Suffix_To_Name_For_Subgraph (const char *str)
void Append_Numbered_Suffix_To_Name (char *str, int n)
void Find_Blocking_IO_Loops ()
void Fix_Branch_Targets ()
void Fix_Short_Branches ()
void Label_Node (float *next_section)
void Label_This_Node (CCDGNode *prev_node)
void Append_LabelCell (TRUTH_VALUE_TYPE tv, float section, float section_end)
void Set_Label (char *label)
CLabelCellGet_Label ()
int Get_Size ()
int Get_SubgraphSize ()
virtual void Set_Size (void)
void Set_Size (int s)
CCDGNodeGet_Parent ()
void Set_Parent (CCDGNode *parent)
void Add_Child (CCDGNode *child, TRUTH_VALUE_TYPE tv, int hg_select=INVALID)
void Add_Children (CCDGNodeList *children, TRUTH_VALUE_TYPE tv, int hg_select=INVALID)
void Add_Child (char *name, NODE_TYPE type, TRUTH_VALUE_TYPE tv)
CCDGNodeClone_Child (CCDGNode *orig_child, CCDGNode *ref, POS_TYPE pos, TRUTH_VALUE_TYPE tv=TV_A)
bool Insert_Child (CCDGNode *new_child, CCDGNode *ref, bool before)
void Insert_Children (CCDGNodeList *new_children, CCDGNode *ref, bool before)
void Insert_Padding_Children (char *name_base, long cycles, TRUTH_VALUE_TYPE side, bool delay_loop_ok)
CCDGNodeListGet_Children ()
CCDGNodeListGet_First_Child (TRUTH_VALUE_TYPE tv=TV_ANY)
CCDGNodeListGet_Last_Child (TRUTH_VALUE_TYPE tv=TV_ANY, int hg_sel=INVALID)
bool Remove_Child (CCDGNode *victim)
bool Move_Child (CCDGNode *mover, bool to_end)
void Find_Children (CCDGNodeList *n)
bool Copy_And_Integrate_Subgraph (int target_time, CCDGNodeList *new_code, int seg_num)
CCDGNodeFind_Common_Ancestor (CCDGNode *n)
bool Has_Ancestor (CCDGNode *n)
TRUTH_VALUE_TYPE Find_Childs_TV (CCDGNode *n)
void Pr_Children ()
int Get_Num_Children (TRUTH_VALUE_TYPE tv)
CCDGNodeGet_Older_Sibling (bool in_same_loop=FALSE)
CCDGNodeGet_Younger_Sibling (bool same_parent=FALSE)
CCDGNodeGet_Older_Sibling (bool same_parent, int h_or_g, bool RT)
CCDGNodeGet_Sibling_At (CTimeRange *t)
CLoopGet_Enclosing_Loop ()
bool Reaches (CCDGNode *that)
bool Dominates (CCDGNode *that)
TRUTH_VALUE_TYPE Find_TV ()
CProcGet_Procedure ()
void Set_Procedure (CProc *p)
void Set_Procedure_For_Subgraph (CProc *p)
int Get_SerNum ()
CTimeRangeGet_Start ()
CTimeRangeGet_End ()
CCDGNodeSplit (long when)
void Set_Start (CTimeRange tr)
void Set_TargetTime (long cy)
long Get_TargetTime ()
CTimeRangeGet_Duration (bool include_unknown_loop_iter=FALSE)
void Mark_as_Host ()
void Mark_as_Guest ()
void Mark_Subgraph_as_Guest ()
void Mark_HorG (int which)
int Get_HorG ()
bool Is_Host ()
bool Is_Guest ()
bool Is_Program_Halt ()
void Mark_as_RT ()
void Mark_as_NRT ()
bool Get_RT ()
bool Is_RT ()
bool Is_NRT ()
bool Ends_In_Uncond_Branch ()
CDirGet_PrecedingDirs ()
CDirGet_FollowingDirs ()
void Add_PrecedingDir (char *text)
void Add_FollowingDir (char *text)
void Add_PrecedingDir (CDir *Directive)
void Add_FollowingDir (CDir *Directive)
INT_OVHD_TYPE Get_IntOvhdType ()
void Set_IntOvhdType (INT_OVHD_TYPE ov)
void Mark_If_Discrete_Guest ()
void Gen_Graph (ofstream &ostream, int level)
void Output_Debug (ostream &stream, bool do_full=TRUE)
void Output_Code (ostream &stream)
void Output_VCG (ostream &stream)
void Pr_Info ()
void Pr_Name (bool t)
NODE_TYPE Get_Type ()
void Set_Type (NODE_TYPE type)
void Pr_Type ()
void Set_Visited (bool v)
bool Get_Visited ()
bool Is_DFS_Visited ()
void Set_DFS_Visited ()
void Set_HorPos (int hp)
int Get_HorPos ()
void Calculate_Node_Duration (bool include_guests=TRUE)
void Calculate_Node_Start (CTimeRange *par_start, bool include_guests=TRUE)
 TODO: Put a description here.

void Find_Hosts (CTimeRange *Target, CGuestInfo *RII)
void Delete_Following_Guests ()
void Delete_This_And_Following_Guests (void)
CLoopFind_First_Loop (long t_start, long t_stop)
void Summarize_Register_DefUse_Info ()
void Find_Vars ()
bool Always_Defined (int reg)
CRegAccessGet_RegDef ()
CRegAccessGet_RegUse ()
CVarFind_Prev_Ref (int reg, CInstr *instr, bool local_instr, bool look_across_loop_back, bool skip_this_node)
void Analyze_Instruction (CInstr *instr)
int Get_NumInstrs ()
long Pad (long padding_needed)
void Set_Node_Jump_Target (char *target)
void Insert_Padding (char *name_base, long cycles, bool pad_before, bool delay_loop_ok)
CCDGNodeListCreate_Padding_Nodes (char *name, long amount)
CCDGNodeGet_Copy ()
CCDGNodeGet_Copy (CCDGNode *parent)
CCDGNodeGet_Last_Copy ()
CCDGNodeListGuard (int reg, int bit, bool skip_if_set, int cond_br_type)
CCDGNodeFind_FSM_Loop ()
void Debug_Final_Step (int n, CCDGNode *parent, TRUTH_VALUE_TYPE tv)
CCDGNodeGet_Sibling_Before (CCDGNode *node, bool before)
 This fucntion returns the pointer to the CCDGNode which is either the sibling before or after this node in the current tree hierarchy, depending on the whether before is true or false.

void Embed_CSource ()

Public Attributes

std::string * Pre_Comments
std::string * Post_Comments

Protected Attributes

char Name [STR_SIZE]
 Name of this node (basic block label).

CStringListAliases
 Other names for the node (for stabs).

int HorG
 Host or Guest?

CTimeRange Duration
 Duration of node/subgraph in cycles.

CTimeRange Start
 Start and end times of node/subgraph in cycles.

CTimeRange End
 Start and end times of node/subgraph in cycles.

CLabelCellLabel
 Label describing position of node in graph.

bool RT
 Does this node have real-time requirements?

long TargetTime
 Target execution time of this node.

NODE_TYPE Type
 Type of node: CPred, etc.

INT_OVHD_TYPE IntOvhdType
 If this is integration overhead, what type? Padding, etc.

int SerNum
 Unique sequential serial number of node.

CCDGNodeParent
 Parent of this in CDG.

CProcProcedure
 The procedure containing this.

CCDGNodeListChildren
 All children of this node.

bool Visited
 Used for traversal to avoid loops.

bool DFS_Visited
 Used for DFS traversal to avoid loops.

int HorPos
 Horizontal position used during VCG/GDL graph construction.

CRegAccess RegDef
 Registers defined and used by this node/subgraph.

CRegAccess RegUse
 Registers defined and used by this node/subgraph.

CDirPrecedingDirs
 Preceding and following directives from assembly code.

CDirFollowingDirs
 Preceding and following directives from assembly code.

CCDGNodeCopy
 If a copy of this node was made, this is it.

int Size
 Code size of this node, not including subgraph, in bytes.

int SubgraphSize
 Code size of this node, including subgraph, in bytes.

vector< string > CSourceLines
 C source code associated with this.


Private Attributes

bool SegTimeVisited
 Have segment times been calculated for this node?

CTimeRange StartTimeFromSegmentStart
 Holds the start time from the start of the segment.

CTimeRange EndTimeFromSegmentStart
 Holds the end time from the start of a segment.


Constructor & Destructor Documentation

CCDGNode::CCDGNode  ) 
 

virtual CCDGNode::~CCDGNode  )  [inline, virtual]
 

CCDGNode::CCDGNode CCDGNode orig,
CCDGNode parent
 

CCDGNode::CCDGNode char *  name  ) 
 


Member Function Documentation

void CCDGNode::Add_Aliases CLabelList *  alias_list  ) 
 

void CCDGNode::Add_Child char *  name,
NODE_TYPE  type,
TRUTH_VALUE_TYPE  tv
 

void CCDGNode::Add_Child CCDGNode child,
TRUTH_VALUE_TYPE  tv,
int  hg_select = INVALID
 

void CCDGNode::Add_Children CCDGNodeList children,
TRUTH_VALUE_TYPE  tv,
int  hg_select = INVALID
 

void CCDGNode::Add_FollowingDir CDir Directive  ) 
 

void CCDGNode::Add_FollowingDir char *  text  ) 
 

void CCDGNode::Add_PrecedingDir CDir Directive  ) 
 

void CCDGNode::Add_PrecedingDir char *  text  ) 
 

bool CCDGNode::Always_Defined int  reg  ) 
 

void CCDGNode::Analyze_Instruction CInstr *  instr  ) 
 

void CCDGNode::Append_LabelCell TRUTH_VALUE_TYPE  tv,
float  section,
float  section_end
 

void CCDGNode::Append_Numbered_Suffix_To_Name char *  str,
int  n
 

void CCDGNode::Append_Suffix_To_Name char *  str  ) 
 

void CCDGNode::Append_Suffix_To_Name_For_Subgraph const char *  str  ) 
 

void CCDGNode::Calculate_Node_Duration bool  include_guests = TRUE  ) 
 

Reimplemented in CPred, and CLoop.

void CCDGNode::Calculate_Node_Start CTimeRange par_start,
bool  include_guests = TRUE
 

TODO: Put a description here.

Warning: This function should only be called on the first child of the parent.

void CCDGNode::Calculate_Segment_Times  ) 
 

Recursively calculates the start time with respect to the start of the segment, end time from start of segment, and the duration of the segment.

Segments are ended by cocalls.

Sideeffect: Sets SegTimeVisited to true for every node that is touched.

Note: This function is not threadsafe.

bool CCDGNode::Check void   ) 
 

CCDGNode * CCDGNode::Clone_Child CCDGNode orig_child,
CCDGNode ref,
POS_TYPE  pos,
TRUTH_VALUE_TYPE  tv = TV_A
 

bool CCDGNode::Copy_And_Integrate_Subgraph int  target_time,
CCDGNodeList new_code,
int  seg_num
 

Reimplemented in CLoop.

CCDGNode * CCDGNode::Copy_Derived CCDGNode parent  ) 
 

CCDGNodeList * CCDGNode::Create_Padding_Nodes char *  name,
long  amount
 

void CCDGNode::Debug_Final_Step int  n,
CCDGNode parent,
TRUTH_VALUE_TYPE  tv
 

void CCDGNode::Delete_Following_Guests  ) 
 

void CCDGNode::Delete_This_And_Following_Guests void   ) 
 

bool CCDGNode::Dominates CCDGNode that  ) 
 

void CCDGNode::Embed_CSource  ) 
 

bool CCDGNode::Ends_In_Uncond_Branch  ) 
 

void CCDGNode::Find_Blocking_IO_Loops  ) 
 

void CCDGNode::Find_Children CCDGNodeList n  ) 
 

TRUTH_VALUE_TYPE CCDGNode::Find_Childs_TV CCDGNode n  ) 
 

CCDGNode * CCDGNode::Find_Common_Ancestor CCDGNode n  ) 
 

CLoop* CCDGNode::Find_First_Loop long  t_start,
long  t_stop
 

CCDGNode * CCDGNode::Find_FSM_Loop  ) 
 

void CCDGNode::Find_Hosts CTimeRange Target,
CGuestInfo RII
 

Reimplemented in CLoop.

CVar * CCDGNode::Find_Prev_Ref int  reg,
CInstr *  instr,
bool  local_instr,
bool  look_across_loop_back,
bool  skip_this_node
 

TRUTH_VALUE_TYPE CCDGNode::Find_TV  )  [inline]
 

void CCDGNode::Find_Vars  ) 
 

void CCDGNode::Fix_Branch_Targets  ) 
 

void CCDGNode::Fix_Short_Branches  ) 
 

void CCDGNode::Gen_Graph ofstream &  ostream,
int  level
 

CStringList* CCDGNode::Get_Aliases  )  [inline]
 

CCDGNodeList* CCDGNode::Get_Children  )  [inline]
 

CCDGNode * CCDGNode::Get_Copy CCDGNode parent  ) 
 

CCDGNode* CCDGNode::Get_Copy  )  [inline]
 

CTimeRange* CCDGNode::Get_Duration bool  include_unknown_loop_iter = FALSE  )  [inline]
 

Reimplemented in CCode, and CLoop.

CLoop * CCDGNode::Get_Enclosing_Loop  ) 
 

CTimeRange* CCDGNode::Get_End  )  [inline]
 

CCDGNodeList * CCDGNode::Get_First_Child TRUTH_VALUE_TYPE  tv = TV_ANY  ) 
 

CDir* CCDGNode::Get_FollowingDirs  )  [inline]
 

int CCDGNode::Get_HorG  )  [inline]
 

int CCDGNode::Get_HorPos  )  [inline]
 

INT_OVHD_TYPE CCDGNode::Get_IntOvhdType  )  [inline]
 

CLabelCell* CCDGNode::Get_Label  )  [inline]
 

CCDGNodeList * CCDGNode::Get_Last_Child TRUTH_VALUE_TYPE  tv = TV_ANY,
int  hg_sel = INVALID
 

CCDGNode * CCDGNode::Get_Last_Copy  ) 
 

char* CCDGNode::Get_Name  )  [inline]
 

int CCDGNode::Get_Num_Children TRUTH_VALUE_TYPE  tv  ) 
 

int CCDGNode::Get_NumInstrs  ) 
 

Reimplemented in CCode, and CProc.

CCDGNode * CCDGNode::Get_Older_Sibling bool  same_parent,
int  h_or_g,
bool  RT
 

CCDGNode * CCDGNode::Get_Older_Sibling bool  in_same_loop = FALSE  ) 
 

CCDGNode* CCDGNode::Get_Parent  )  [inline]
 

CDir* CCDGNode::Get_PrecedingDirs  )  [inline]
 

CProc* CCDGNode::Get_Procedure  )  [inline]
 

CRegAccess* CCDGNode::Get_RegDef  )  [inline]
 

CRegAccess* CCDGNode::Get_RegUse  )  [inline]
 

bool CCDGNode::Get_RT  )  [inline]
 

int CCDGNode::Get_SerNum  )  [inline]
 

CCDGNode * CCDGNode::Get_Sibling_At CTimeRange t  ) 
 

CCDGNode * CCDGNode::Get_Sibling_Before CCDGNode node,
bool  before
 

This fucntion returns the pointer to the CCDGNode which is either the sibling before or after this node in the current tree hierarchy, depending on the whether before is true or false.

int CCDGNode::Get_Size  )  [inline]
 

CTimeRange* CCDGNode::Get_Start  )  [inline]
 

int CCDGNode::Get_SubgraphSize  )  [inline]
 

long CCDGNode::Get_TargetTime  )  [inline]
 

NODE_TYPE CCDGNode::Get_Type  )  [inline]
 

char* CCDGNode::Get_Type_String  )  [inline]
 

bool CCDGNode::Get_Visited  )  [inline]
 

CCDGNode * CCDGNode::Get_Younger_Sibling bool  same_parent = FALSE  ) 
 

CCDGNodeList * CCDGNode::Guard int  reg,
int  bit,
bool  skip_if_set,
int  cond_br_type
 

bool CCDGNode::Has_Ancestor CCDGNode n  ) 
 

bool CCDGNode::Insert_Child CCDGNode new_child,
CCDGNode ref,
bool  before
 

void CCDGNode::Insert_Children CCDGNodeList new_children,
CCDGNode ref,
bool  before
 

void CCDGNode::Insert_Padding char *  name_base,
long  cycles,
bool  pad_before,
bool  delay_loop_ok
 

void CCDGNode::Insert_Padding_Children char *  name_base,
long  cycles,
TRUTH_VALUE_TYPE  side,
bool  delay_loop_ok
 

bool CCDGNode::Is_DFS_Visited  )  [inline]
 

bool CCDGNode::Is_Guest  )  [inline]
 

bool CCDGNode::Is_Host  )  [inline]
 

bool CCDGNode::Is_NRT  )  [inline]
 

bool CCDGNode::Is_Program_Halt  ) 
 

bool CCDGNode::Is_RT  )  [inline]
 

void CCDGNode::Label_Node float *  next_section  ) 
 

void CCDGNode::Label_This_Node CCDGNode prev_node  ) 
 

void CCDGNode::Mark_as_Guest  )  [inline]
 

void CCDGNode::Mark_as_Host  )  [inline]
 

void CCDGNode::Mark_as_NRT  )  [inline]
 

void CCDGNode::Mark_as_RT  )  [inline]
 

void CCDGNode::Mark_HorG int  which  )  [inline]
 

void CCDGNode::Mark_If_Discrete_Guest  ) 
 

void CCDGNode::Mark_Subgraph_as_Guest  ) 
 

bool CCDGNode::Move_Child CCDGNode mover,
bool  to_end
 

void CCDGNode::Output_Code ostream &  stream  ) 
 

Reimplemented in CCode, CPred, CLoop, CProc, and CCall.

void CCDGNode::Output_Debug ostream &  stream,
bool  do_full = TRUE
 

void CCDGNode::Output_VCG ostream &  stream  ) 
 

Reimplemented in CCode, CPred, and CCall.

long CCDGNode::Pad long  padding_needed  ) 
 

Reimplemented in CPred, and CLoop.

void CCDGNode::Pr_Children  ) 
 

void CCDGNode::Pr_Info  ) 
 

void CCDGNode::Pr_Name bool  t  ) 
 

void CCDGNode::Pr_Type  ) 
 

void CCDGNode::PreTraverse_C_C char *(*  func)(char *, const char *),
const char *  char_arg
 

void CCDGNode::Print_Name_And_Type ostream &  s  )  [inline]
 

bool CCDGNode::Reaches CCDGNode that  ) 
 

bool CCDGNode::Remove_Child CCDGNode victim  ) 
 

void CCDGNode::Set_DFS_Visited  )  [inline]
 

void CCDGNode::Set_HorPos int  hp  )  [inline]
 

void CCDGNode::Set_IntOvhdType INT_OVHD_TYPE  ov  )  [inline]
 

void CCDGNode::Set_Label char *  label  )  [inline]
 

void CCDGNode::Set_Name char *  name  )  [inline]
 

void CCDGNode::Set_Node_Jump_Target char *  target  ) 
 

void CCDGNode::Set_Parent CCDGNode parent  )  [inline]
 

void CCDGNode::Set_Procedure CProc p  ) 
 

void CCDGNode::Set_Procedure_For_Subgraph CProc p  ) 
 

void CCDGNode::Set_Size int  s  )  [inline]
 

void CCDGNode::Set_Size void   )  [virtual]
 

Reimplemented in CCode, CPred, CMultiPred, CLoop, CIrrLoop, CProc, and CCall.

void CCDGNode::Set_Start CTimeRange  tr  )  [inline]
 

void CCDGNode::Set_TargetTime long  cy  )  [inline]
 

void CCDGNode::Set_Type NODE_TYPE  type  )  [inline]
 

void CCDGNode::Set_Visited bool  v  )  [inline]
 

CCDGNode * CCDGNode::Split long  when  ) 
 

void CCDGNode::Summarize_Register_DefUse_Info  ) 
 

void CCDGNode::TraverseMethod_V_N void(*  func)(CCDGNode *),
bool  pre
 

void CCDGNode::TraverseMethod_V_N_N void(*  func)(CCDGNode *, CCDGNode *),
CCDGNode node_arg,
bool  pre
 


Member Data Documentation

CStringList* CCDGNode::Aliases [protected]
 

Other names for the node (for stabs).

CCDGNodeList* CCDGNode::Children [protected]
 

All children of this node.

CCDGNode* CCDGNode::Copy [protected]
 

If a copy of this node was made, this is it.

vector<string> CCDGNode::CSourceLines [protected]
 

C source code associated with this.

bool CCDGNode::DFS_Visited [protected]
 

Used for DFS traversal to avoid loops.

CTimeRange CCDGNode::Duration [protected]
 

Duration of node/subgraph in cycles.

CTimeRange CCDGNode::End [protected]
 

Start and end times of node/subgraph in cycles.

CTimeRange CCDGNode::EndTimeFromSegmentStart [private]
 

Holds the end time from the start of a segment.

Cocalls end segments.

CDir * CCDGNode::FollowingDirs [protected]
 

Preceding and following directives from assembly code.

int CCDGNode::HorG [protected]
 

Host or Guest?

int CCDGNode::HorPos [protected]
 

Horizontal position used during VCG/GDL graph construction.

INT_OVHD_TYPE CCDGNode::IntOvhdType [protected]
 

If this is integration overhead, what type? Padding, etc.

CLabelCell* CCDGNode::Label [protected]
 

Label describing position of node in graph.

char CCDGNode::Name[STR_SIZE] [protected]
 

Name of this node (basic block label).

CCDGNode* CCDGNode::Parent [protected]
 

Parent of this in CDG.

std::string* CCDGNode::Post_Comments
 

std::string* CCDGNode::Pre_Comments
 

CDir* CCDGNode::PrecedingDirs [protected]
 

Preceding and following directives from assembly code.

CProc* CCDGNode::Procedure [protected]
 

The procedure containing this.

CRegAccess CCDGNode::RegDef [protected]
 

Registers defined and used by this node/subgraph.

CRegAccess CCDGNode::RegUse [protected]
 

Registers defined and used by this node/subgraph.

bool CCDGNode::RT [protected]
 

Does this node have real-time requirements?

bool CCDGNode::SegTimeVisited [private]
 

Have segment times been calculated for this node?

int CCDGNode::SerNum [protected]
 

Unique sequential serial number of node.

This is useful for debugging.

int CCDGNode::Size [protected]
 

Code size of this node, not including subgraph, in bytes.

CTimeRange CCDGNode::Start [protected]
 

Start and end times of node/subgraph in cycles.

CTimeRange CCDGNode::StartTimeFromSegmentStart [private]
 

Holds the start time from the start of the segment.

Cocalls end segments.

int CCDGNode::SubgraphSize [protected]
 

Code size of this node, including subgraph, in bytes.

long CCDGNode::TargetTime [protected]
 

Target execution time of this node.

NODE_TYPE CCDGNode::Type [protected]
 

Type of node: CPred, etc.

bool CCDGNode::Visited [protected]
 

Used for traversal to avoid loops.

Reimplemented in CCode.


The documentation for this class was generated from the following files:
Generated on Sat May 8 14:08:58 2004 for Thrint by doxygen 1.3.6