17#ifndef __LOCO_IR_NODE_H__
18#define __LOCO_IR_NODE_H__
48template <SubstQualifier Q>
class Subst;
59 friend std::set<Node *>
succs(const Node *node);
64 Node(const Node &) = delete;
89 virtual uint32_t
opnum(
void)
const = 0;
93 virtual uint32_t
arity(
void)
const = 0;
111 Graph *_graph =
nullptr;
118 std::set<Use *> _uses;
138 void with(
Node *into)
const;
149template <
typename T> T
must_cast(
Node *node) {
return _must_cast<T, Node *>(node); }
151template <
typename T> T
must_cast(
const Node *node) {
return _must_cast<T, const Node *>(node); }
Logical unit of computation.
virtual Node * arg(uint32_t N) const =0
Access N-th argument node.
virtual uint32_t arity(void) const =0
Return the number of arguments.
virtual void drop(void)=0
Drop all the reference of arguments.
const Graph * graph(void) const
virtual const Dialect * dialect(void) const =0
Return "Dialect" identifier that this node belongs to.
friend std::set< Node * > succs(const Node *node)
Enumerate all the successors of a given node.
virtual uint32_t opnum(void) const =0
The edge between a node definition and its user.
std::set< Node * > succs(const Node *node)
Enumerate all the successors of a given node.
std::set< Node * > preds(const Node *node)
Enumerate all the predecessors of a given node.
T must_cast(FeatureEncoder *node)
A helper dynamic_cast that throws when failed.
Subst< SubstQualifier::Default > replace(Node *node)
Extensible Node Metadata.
virtual ~NodeAnnotation()=default