OpenASIP  2.0
ControlDependenceEdge.cc
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.cc
26  *
27  * Prototype of graph-based program representation: implementation 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 #include "ControlDependenceEdge.hh"
36 
38 
39 /**
40  * Returns a predicate of edge as string.
41  * @return The value of edge - true, false, neutral
42  */
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 }
57 
58 /**
59  * Inverts the predicate of the edge
60  * @todo this should be handled better, after the ownership of CDG is moved
61  * into the PDG or so
62  */
63 void
65  if (isNormalEdge()) {
66  return;
67  }
68  if (isTrueEdge()) {
70  } else {
72  }
73 }
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::toString
TCEString toString() const
Definition: ControlDependenceEdge.cc:44
ControlDependenceEdge::CDEP_EDGE_TRUE
@ CDEP_EDGE_TRUE
Definition: ControlDependenceEdge.hh:49
ControlDependenceEdge.hh
ControlDependenceEdge::edgeType_
CDGEdgeType edgeType_
Definition: ControlDependenceEdge.hh:69
ControlDependenceEdge::isFalseEdge
bool isFalseEdge() const
Definition: ControlDependenceEdge.hh:62
ControlDependenceEdge::invertEdgePredicate
void invertEdgePredicate()
Definition: ControlDependenceEdge.cc:64
TCEString
Definition: TCEString.hh:53
ControlDependenceEdge::isLoopCloseEdge
bool isLoopCloseEdge() const
Definition: ControlDependenceEdge.hh:63
ControlDependenceEdge::isNormalEdge
bool isNormalEdge() const
Definition: ControlDependenceEdge.hh:60