summaryrefslogtreecommitdiff
path: root/src/arch/mips/stacktrace.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-09-27 09:08:36 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-09-27 09:08:36 -0400
commit341dbf266258dcbdb1e5e9f09c244b8ac271faaf (patch)
treef071f9a91adeb0c1eb0888ae751c3ee0196bd65d /src/arch/mips/stacktrace.hh
parentdeb2200671d5b4856ca27d4286253db0d9e12a32 (diff)
downloadgem5-341dbf266258dcbdb1e5e9f09c244b8ac271faaf.tar.xz
arch: Use const StaticInstPtr references where possible
This patch optimises the passing of StaticInstPtr by avoiding copying the reference-counting pointer. This avoids first incrementing and then decrementing the reference-counting pointer.
Diffstat (limited to 'src/arch/mips/stacktrace.hh')
-rw-r--r--src/arch/mips/stacktrace.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/mips/stacktrace.hh b/src/arch/mips/stacktrace.hh
index f4dc04d29..c817824ea 100644
--- a/src/arch/mips/stacktrace.hh
+++ b/src/arch/mips/stacktrace.hh
@@ -75,7 +75,7 @@ class StackTrace
public:
StackTrace();
- StackTrace(ThreadContext *tc, StaticInstPtr inst);
+ StackTrace(ThreadContext *tc, const StaticInstPtr &inst);
~StackTrace();
void clear()
@@ -85,7 +85,7 @@ class StackTrace
}
bool valid() const { return tc != NULL; }
- bool trace(ThreadContext *tc, StaticInstPtr inst);
+ bool trace(ThreadContext *tc, const StaticInstPtr &inst);
public:
const std::vector<Addr> &getstack() const { return stack; }
@@ -107,7 +107,7 @@ class StackTrace
};
inline bool
-StackTrace::trace(ThreadContext *tc, StaticInstPtr inst)
+StackTrace::trace(ThreadContext *tc, const StaticInstPtr &inst)
{
if (!inst->isCall() && !inst->isReturn())
return false;