From 927eb99e75325164a541c2638e1e607294019381 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Tue, 17 Nov 2020 12:38:40 +0100 Subject: Complete hierarchical evaluation (unittest and systemtest fixed) --- flowgraph/graph.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'flowgraph/graph.cpp') 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::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) +void FlowGraph::Graph::append(std::shared_ptr node) { this->insert(this->end() - 1, node); } -- cgit v1.2.3