Daniel Carvalho has submitted this change. (
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]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46320
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/ruby/slicc_interface/AbstractCacheEntry.hh
M src/mem/slicc/symbols/Type.py
2 files changed, 18 insertions(+), 4 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
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..a1ca200 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -586,6 +586,8 @@
default:
panic("Unknown state access permission converstion for
${{self.c_ident}}");
}
+ // Appease the compiler since this function has a return value
+ return AccessPermission_Invalid;
}
''')
@@ -626,6 +628,8 @@
default:
panic("Invalid range for type ${{self.c_ident}}");
}
+ // Appease the compiler since this function has a return value
+ return "";
}
// Code to convert from a string to the enumeration
@@ -689,6 +693,8 @@
default:
panic("Invalid range for type ${{self.c_ident}}");
}
+ // Appease the compiler since this function has a return value
+ return -1;
}
/** \\brief returns the machine type for each base vector index used by
NetDest
@@ -772,6 +778,8 @@
default:
panic("Invalid range for type ${{self.c_ident}}");
}
+ // Appease the compiler since this function has a return value
+ 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: 3
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s