OpenASIP  2.0
MoveNodeUse.icc
Go to the documentation of this file.
1 /**
2  * @file MoveNodeUse.icc
3  *
4  * Implementation of MoveNodeUse class.
5  *
6  * Wrapper class that contains data dependence information related to one
7  * data dependence induced by a MoveNode.
8  *
9  * Multiple MoveNodeUse objects can point to a single movenode.
10  * @author Heikki Kultala 2008 (hkultala@cs.tut.fi)
11  * @note rating: red
12  */
13 
14 
15 /**
16  * Comparison operator to be used when storing to maps and sets.
17  * @param other other MoveNodeUse to compare to.
18  */
19 bool MoveNodeUse::operator< (const MoveNodeUse& other) const {
20  if (mn_ == NULL) {
21  return false;
22  } else {
23  if (other.mn_ == NULL) {
24  return true;
25  }
26  }
27  if (mn_->nodeID() < other.mn_->nodeID()) return true;
28  if (mn_->nodeID() > other.mn_->nodeID()) return false;
29 
30  if (guard_ < other.guard_) return true;
31  if (guard_ > other.guard_) return false;
32 
33  if (ra_ < other.ra_) return true;
34  if (ra_ > other.ra_) return false;
35 
36  if (pseudo_ < other.pseudo_) return true;
37  if (pseudo_ > other.pseudo_) return false;
38 
39  // LOOP property ignored in this comparison - do not put same
40  // movenode twice, with both loop and no loop property.
41  // the order these are inserted into sets should take care the
42  // one without loop is priorized first.
43 
44  return false;
45 }
46 
47 /**
48  * Constructor.
49  * Copies from another movenodeuse, but may set loop property to true
50  * if a parameter given.
51  *
52  * @param mnu MoveNodeUse to copy.
53  * @param setLoopProperty whether to set loop property true for the copy.
54  */
55 MoveNodeUse::MoveNodeUse(const MoveNodeUse& mnu, BBRelation newBBRelation ) :
56  mn_(mnu.mn_), guard_(mnu.guard_), ra_(mnu.ra_), pseudo_(mnu.pseudo_),
57  bbRelation_((BBRelation)(mnu.bbRelation_ | newBBRelation)) {
58 }