OpenASIP  2.0
ControlDependenceEdge.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ControlDependenceEdge.hh
26  *
27  * Prototype of graph-based program representation: declaration of graph
28  * control dependence edge.
29  *
30  * @author Andrea Cilio 2005 (cilio-no.spam-cs.tut.fi)
31  * @author Vladimir Guzma 2006 (vladimir.guzma-no.spam-tut.fi)
32  * @note rating: red
33  */
34 
35 #ifndef TTA_CONTROL_DEPENDENCE_EDGE_HH
36 #define TTA_CONTROL_DEPENDENCE_EDGE_HH
37 
38 #include "GraphEdge.hh"
39 
40 /**
41  * Edge of the control dependence graph (control dependence edge). Each edge
42  * implies control dependency.
43  */
45 public:
46  friend class ProgramDependenceGraph;
47  enum CDGEdgeType {
52 
56 
57  virtual ~ControlDependenceEdge();
58 
59  TCEString toString() const;
60  bool isNormalEdge() const { return edgeType_ == CDEP_EDGE_NORMAL; }
61  bool isTrueEdge() const { return edgeType_ == CDEP_EDGE_TRUE; }
62  bool isFalseEdge() const { return edgeType_ == CDEP_EDGE_FALSE; }
63  bool isLoopCloseEdge() const { return edgeType_ == CDEP_EDGE_LOOPCLOSE;}
64  CDGEdgeType edgeType() const { return edgeType_; }
65 
66 protected:
67  void invertEdgePredicate();
68 private:
70 };
71 
72 #endif
ControlDependenceEdge::ControlDependenceEdge
ControlDependenceEdge(CDGEdgeType edgeType=CDEP_EDGE_NORMAL)
Definition: ControlDependenceEdge.hh:53
ControlDependenceEdge::CDEP_EDGE_LOOPCLOSE
@ CDEP_EDGE_LOOPCLOSE
Definition: ControlDependenceEdge.hh:51
GraphEdge.hh
ControlDependenceEdge::CDEP_EDGE_FALSE
@ CDEP_EDGE_FALSE
Definition: ControlDependenceEdge.hh:50
ControlDependenceEdge::isTrueEdge
bool isTrueEdge() const
Definition: ControlDependenceEdge.hh:61
ControlDependenceEdge::~ControlDependenceEdge
virtual ~ControlDependenceEdge()
Definition: ControlDependenceEdge.cc:37
ControlDependenceEdge
Definition: ControlDependenceEdge.hh:44
ControlDependenceEdge::toString
TCEString toString() const
Definition: ControlDependenceEdge.cc:44
ControlDependenceEdge::CDEP_EDGE_TRUE
@ CDEP_EDGE_TRUE
Definition: ControlDependenceEdge.hh:49
ControlDependenceEdge::edgeType_
CDGEdgeType edgeType_
Definition: ControlDependenceEdge.hh:69
ProgramDependenceGraph
Definition: ProgramDependenceGraph.hh:51
ControlDependenceEdge::CDEP_EDGE_NORMAL
@ CDEP_EDGE_NORMAL
Definition: ControlDependenceEdge.hh:48
ControlDependenceEdge::isFalseEdge
bool isFalseEdge() const
Definition: ControlDependenceEdge.hh:62
ControlDependenceEdge::invertEdgePredicate
void invertEdgePredicate()
Definition: ControlDependenceEdge.cc:64
ControlDependenceEdge::CDGEdgeType
CDGEdgeType
Definition: ControlDependenceEdge.hh:47
GraphEdge
Definition: GraphEdge.hh:52
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