From ebda5c14a57d4c140e664b6f9c31dae9a94552aa Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Mon, 29 Aug 2011 06:34:40 -0500 Subject: [PATCH] SLICC: Pass arguments by reference Arguments to functions were being passed by value. This patch changes SLICC so that arguments are passed by reference. --- src/mem/ruby/slicc_interface/AbstractController.hh | 4 ++-- src/mem/slicc/ast/FormalParamAST.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh index f1dac39ad..1eefa4fba 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.hh +++ b/src/mem/ruby/slicc_interface/AbstractController.hh @@ -63,8 +63,8 @@ class AbstractController : public SimObject, public Consumer virtual void blockOnQueue(Address, MessageBuffer*) = 0; virtual void unblock(Address) = 0; virtual void initNetworkPtr(Network* net_ptr) = 0; - virtual AccessPermission getAccessPermission(Address addr) = 0; - virtual DataBlock& getDataBlock(Address addr) = 0; + virtual AccessPermission getAccessPermission(const Address& addr) = 0; + virtual DataBlock& getDataBlock(const Address& addr) = 0; virtual void print(std::ostream & out) const = 0; virtual void printStats(std::ostream & out) const = 0; diff --git a/src/mem/slicc/ast/FormalParamAST.py b/src/mem/slicc/ast/FormalParamAST.py index 783607f43..e94f24ccb 100644 --- a/src/mem/slicc/ast/FormalParamAST.py +++ b/src/mem/slicc/ast/FormalParamAST.py @@ -56,4 +56,4 @@ class FormalParamAST(AST): return type, "%s* %s" % (type.c_ident, param) else: - return type, "%s %s" % (type.c_ident, param) + return type, "const %s& %s" % (type.c_ident, param) -- 2.30.2