Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/46320 )

Change subject: mem-ruby: Appease compiler with return values
......................................................................

mem-ruby: Appease compiler with return values

Add default values for the cases where gem5 panics to
appease the compiler.

Change-Id: Ib15a63abfb6f1ffed6ce628f52a57388d2173c44
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
M src/mem/slicc/symbols/Type.py
2 files changed, 14 insertions(+), 4 deletions(-)



diff --git a/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh b/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
index aa37cc5..48e3b9d 100644
--- a/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
+++ b/src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
@@ -50,10 +50,9 @@
 #include "base/logging.hh"
 #include "mem/cache/replacement_policies/replaceable_entry.hh"
 #include "mem/ruby/common/Address.hh"
+#include "mem/ruby/common/DataBlock.hh"
 #include "mem/ruby/protocol/AccessPermission.hh"

-class DataBlock;
-
 class AbstractCacheEntry : public ReplaceableEntry
 {
   private:
@@ -73,8 +72,15 @@

     // The methods below are those called by ruby runtime, add when it
     // is absolutely necessary and should all be virtual function.
-    virtual DataBlock& getDataBlk()
-    { panic("getDataBlk() not implemented!"); }
+    virtual DataBlock&
+    getDataBlk()
+    {
+        panic("getDataBlk() not implemented!");
+
+        // Dummy return to appease the compiler
+        static DataBlock b;
+        return b;
+    }

     int validBlocks;
     virtual int& getNumValidBlocks()
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index 7ac77ac..da6460b 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -586,6 +586,7 @@
       default:
panic("Unknown state access permission converstion for ${{self.c_ident}}");
     }
+    return AccessPermission_Invalid;
 }

 ''')
@@ -626,6 +627,7 @@
       default:
         panic("Invalid range for type ${{self.c_ident}}");
     }
+    return "-1";
 }

 // Code to convert from a string to the enumeration
@@ -689,6 +691,7 @@
       default:
         panic("Invalid range for type ${{self.c_ident}}");
     }
+    return -1;
 }

/** \\brief returns the machine type for each base vector index used by NetDest
@@ -772,6 +775,7 @@
       default:
         panic("Invalid range for type ${{self.c_ident}}");
     }
+    return -1;
 }
 ''')


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/46320
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib15a63abfb6f1ffed6ce628f52a57388d2173c44
Gerrit-Change-Number: 46320
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to