Jlm
Loading...
Searching...
No Matches
structural-node.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2016 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#include <jlm/rvsdg/graph.hpp>
9
10namespace jlm::rvsdg
11{
12
13/* structural input */
14
19
22 jlm::rvsdg::Output * origin,
23 std::shared_ptr<const rvsdg::Type> type)
24 : NodeInput(origin, node, std::move(type))
25{}
26
27/* structural output */
28
33
34StructuralOutput::StructuralOutput(StructuralNode * node, std::shared_ptr<const rvsdg::Type> type)
35 : NodeOutput(node, std::move(type))
36{}
37
38/* structural node */
39
46
47StructuralNode::StructuralNode(rvsdg::Region * region, size_t nsubregions)
48 : Node(region)
49{
50 if (nsubregions == 0)
51 throw util::Error("Number of subregions must be greater than zero.");
52
53 for (size_t n = 0; n < nsubregions; n++)
54 subregions_.emplace_back(std::unique_ptr<rvsdg::Region>(new jlm::rvsdg::Region(this, n)));
55
57}
58
59std::string
64
65}
virtual const Operation & GetOperation() const noexcept=0
rvsdg::Region * region() const noexcept
Definition node.hpp:761
virtual std::string debug_string() const =0
Represent acyclic RVSDG subgraphs.
Definition region.hpp:213
void notifyNodeDestroy(Node *node)
Definition region.cpp:420
void notifyNodeCreate(Node *node)
Definition region.cpp:411
~StructuralInput() noexcept override
StructuralInput(StructuralNode *node, jlm::rvsdg::Output *origin, std::shared_ptr< const rvsdg::Type > type)
std::string DebugString() const override
~StructuralNode() noexcept override
std::vector< std::unique_ptr< rvsdg::Region > > subregions_
StructuralNode(rvsdg::Region *region, size_t nsubregions)
size_t nsubregions() const noexcept
~StructuralOutput() noexcept override
StructuralOutput(StructuralNode *node, std::shared_ptr< const rvsdg::Type > type)
bool empty() const noexcept
#define JLM_ASSERT(x)
Definition common.hpp:16
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872