This commit introduces 'BagType' enum class, and revises BagInfo to
store its type.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
namespace coco
{
+enum class BagType
+{
+ Intermediate,
+ Input,
+ Output
+};
+
/***
* @brief The internal state of Bag
*
private:
ObjectList _object;
+
+public:
+ BagType type(void) const { return _type; }
+ void type(const BagType &type) { _type = type; }
+
+private:
+ BagType _type = BagType::Intermediate;
};
} // namespace coco
--- /dev/null
+#include "coco/IR/BagInfo.h"
+
+#include <gtest/gtest.h>
+
+TEST(IR_BAG_INFO, constructor)
+{
+ coco::BagInfo info{16};
+
+ ASSERT_EQ(info.type(), coco::BagType::Intermediate);
+}
+
+TEST(IR_BAG_INFO, type)
+{
+ coco::BagInfo info{16};
+
+ info.type(coco::BagType::Input);
+
+ ASSERT_EQ(info.type(), coco::BagType::Input);
+}