namespace
{
-using SymbolTable = std::map<loco::Node *, std::string>;
+using SymbolTable = std::map<const loco::Node *, std::string>;
-std::string symbol_lookup(const SymbolTable &tbl, loco::Node *node)
+std::string symbol_lookup(const SymbolTable &tbl, const loco::Node *node)
{
if (node == nullptr)
{
/**
* @brief Return the opname as "<dialect>.<op>"
*/
-std::string opname(loco::Node *node)
+std::string opname(const loco::Node *node)
{
if (node->dialect() == loco::CanonicalDialect::get())
{
- auto canonical_node = dynamic_cast<loco::CanonicalNode *>(node);
+ auto canonical_node = dynamic_cast<const loco::CanonicalNode *>(node);
assert(canonical_node != nullptr);
return os;
}
-NodeDesc default_node_desc(const SymbolTable &tbl, loco::Node *node)
+NodeDesc default_node_desc(const SymbolTable &tbl, const loco::Node *node)
{
NodeDesc res{opname(node)};
return res;
}
-NodeDesc node_desc(const SymbolTable &tbl, loco::Node *node)
+NodeDesc node_desc(const SymbolTable &tbl, const loco::Node *node)
{
if (node->dialect() == loco::CanonicalDialect::get())
{
{
SymbolTable symbols;
- auto symbol = [&symbols](loco::Node *node) { return symbol_lookup(symbols, node); };
+ auto symbol = [&symbols](const loco::Node *node) { return symbol_lookup(symbols, node); };
for (uint32_t n = 0; n < _graph->nodes()->size(); ++n)
{