2 * @file MoveNodeUse.icc
4 * Implementation of MoveNodeUse class.
6 * Wrapper class that contains data dependence information related to one
7 * data dependence induced by a MoveNode.
9 * Multiple MoveNodeUse objects can point to a single movenode.
10 * @author Heikki Kultala 2008 (hkultala@cs.tut.fi)
16 * Comparison operator to be used when storing to maps and sets.
17 * @param other other MoveNodeUse to compare to.
19 bool MoveNodeUse::operator< (const MoveNodeUse& other) const {
23 if (other.mn_ == NULL) {
27 if (mn_->nodeID() < other.mn_->nodeID()) return true;
28 if (mn_->nodeID() > other.mn_->nodeID()) return false;
30 if (guard_ < other.guard_) return true;
31 if (guard_ > other.guard_) return false;
33 if (ra_ < other.ra_) return true;
34 if (ra_ > other.ra_) return false;
36 if (pseudo_ < other.pseudo_) return true;
37 if (pseudo_ > other.pseudo_) return false;
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.
49 * Copies from another movenodeuse, but may set loop property to true
50 * if a parameter given.
52 * @param mnu MoveNodeUse to copy.
53 * @param setLoopProperty whether to set loop property true for the copy.
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)) {