OpenASIP  2.0
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
ControlDependenceEdge Class Reference

#include <ControlDependenceEdge.hh>

Inheritance diagram for ControlDependenceEdge:
Inheritance graph
Collaboration diagram for ControlDependenceEdge:
Collaboration graph

Public Types

enum  CDGEdgeType { CDEP_EDGE_NORMAL, CDEP_EDGE_TRUE, CDEP_EDGE_FALSE, CDEP_EDGE_LOOPCLOSE }
 

Public Member Functions

 ControlDependenceEdge (CDGEdgeType edgeType=CDEP_EDGE_NORMAL)
 
virtual ~ControlDependenceEdge ()
 
TCEString toString () const
 
bool isNormalEdge () const
 
bool isTrueEdge () const
 
bool isFalseEdge () const
 
bool isLoopCloseEdge () const
 
CDGEdgeType edgeType () const
 
- Public Member Functions inherited from GraphEdge
 GraphEdge ()
 
 GraphEdge (const GraphEdge &edge)
 
virtual GraphEdgeclone () const
 
virtual ~GraphEdge ()
 
virtual int edgeID () const
 
virtual TCEString dotString () const
 
virtual bool isBackEdge () const
 
int weight () const
 
void setWeight (int w)
 

Protected Member Functions

void invertEdgePredicate ()
 

Private Attributes

CDGEdgeType edgeType_
 

Friends

class ProgramDependenceGraph
 

Detailed Description

Edge of the control dependence graph (control dependence edge). Each edge implies control dependency.

Definition at line 44 of file ControlDependenceEdge.hh.

Member Enumeration Documentation

◆ CDGEdgeType

Enumerator
CDEP_EDGE_NORMAL 
CDEP_EDGE_TRUE 
CDEP_EDGE_FALSE 
CDEP_EDGE_LOOPCLOSE 

Definition at line 47 of file ControlDependenceEdge.hh.

Constructor & Destructor Documentation

◆ ControlDependenceEdge()

ControlDependenceEdge::ControlDependenceEdge ( CDGEdgeType  edgeType = CDEP_EDGE_NORMAL)
inline

Definition at line 53 of file ControlDependenceEdge.hh.

54  :

◆ ~ControlDependenceEdge()

ControlDependenceEdge::~ControlDependenceEdge ( )
virtual

Definition at line 37 of file ControlDependenceEdge.cc.

37 {}

Member Function Documentation

◆ edgeType()

CDGEdgeType ControlDependenceEdge::edgeType ( ) const
inline

Definition at line 64 of file ControlDependenceEdge.hh.

64 { return edgeType_; }

References edgeType_.

◆ invertEdgePredicate()

void ControlDependenceEdge::invertEdgePredicate ( )
protected

Inverts the predicate of the edge

Todo:
this should be handled better, after the ownership of CDG is moved into the PDG or so

Definition at line 64 of file ControlDependenceEdge.cc.

64  {
65  if (isNormalEdge()) {
66  return;
67  }
68  if (isTrueEdge()) {
70  } else {
72  }
73 }

References CDEP_EDGE_FALSE, CDEP_EDGE_TRUE, edgeType_, isNormalEdge(), and isTrueEdge().

Referenced by ProgramDependenceGraph::removeGuardedJump().

Here is the call graph for this function:

◆ isFalseEdge()

bool ControlDependenceEdge::isFalseEdge ( ) const
inline

◆ isLoopCloseEdge()

bool ControlDependenceEdge::isLoopCloseEdge ( ) const
inline

Definition at line 63 of file ControlDependenceEdge.hh.

63 { return edgeType_ == CDEP_EDGE_LOOPCLOSE;}

References CDEP_EDGE_LOOPCLOSE, and edgeType_.

Referenced by ProgramDependenceEdge::ProgramDependenceEdge(), and toString().

◆ isNormalEdge()

bool ControlDependenceEdge::isNormalEdge ( ) const
inline

Definition at line 60 of file ControlDependenceEdge.hh.

60 { return edgeType_ == CDEP_EDGE_NORMAL; }

References CDEP_EDGE_NORMAL, and edgeType_.

Referenced by invertEdgePredicate().

◆ isTrueEdge()

bool ControlDependenceEdge::isTrueEdge ( ) const
inline

◆ toString()

TCEString ControlDependenceEdge::toString ( ) const
virtual

Returns a predicate of edge as string.

Returns
The value of edge - true, false, neutral

Reimplemented from GraphEdge.

Definition at line 44 of file ControlDependenceEdge.cc.

44  {
45  TCEString label = "";
46  if (isTrueEdge()) {
47  label += "True";
48  }
49  if (isFalseEdge()) {
50  label += "False";
51  }
52  if (isLoopCloseEdge()) {
53  label += "Close";
54  }
55  return label;
56 }

References isFalseEdge(), isLoopCloseEdge(), and isTrueEdge().

Referenced by ProgramDependenceEdge::toString().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ProgramDependenceGraph

friend class ProgramDependenceGraph
friend

Definition at line 46 of file ControlDependenceEdge.hh.

Member Data Documentation

◆ edgeType_

CDGEdgeType ControlDependenceEdge::edgeType_
private

The documentation for this class was generated from the following files:
ControlDependenceEdge::CDEP_EDGE_LOOPCLOSE
@ CDEP_EDGE_LOOPCLOSE
Definition: ControlDependenceEdge.hh:51
ControlDependenceEdge::CDEP_EDGE_FALSE
@ CDEP_EDGE_FALSE
Definition: ControlDependenceEdge.hh:50
ControlDependenceEdge::isTrueEdge
bool isTrueEdge() const
Definition: ControlDependenceEdge.hh:61
ControlDependenceEdge::CDEP_EDGE_TRUE
@ CDEP_EDGE_TRUE
Definition: ControlDependenceEdge.hh:49
ControlDependenceEdge::edgeType_
CDGEdgeType edgeType_
Definition: ControlDependenceEdge.hh:69
ControlDependenceEdge::CDEP_EDGE_NORMAL
@ CDEP_EDGE_NORMAL
Definition: ControlDependenceEdge.hh:48
ControlDependenceEdge::isFalseEdge
bool isFalseEdge() const
Definition: ControlDependenceEdge.hh:62
TCEString
Definition: TCEString.hh:53
ControlDependenceEdge::edgeType
CDGEdgeType edgeType() const
Definition: ControlDependenceEdge.hh:64
ControlDependenceEdge::isLoopCloseEdge
bool isLoopCloseEdge() const
Definition: ControlDependenceEdge.hh:63
ControlDependenceEdge::isNormalEdge
bool isNormalEdge() const
Definition: ControlDependenceEdge.hh:60