[coco] Remove ObjectInfo (#1569)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 19 Sep 2018 08:48:52 +0000 (17:48 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 19 Sep 2018 08:48:52 +0000 (17:48 +0900)
This commit removes all the reference of ObjectInfo from coco IR code
base as ObjectInfo is no longer used.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
17 files changed:
contrib/coco/core/include/coco/IR/FeatureObject.h
contrib/coco/core/include/coco/IR/FeatureObjectInfo.h
contrib/coco/core/include/coco/IR/KernelObject.h
contrib/coco/core/include/coco/IR/KernelObjectInfo.h
contrib/coco/core/include/coco/IR/Object.h
contrib/coco/core/include/coco/IR/ObjectInfo.h [deleted file]
contrib/coco/core/include/coco/IR/ObjectManager.h
contrib/coco/core/src/IR/Def.test.cpp
contrib/coco/core/src/IR/Dep.test.cpp
contrib/coco/core/src/IR/FeatureObject.cpp
contrib/coco/core/src/IR/KernelObject.cpp
contrib/coco/core/src/IR/Object.cpp
contrib/coco/core/src/IR/Object.test.cpp
contrib/coco/core/src/IR/ObjectInfo.cpp [deleted file]
contrib/coco/core/src/IR/ObjectInfo.test.cpp [deleted file]
contrib/coco/core/src/IR/Use.cpp
contrib/coco/core/src/IR/Use.test.cpp

index b0384e1..a60dd9d 100644 (file)
@@ -25,9 +25,6 @@ public:
 public:
   ~FeatureObject();
 
-private:
-  void get(ObjectInfo **) const override;
-
 public:
   FeatureObject *asFeature(void) override { return this; }
   const FeatureObject *asFeature(void) const override { return this; }
index a5abf5a..86f659d 100644 (file)
@@ -1,14 +1,12 @@
 #ifndef __COCO_IR_FEATURE_OBJECT_INFO_H__
 #define __COCO_IR_FEATURE_OBJECT_INFO_H__
 
-#include "coco/IR/ObjectInfo.h"
-
 #include <nncc/core/ADT/feature/Shape.h>
 
 namespace coco
 {
 
-class FeatureObjectInfo final : public ObjectInfo
+class FeatureObjectInfo final
 {
 public:
   FeatureObjectInfo(const nncc::core::ADT::feature::Shape &shape) : _shape{shape}
index 6de7c59..48b2902 100644 (file)
@@ -24,9 +24,6 @@ public:
 public:
   virtual ~KernelObject();
 
-private:
-  void get(ObjectInfo **) const override;
-
 public:
   KernelObject *asKernel(void) override { return this; }
   const KernelObject *asKernel(void) const override { return this; }
index ab03e0d..83a3079 100644 (file)
@@ -1,14 +1,12 @@
 #ifndef __COCO_IR_KERNEL_OBJECT_INFO_H__
 #define __COCO_IR_KERNEL_OBJECT_INFO_H__
 
-#include "coco/IR/ObjectInfo.h"
-
 #include <nncc/core/ADT/kernel/Shape.h>
 
 namespace coco
 {
 
-class KernelObjectInfo final : public ObjectInfo
+class KernelObjectInfo final
 {
 public:
   KernelObjectInfo(const nncc::core::ADT::kernel::Shape &shape) : _shape{shape}
index b548003..eccb911 100644 (file)
@@ -46,9 +46,6 @@ public:
 public:
   virtual ~Object() = default;
 
-protected:
-  virtual void get(ObjectInfo **) const = 0;
-
 public:
   coco::Bag *bag(void) const { return _dep.bag(); }
   void bag(coco::Bag *bag) { _dep.bag(bag); }
diff --git a/contrib/coco/core/include/coco/IR/ObjectInfo.h b/contrib/coco/core/include/coco/IR/ObjectInfo.h
deleted file mode 100644 (file)
index a2ef5ce..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __COCO_IR_OBJECT_INFO_H__
-#define __COCO_IR_OBJECT_INFO_H__
-
-#include "coco/IR/Object.h"
-#include "coco/IR/Def.forward.h"
-#include "coco/IR/UseSet.h"
-
-namespace coco
-{
-
-class ObjectInfo
-{
-public:
-  ObjectInfo() = default;
-
-public:
-  virtual ~ObjectInfo() = default;
-
-public:
-  Object::ConsumerSet *user(void) { return &_user; }
-  const Object::ConsumerSet *user(void) const { return &_user; }
-
-private:
-  Def *_def = nullptr;
-  Object::ConsumerSet _user;
-};
-
-} // namespace coco
-
-#endif // __COCO_IR_OBJECT_INFO_H__
index 6052b81..13dab58 100644 (file)
@@ -2,7 +2,6 @@
 #define __COCO_IR_OBJECT_MANAGER_H__
 
 #include "coco/IR/Object.h"
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/FeatureObject.forward.h"
 #include "coco/IR/KernelObject.forward.h"
 #include "coco/IR/EntityBuilder.h"
index 331fa49..c259e3d 100644 (file)
@@ -1,5 +1,4 @@
 #include "coco/IR/Def.h"
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/ObjectManager.h"
 
 #include "coco/IR/FeatureObject.h"
index 28e747c..5e94380 100644 (file)
@@ -2,7 +2,6 @@
 
 #include "coco/IR/BagManager.h"
 
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/ObjectManager.h"
 #include "coco/IR/FeatureObject.h"
 
index 15330ed..0ed0eba 100644 (file)
@@ -21,8 +21,6 @@ FeatureObject::~FeatureObject()
   // DO NOTHING
 }
 
-void FeatureObject::get(ObjectInfo **out) const { *out = _info.get(); }
-
 const nncc::core::ADT::feature::Shape &FeatureObject::shape(void) const { return _info->shape(); }
 
 ElemID &FeatureObject::at(uint32_t ch, uint32_t row, uint32_t col)
index 2f5d961..65de8b1 100644 (file)
@@ -23,8 +23,6 @@ KernelObject::~KernelObject()
   // DO NOTHING
 }
 
-void KernelObject::get(ObjectInfo **out) const { *out = _info.get(); }
-
 const nncc::core::ADT::kernel::Shape &KernelObject::shape(void) const { return _info->shape(); }
 
 ElemID &KernelObject::at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col)
index 5bc07a4..be2d188 100644 (file)
@@ -1,5 +1,4 @@
 #include "coco/IR/Object.h"
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/Def.h"
 #include "coco/IR/Use.h"
 
@@ -15,13 +14,6 @@ Object::Object()
   _dep.object(this);
 }
 
-ObjectInfo *Object::info(void) const
-{
-  ObjectInfo *res = nullptr;
-  get(&res);
-  return res;
-}
-
 Def *Object::def(void) const { return _def; }
 
 void Object::def(Def *d)
index f330587..5cd80f9 100644 (file)
@@ -1,5 +1,4 @@
 #include "coco/IR/Object.h"
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/BagManager.h"
 
 #include <nncc/foundation/Memory.h>
@@ -27,12 +26,6 @@ struct Object : public coco::Object
 {
 public:
   virtual ~Object() = default;
-
-public:
-  std::unique_ptr<coco::ObjectInfo> info;
-
-private:
-  void get(coco::ObjectInfo **out) const override { *out = info.get(); }
 };
 } // namespace mock
 } // namespace
