Jlm
Loading...
Searching...
No Matches
TestNodes.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2025 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_RVSDG_TESTNODES_HPP
7#define JLM_RVSDG_TESTNODES_HPP
8
11
12namespace jlm::rvsdg
13{
14
26
28{
29public:
31
36
37public:
41 struct InputVar
42 {
43 StructuralInput * input{};
44 std::vector<RegionArgument *> argument{};
45 };
46
50 struct OutputVar
51 {
52 StructuralOutput * output{};
53 std::vector<RegionResult *> result{};
54 };
55
63 addInputOnly(Output & origin);
64
71 InputVar
72 addInputWithArguments(Output & origin);
73
80 void
81 removeInputAndArguments(size_t index);
82
88 InputVar
89 addArguments(const std::shared_ptr<const Type> & type);
90
98 addOutputOnly(std::shared_ptr<const Type> type);
99
106 OutputVar
107 addOutputWithResults(const std::vector<Output *> & origins);
108
114 void
115 removeOutputAndResults(size_t index);
116
123 OutputVar
124 addResults(const std::vector<Output *> & origins);
125
134 InputVar
135 mapInput(const Input & input) const;
136
145 OutputVar
146 mapOutput(const Output & output) const;
147
149 GetOperation() const noexcept override;
150
152 create(Region * parent, const size_t numSubregions)
153 {
154 return new TestStructuralNode(parent, numSubregions);
155 }
156
158 copy(Region * region, SubstitutionMap & smap) const override;
159};
160
161}
162
163#endif
Represent acyclic RVSDG subgraphs.
Definition region.hpp:213
~TestStructuralNode() noexcept override
std::string debug_string() const override
Definition TestNodes.cpp:15
std::unique_ptr< Operation > copy() const override
Definition TestNodes.cpp:21
~TestStructuralOperation() noexcept override
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872
A variable routed in a TestStructuralNode.
Definition TestNodes.hpp:42
A variable routed out of a TestStructuralNode.
Definition TestNodes.hpp:51