"annot_data" and "annot_domain" do not change the node itself.
This commit revies the signature of these helpers to express this
property explicitly.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
node->annot(std::unique_ptr<NodeDataImpl>(impl));
}
-const NodeData *annot_data(loco::Node *node)
+const NodeData *annot_data(const loco::Node *node)
{
auto impl = node->annot<NodeDataImpl>();
auto data = dynamic_cast<const NodeData *>(impl);
void annot_data(loco::Node *node, std::unique_ptr<NodeData> &&data);
/// @brief Wrapper to get NodeDataImpl annotation of node
-const NodeData *annot_data(loco::Node *node);
+const NodeData *annot_data(const loco::Node *node);
/// @brief Erase already annotated NodeDataImpl
void erase_annot_data(loco::Node *node);
node->annot(std::move(node_domain));
}
-loco::Domain annot_domain(loco::Node *node)
+loco::Domain annot_domain(const loco::Node *node)
{
auto node_domain = node->annot<NodeDomain>();
if (node_domain)
void annot_domain(loco::Node *node, const loco::Domain &domain);
/// @brief Wrapper to get domain annotation of node
-loco::Domain annot_domain(loco::Node *node);
+loco::Domain annot_domain(const loco::Node *node);
/// @brief Erase already annotated node domain
void erase_annot_domain(loco::Node *node);