changeset 452c860fd0ee in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=452c860fd0ee
description:
        base: Fix for stats node on gcc < 4.6.3

        This patch adds an explicit function to get the underlying node as gcc
        4.6.1 and 4.6.2 have issues otherwise.

diffstat:

 src/base/statistics.cc |  6 +++---
 src/base/statistics.hh |  5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 8647eb4489b8 -r 452c860fd0ee src/base/statistics.cc
--- a/src/base/statistics.cc    Mon Oct 20 18:03:53 2014 -0400
+++ b/src/base/statistics.cc    Mon Oct 20 18:03:54 2014 -0400
@@ -379,7 +379,7 @@
 
 Formula::Formula(Temp r)
 {
-    root = r;
+    root = r.getNodePtr();
     setInit();
     assert(size());
 }
@@ -388,7 +388,7 @@
 Formula::operator=(Temp r)
 {
     assert(!root && "Can't change formulas");
-    root = r;
+    root = r.getNodePtr();
     setInit();
     assert(size());
     return *this;
@@ -400,7 +400,7 @@
     if (root)
         root = NodePtr(new BinaryNode<std::plus<Result> >(root, r));
     else {
-        root = r;
+        root = r.getNodePtr();
         setInit();
     }
 
diff -r 8647eb4489b8 -r 452c860fd0ee src/base/statistics.hh
--- a/src/base/statistics.hh    Mon Oct 20 18:03:53 2014 -0400
+++ b/src/base/statistics.hh    Mon Oct 20 18:03:54 2014 -0400
@@ -2999,6 +2999,11 @@
      */
     operator NodePtr&() { return node; }
 
+    /**
+     * Makde gcc < 4.6.3 happy and explicitly get the underlying node.
+     */
+    NodePtr getNodePtr() const { return node; }
+
   public:
     /**
      * Create a new ScalarStatNode.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to