This commit adds 'Ret' class which records where to return the compute
value.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
--- /dev/null
+#ifndef __NEST_RET_H__
+#define __NEST_RET_H__
+
+#include "nest/DomainID.h"
+#include "nest/Expr.h"
+
+namespace nest
+{
+
+class Ret
+{
+public:
+ Ret(const DomainID &id, const expr::Subscript &sub) : _id{id}, _sub{sub}
+ {
+ // DO NOTHING
+ }
+
+public:
+ const DomainID &id(void) const { return _id; }
+ const expr::Subscript &sub(void) const { return _sub; }
+
+private:
+ DomainID const _id;
+ expr::Subscript const _sub;
+};
+
+} // namespace nest
+
+#endif // __NEST_RET_H__
--- /dev/null
+#include "nest/Ret.h"
+
+#include <gtest/gtest.h>
+
+namespace
+{
+struct DummyNode final : public nest::expr::Node
+{
+};
+}
+
+TEST(RET, ctor)
+{
+ nest::DomainID dom_id{0};
+ nest::expr::Subscript sub{std::make_shared<DummyNode>()};
+
+ nest::Ret ret{dom_id, sub};
+
+ ASSERT_EQ(ret.id().value(), 0);
+ ASSERT_EQ(ret.sub().rank(), 1);
+}