From d4b4ef13249f78714f5507ea6353d64b44ff8b25 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Sun, 19 Jun 2011 21:43:34 -0400 Subject: [PATCH] inorder: inst. iterator cleanup get rid of accessing iterators (for instructions) by reference --- src/cpu/inorder/cpu.cc | 6 +++--- src/cpu/inorder/cpu.hh | 6 +++--- src/cpu/inorder/inorder_dyn_inst.hh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc index 8b49c4f24..ef6d5fb20 100644 --- a/src/cpu/inorder/cpu.cc +++ b/src/cpu/inorder/cpu.cc @@ -1221,7 +1221,7 @@ InOrderCPU::setMiscReg(int misc_reg, const MiscReg &val, ThreadID tid) InOrderCPU::ListIt -InOrderCPU::addInst(DynInstPtr &inst) +InOrderCPU::addInst(DynInstPtr inst) { ThreadID tid = inst->readTid(); @@ -1318,7 +1318,7 @@ InOrderCPU::instDone(DynInstPtr inst, ThreadID tid) // currently unused function, but substitute repetitive code w/this function // call void -InOrderCPU::addToRemoveList(DynInstPtr &inst) +InOrderCPU::addToRemoveList(DynInstPtr inst) { removeInstsThisCycle = true; if (!inst->isRemoveList()) { @@ -1336,7 +1336,7 @@ InOrderCPU::addToRemoveList(DynInstPtr &inst) } void -InOrderCPU::removeInst(DynInstPtr &inst) +InOrderCPU::removeInst(DynInstPtr inst) { DPRINTF(InOrderCPU, "Removing graduated instruction [tid:%i] PC %s " "[sn:%lli]\n", diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh index 75d4077d7..a468f8fa8 100644 --- a/src/cpu/inorder/cpu.hh +++ b/src/cpu/inorder/cpu.hh @@ -577,16 +577,16 @@ class InOrderCPU : public BaseCPU /** Function to add instruction onto the head of the list of the * instructions. Used when new instructions are fetched. */ - ListIt addInst(DynInstPtr &inst); + ListIt addInst(DynInstPtr inst); /** Function to tell the CPU that an instruction has completed. */ void instDone(DynInstPtr inst, ThreadID tid); /** Add Instructions to the CPU Remove List*/ - void addToRemoveList(DynInstPtr &inst); + void addToRemoveList(DynInstPtr inst); /** Remove an instruction from CPU */ - void removeInst(DynInstPtr &inst); + void removeInst(DynInstPtr inst); /** Remove all instructions younger than the given sequence number. */ void removeInstsUntil(const InstSeqNum &seq_num,ThreadID tid); diff --git a/src/cpu/inorder/inorder_dyn_inst.hh b/src/cpu/inorder/inorder_dyn_inst.hh index 033726df9..1ef2b2af4 100644 --- a/src/cpu/inorder/inorder_dyn_inst.hh +++ b/src/cpu/inorder/inorder_dyn_inst.hh @@ -989,7 +989,7 @@ class InOrderDynInst : public FastAlloc, public RefCounted ListIt instListIt; /** Returns iterator to this instruction in the list of all insts. */ - ListIt &getInstListIt() { return instListIt; } + ListIt getInstListIt() { return instListIt; } /** Sets iterator for this instruction in the list of all insts. */ void setInstListIt(ListIt _instListIt) { instListIt = _instListIt; }