#include "coco/IR/Bag.h"
#include "coco/IR/DepSet.h"
#include "coco/IR/ReadSet.h"
+#include "coco/IR/UpdateSet.h"
#include <set>
const ReadSet *reads(void) const { return &_reads; }
public:
- Bag::UpdaterSet *updates(void) { return &_updates; }
- const Bag::UpdaterSet *updates(void) const { return &_updates; }
+ UpdateSet *updates(void) { return &_updates; }
+ const UpdateSet *updates(void) const { return &_updates; }
public:
BagMask *mask(void) { return &_mask; }
/** @brief Direct reads (not through Object) */
ReadSet _reads;
/** @brief Direct updates (not through Object) */
- Bag::UpdaterSet _updates;
+ UpdateSet _updates;
BagMask _mask;
};
--- /dev/null
+#ifndef __COCO_IR_UPDATE_SET_H__
+#define __COCO_IR_UPDATE_SET_H__
+
+#include "coco/IR/Update.h"
+
+#include <set>
+
+namespace coco
+{
+
+using UpdateSet = std::set<Update *>;
+
+} // namespace coco
+
+#endif // __COCO_IR_UPDATE_SET_H__
for (auto update : *_info->updates())
{
- res.insert(update);
+ auto updater = update->updater();
+ assert(updater != nullptr);
+ res.insert(updater);
}
return res;
{
if (_bag)
{
- if (_link && _updater)
+ if (_link)
{
auto info = _link->find(_bag);
assert(info != nullptr);
- info->updates()->erase(_updater);
+ info->updates()->erase(this);
}
_bag = nullptr;
}
if (bag)
{
_bag = bag;
- if (_link && _updater)
+ if (_link)
{
auto info = _link->find(_bag);
assert(info != nullptr);
- info->updates()->insert(_updater);
+ info->updates()->insert(this);
}
}