Fix compiler warnings; clear object graph when it's not needed
authorAndrey Kvochko <a.kvochko@samsung.com>
Thu, 28 Sep 2017 14:21:17 +0000 (17:21 +0300)
committerAndrey Kvochko/SRR-Compiler Lab/./삼성전자 <a.kvochko@samsung.com>
Fri, 27 Oct 2017 10:46:13 +0000 (13:46 +0300)
src/analyze/gui/parser.cpp
src/track/objectgraph.h

index b97a854..c4760d9 100644 (file)
@@ -91,7 +91,7 @@ struct TypeTree {
             return result;
 
         if (node.m_children.size() == 0) {
-            result.push_back(std::move(create(node)));
+            result.push_back(create(node));
             return result;
         }
 
@@ -107,8 +107,8 @@ struct TypeTree {
                 }
                 childIt->m_parents.push_back(std::move(parent));
                 result.push_back(std::move(leaf));
-                auto parentCopy = create(node);
-                result.push_back(std::move(parentCopy));
+                // Add a copy of the parent to the top level
+                result.push_back(create(node));
             }
         }
 
index ba8e2a7..44056d4 100644 (file)
@@ -72,6 +72,7 @@ public:
         ObjectNode *node = &(it->second);
         eliminateLoops(node);
         node->print(gcCounter, out);
+        clear();
     }
 
     void clear() {