OpenASIP  2.0
MoveNodeUse.hh
Go to the documentation of this file.
1 /**
2  * @file MoveNodeUse.hh
3  *
4  * Declaration 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 #ifndef MOVENODEUSE_HH
15 #define MOVENODEUSE_HH
16 
17 #include "MoveNode.hh"
18 
19 
20 class MoveNodeUse {
21 public:
22 
23  enum BBRelation {
24  INTRA_BB = 0,
25  INTER_BB = 1,
26  LOOP = 3
27  };
28 
29  MoveNodeUse() : mn_(NULL) {} //because STL sucks. always = after this.
31  const MoveNode& mn, bool guard = false, bool ra = false,
32  bool pseudo = false, BBRelation bbRelation = INTRA_BB) :
34 
35  inline MoveNodeUse(const MoveNodeUse& mnu, BBRelation newBBRelation);
36 
37  // TODO: should be deterministic - this is not?
38  inline bool operator< (const MoveNodeUse& other) const;
39  const MoveNode* mn() const { return mn_; }
40  bool guard() const { return guard_; }
41  bool ra() const { return ra_; }
42  bool pseudo() const { return pseudo_; }
43  bool loop() const { return bbRelation_ == LOOP; }
44  bool interBB() const { return bbRelation_ > INTRA_BB; }
45  BBRelation bbRelation() const { return bbRelation_; }
46 private:
47  const MoveNode* mn_;
48  bool guard_;
49  bool ra_;
50  bool pseudo_;
52 };
53 
54 #include "MoveNodeUse.icc"
55 
56 #endif
MoveNodeUse::BBRelation
BBRelation
Definition: MoveNodeUse.hh:23
MoveNodeUse::interBB
bool interBB() const
Definition: MoveNodeUse.hh:44
MoveNodeUse::mn
const MoveNode * mn() const
Definition: MoveNodeUse.hh:39
MoveNodeUse::mn_
const MoveNode * mn_
Definition: MoveNodeUse.hh:47
MoveNodeUse::pseudo
bool pseudo() const
Definition: MoveNodeUse.hh:42
MoveNodeUse
Definition: MoveNodeUse.hh:20
MoveNodeUse::INTER_BB
@ INTER_BB
Definition: MoveNodeUse.hh:25
MoveNode
Definition: MoveNode.hh:65
MoveNodeUse::pseudo_
bool pseudo_
Definition: MoveNodeUse.hh:50
MoveNodeUse::loop
bool loop() const
Definition: MoveNodeUse.hh:43
MoveNodeUse::ra
bool ra() const
Definition: MoveNodeUse.hh:41
MoveNodeUse::ra_
bool ra_
Definition: MoveNodeUse.hh:49
MoveNodeUse::MoveNodeUse
MoveNodeUse(const MoveNode &mn, bool guard=false, bool ra=false, bool pseudo=false, BBRelation bbRelation=INTRA_BB)
Definition: MoveNodeUse.hh:30
MoveNodeUse::INTRA_BB
@ INTRA_BB
Definition: MoveNodeUse.hh:24
MoveNodeUse::guard_
bool guard_
Definition: MoveNodeUse.hh:48
MoveNodeUse.icc
MoveNodeUse::guard
bool guard() const
Definition: MoveNodeUse.hh:40
MoveNodeUse::LOOP
@ LOOP
Definition: MoveNodeUse.hh:26
MoveNodeUse::bbRelation
BBRelation bbRelation() const
Definition: MoveNodeUse.hh:45
MoveNodeUse::MoveNodeUse
MoveNodeUse()
Definition: MoveNodeUse.hh:29
MoveNodeUse::bbRelation_
BBRelation bbRelation_
Definition: MoveNodeUse.hh:51
MoveNode.hh
MoveNodeUse::operator<
bool operator<(const MoveNodeUse &other) const