mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Node.hpp
Go to the documentation of this file.
1 #ifndef FIRM_NODE_HPP
2 #define FIRM_NODE_HPP
3 
4 #include <libfirm/firm.h>
5 #include "../globals.hpp"
6 #include "Tarval.hpp"
7 
8 namespace firm
9 {
10  class Node
11  {
12  private:
13  ir_node* node;
14  public:
15  Node() {}
16  Node(ir_node* node);
17  operator ir_node* ()
18  {
19  return node;
20  }
21  operator bool ()
22  {
23  return node != NULL;
24  }
25  bool operator==(Node const& otherNode) const
26  {
27  return node == otherNode.node;
28  }
29  bool operator==(ir_node* otherNode) const
30  {
31  return node == otherNode;
32  }
33  bool operator!=(Node const& otherNode) const
34  {
35  return !operator==(otherNode);
36  }
37  bool operator!=(ir_node* otherNode) const
38  {
39  return !operator==(otherNode);
40  }
41  Tarval getTarval() const;
42  Tarval getValue() const;
43  bool isConst() const;
44  void setTarval(Tarval tarval);
45  void setTarvalToBad();
46  void setTarvalToUnknown();
48  Node getChild(unsigned int i) const;
49  void setChild(unsigned int i, Node child);
50  unsigned int getChildCount() const;
51  bool hasChildren() const;
52  vec<Node> getChildren() const;
53  void replaceWith(ir_node* node, bool copyTarval = false);
54  ir_mode* getMode() const;
55  bool isNumericOrBool() const;
56  bool isNumeric() const;
57  long getNodeNumber() const;
58  unsigned getOpcode() const;
59  };
60 }
61 
62 #endif
void setTarval(Tarval tarval)
Definition: Node.cpp:30
bool operator==(Node const &otherNode) const
Definition: Node.hpp:25
void replaceWith(ir_node *node, bool copyTarval=false)
Definition: Node.cpp:68
unsigned int getChildCount() const
Definition: Node.cpp:48
Definition: Node.hpp:10
bool operator==(ir_node *otherNode) const
Definition: Node.hpp:29
Node getChild(unsigned int i) const
Definition: Node.cpp:35
bool isConst() const
Definition: Node.cpp:25
bool isNumeric() const
Definition: Node.cpp:87
Definition: Tarval.hpp:13
void setTarvalToBad()
void setTarvalToUnknown()
Tarval getTarval() const
Definition: Node.cpp:10
vec< Node > getChildren() const
Definition: Node.cpp:58
Definition: CodeGen.cpp:11
ir_mode * getMode() const
Definition: Node.cpp:76
Tarval getValue() const
Definition: Node.cpp:20
unsigned getOpcode() const
Definition: Node.cpp:98
vec< std::pair< Node, unsigned int > > getOuts() const
Definition: Node.cpp:103
bool operator!=(ir_node *otherNode) const
Definition: Node.hpp:37
Node()
Definition: Node.hpp:15
void setChild(unsigned int i, Node child)
Definition: Node.cpp:43
bool operator!=(Node const &otherNode) const
Definition: Node.hpp:33
bool isNumericOrBool() const
Definition: Node.cpp:81
std::vector< T > vec
Definition: globals.hpp:8
bool hasChildren() const
Definition: Node.cpp:53
long getNodeNumber() const
Definition: Node.cpp:93