From 341dbf266258dcbdb1e5e9f09c244b8ac271faaf Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Sat, 27 Sep 2014 09:08:36 -0400 Subject: 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. --- src/arch/generic/debugfaults.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arch/generic/debugfaults.hh') diff --git a/src/arch/generic/debugfaults.hh b/src/arch/generic/debugfaults.hh index fcfdfb9e1..aeb2261a7 100644 --- a/src/arch/generic/debugfaults.hh +++ b/src/arch/generic/debugfaults.hh @@ -86,8 +86,8 @@ class M5DebugFault : public FaultBase } void - invoke(ThreadContext *tc, - StaticInstPtr inst = StaticInst::nullStaticInstPtr) + invoke(ThreadContext *tc, const StaticInstPtr &inst = + StaticInst::nullStaticInstPtr) { switch (func) { case PanicFunc: -- cgit v1.2.3