diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-17 12:38:40 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-17 12:38:40 +0100 |
commit | 927eb99e75325164a541c2638e1e607294019381 (patch) | |
tree | 5b5476456f0f957fc7492465ff08ace54e1a9e48 /flowgraph/graph.cpp | |
parent | c9cb051fae190acfc36813e4a23759fb9b9c3df3 (diff) |
Complete hierarchical evaluation (unittest and systemtest fixed)
Diffstat (limited to 'flowgraph/graph.cpp')
-rw-r--r-- | flowgraph/graph.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/flowgraph/graph.cpp b/flowgraph/graph.cpp index 6398c68..229ded8 100644 --- a/flowgraph/graph.cpp +++ b/flowgraph/graph.cpp @@ -25,7 +25,7 @@ FlowGraph::Graph::~Graph() } // Assume first node of graph to be CreateScopeOp -FlowGraph::LocalScope& FlowGraph::Graph::scope() const +std::shared_ptr<FlowGraph::LocalScope> FlowGraph::Graph::scope() const { if (this->empty()) throw std::runtime_error("ICE: FlowGraph expected to be non-empty!"); @@ -42,12 +42,14 @@ FlowGraph::LocalScope& FlowGraph::Graph::scope() const void FlowGraph::Graph::append(const FlowGraph::Graph& other) { + // move graph nodes this->insert(this->end() - 1, other.begin() + 1, other.end() - 1); - this->scope().append(other.scope()); + // move scope nodes to new scope + this->scope()->append(*other.scope()); } -void FlowGraph::Graph::append(std::shared_ptr<Node> node) +void FlowGraph::Graph::append(std::shared_ptr<FlowGraph::Node> node) { this->insert(this->end() - 1, node); } |