[enco] Add comments to subst method (#2775)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 8 Jan 2019 23:41:56 +0000 (08:41 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 8 Jan 2019 23:41:56 +0000 (08:41 +0900)
* [enco] Add comments to subst method

This will add explanation comment of subst() method

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
* some changes and example code

* use word USER

* Apply suggested comment

* fix typos

* use word Consumer

contrib/enco/core/src/IRUtils.cpp

index 1d322db..59f6b0d 100644 (file)
 namespace enco
 {
 
+/**
+ * @brief Substitute all the USE occurrences of an object with another object
+ * @param from  Object to be replaced
+ * @param into  Object to be used instead
+ * NOTE This maybe used when something like -- 'from' will be removed so we need
+ *      to replace object Consumers that use 'from' to 'into'
+ * EXAMPLE
+ *      {
+ *        subst(child, bigone);
+ *        m->entity()->object()->destroy(child);
+ *      }
+ *      This code will change all the Consumers that use 'child' to 'bigone' and
+ *      destroy the 'child' object.
+ */
 void subst(coco::Object *from, coco::Object *into)
 {
   assert(from != into);