@@ -41,8 +34,6 @@ TEST_F(ObjectTest, ctor)
 {
   ::mock::Object obj;
 
-  obj.info = make_unique<coco::ObjectInfo>();
-
   // Newly created object should not have a backing bag
   ASSERT_EQ(obj.bag(), nullptr);
 
@@ -59,8 +50,6 @@ TEST_F(ObjectTest, bag_update)
   // Test 'Object' class through a mock-up object
   ::mock::Object obj;
 
-  obj.info = make_unique<coco::ObjectInfo>();
-
   obj.bag(bag);
 
   // 'bag(Bag *)' should affect the return of 'bag(void)'
@@ -92,8 +81,6 @@ TEST_F(ObjectTest, destructor)
   {
     ::mock::Object obj;
 
-    obj.info = make_unique<coco::ObjectInfo>();
-
     obj.bag(bag);
   }
 
diff --git a/contrib/coco/core/src/IR/ObjectInfo.cpp b/contrib/coco/core/src/IR/ObjectInfo.cpp
deleted file mode 100644 (file)
index adee9ab..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "coco/IR/ObjectInfo.h"
-
-#include <cassert>
-
-namespace coco
-{
-
-} // namespace coco
diff --git a/contrib/coco/core/src/IR/ObjectInfo.test.cpp b/contrib/coco/core/src/IR/ObjectInfo.test.cpp
deleted file mode 100644 (file)
index 97b46b2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "coco/IR/ObjectInfo.h"
-
-#include <gtest/gtest.h>
-
-namespace
-{
-class ObjectInfoTest : public ::testing::Test
-{
-};
-} // namespace
-
-TEST_F(ObjectInfoTest, constructor)
-{
-  coco::ObjectInfo info;
-
-  ASSERT_EQ(info.user()->size(), 0);
-}
index 7dbe20c..b335d64 100644 (file)
@@ -1,5 +1,4 @@
 #include "coco/IR/Use.h"
-#include "coco/IR/ObjectInfo.h"
 
 #include <cassert>
 
@@ -12,9 +11,6 @@ void Use::value(Object *value)
   {
     // TODO Remove unnecessary indentation
     {
-      auto info = _value->info();
-      assert(info != nullptr);
-      info->user()->erase(_consumer);
       _value->mutable_uses()->erase(this);
     }
     _value = nullptr;
@@ -27,10 +23,7 @@ void Use::value(Object *value)
     _value = value;
     // TODO Remove unnecessary indentation
     {
-      auto info = _value->info();
-      assert(info != nullptr);
       _value->mutable_uses()->insert(this);
-      info->user()->insert(_consumer);
     }
   }
 
index 9223d37..fba4c8a 100644 (file)
@@ -1,5 +1,4 @@
 #include "coco/IR/Use.h"
-#include "coco/IR/ObjectInfo.h"
 #include "coco/IR/ObjectManager.h"
 
 #include "coco/IR/FeatureObject.h"