This commit introduces producer and consumers helpers for Object values.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
ObjectInfo *info(void) const;
public:
+ // WARN These methods are deprecated. Please use 'producer' and 'consumers' instead.
Producer *def(void) const;
const ConsumerSet *user(void) const;
Dep _dep;
};
+// @brief Return the producer of a given object if it exists
+Object::Producer *producer(const Object *);
+
+// @brief Return a set of consumers of a given object.
+Object::ConsumerSet consumers(const Object *);
+
} // namespace coco
#endif // __COCO_IR_OBJECT_H__
const Object::ConsumerSet *Object::user(void) const { return info()->user(); }
+Object::Producer *producer(const Object *obj) { return obj->def(); }
+Object::ConsumerSet consumers(const Object *obj) { return *(obj->user()); }
+
} // namespace coco