[coco] Introduce Op dispose (#1364)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 6 Sep 2018 00:08:58 +0000 (09:08 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 6 Sep 2018 00:08:58 +0000 (09:08 +0900)
This commit introduces Op::dispose method which allows users to request
each operation to release resources before destruction.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/coco/core/include/coco/IR/Op.h

index 5629699..5130ef7 100644 (file)
@@ -76,6 +76,13 @@ protected:
 
 public:
   Instr *parent(void) const;
+
+public:
+  // @brief Release all the references
+  //
+  // NOTE The state after dispose SHOULD be identical to that just after construction
+  // TODO Rewrite as a pure virtual method once all the existing Op implement this method
+  virtual void dispose(void) { return; }
 };
 
 } // namespace coco