diff options
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); } |