From c9cb051fae190acfc36813e4a23759fb9b9c3df3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 16 Nov 2020 12:48:44 +0100 Subject: Implement hierarchical evaluation (WIP) --- flowgraph/node.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'flowgraph/node.cpp') diff --git a/flowgraph/node.cpp b/flowgraph/node.cpp index e0912dc..2d757f9 100644 --- a/flowgraph/node.cpp +++ b/flowgraph/node.cpp @@ -4,6 +4,8 @@ #include +#include + using namespace FlowGraph; FlowGraph::Data& Node::destination() @@ -19,22 +21,28 @@ Data FlowGraph::MakeConstantInt(int i) { std::vector value(size_t(4), uint8_t(0)); *(reinterpret_cast(value.data())) = boost::endian::native_to_little(static_cast(i)); - return Data(DataType::Int, std::make_shared(value)); + return Data{DataType::Int, std::make_shared(value)}; } Data FlowGraph::MakeLocalPointer(FlowGraph::LocalScope& scope, const std::string& name) { - return Data(DataType::Pointer, std::make_shared(scope, name)); + Data data{DataType::Pointer, std::make_shared(scope, name)}; + scope.push_back(std::make_shared(data)); + return data; } Data FlowGraph::MakeLocalSize(FlowGraph::LocalScope& scope, const std::string& name) { - return Data(DataType::Size, std::make_shared(scope, name)); + Data data{DataType::Size, std::make_shared(scope, name)}; + scope.push_back(std::make_shared(data)); + return data; } Data FlowGraph::MakeTemporaryInt(FlowGraph::LocalScope& scope) { - return Data(DataType::Int, std::make_shared(scope)); + Data data{DataType::Int, std::make_shared(scope)}; + scope.push_back(std::make_shared(data)); + return data; } LocalScope& CreateScopeOp::scope() -- cgit v1.2.3