Imported Upstream version 1.25.0
[platform/core/ml/nnfw.git] / runtime / onert / core / src / ir / verifier / Verifier.cc
index 25a82d5..6260d29 100644 (file)
@@ -39,11 +39,11 @@ bool DAGChecker::verify(const Graph &graph) const noexcept
 
   OperationIndexMap<bool> visited;
   operations.iterate(
-    [&](const OperationIndex &index, const Operation &) { visited[index] = false; });
+    [&](const OperationIndex &index, const IOperation &) { visited[index] = false; });
   OperationIndexMap<bool> on_stack = visited; // Copy from visited
 
-  std::function<void(const OperationIndex &index, const Operation &)> dfs_recursive =
-    [&](const OperationIndex &index, const Operation &node) -> void {
+  std::function<void(const OperationIndex &index, const IOperation &)> dfs_recursive =
+    [&](const OperationIndex &index, const IOperation &node) -> void {
     if (on_stack[index])
       cyclic = true;
     if (visited[index])
@@ -51,7 +51,7 @@ bool DAGChecker::verify(const Graph &graph) const noexcept
     visited[index] = true;
     on_stack[index] = true;
 
-    for (auto output : node.getOutputs() | Remove::DUPLICATED | Remove::UNDEFINED)
+    for (auto &&output : node.getOutputs() | Remove::DUPLICATED | Remove::UNDEFINED)
     {
       const auto &operand = graph.operands().at(output);
       for (const auto &use : operand.getUses())
@@ -76,8 +76,8 @@ bool EdgeChecker::verify(const Graph &graph) const noexcept
 {
   auto &operations = graph.operations();
   uint32_t errors = 0;
-  operations.iterate([&](const OperationIndex &index, const Operation &node) {
-    for (auto operand_index : node.getInputs() | ir::Remove::UNDEFINED)
+  operations.iterate([&](const OperationIndex &index, const IOperation &node) {
+    for (auto &&operand_index : node.getInputs() | ir::Remove::UNDEFINED)
     {
       try
       {
@@ -98,7 +98,7 @@ bool EdgeChecker::verify(const Graph &graph) const noexcept
         errors += 1;
       }
     }
-    for (auto operand_index : node.getOutputs() | ir::Remove::UNDEFINED)
+    for (auto &&operand_index : node.getOutputs() | ir::Remove::UNDEFINED)
     {
       try
       {
@@ -127,7 +127,7 @@ bool EdgeChecker::verify(const Graph &graph) const noexcept
 
 bool InputOutputChecker::verify(const Graph &graph) const noexcept
 {
-  for (auto operand_ind :
+  for (auto &&operand_ind :
        (graph.getInputs() + graph.getOutputs()) | Remove::DUPLICATED | Remove::UNDEFINED)
   {
     if (!graph.operands().exist(operand_ind))