aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InstrSched/SchedPriorities.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-05 04:20:12 +0000
committerChris Lattner <sabre@nondot.org>2002-02-05 04:20:12 +0000
commit748697d2421051b3ff1263d13cccaf410f3e7034 (patch)
tree78b10a43c512846fce169c36f72c2a7a4c9bc43f /lib/CodeGen/InstrSched/SchedPriorities.cpp
parent3773094a1da7d7fc76a2491211fadf734c3b8645 (diff)
Minor change: Methods that return ValueSet's that are guaranteed to be valid
return references instead of pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InstrSched/SchedPriorities.cpp')
-rw-r--r--lib/CodeGen/InstrSched/SchedPriorities.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/InstrSched/SchedPriorities.cpp b/lib/CodeGen/InstrSched/SchedPriorities.cpp
index 74f659993e..fed3f941fe 100644
--- a/lib/CodeGen/InstrSched/SchedPriorities.cpp
+++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp
@@ -276,16 +276,14 @@ SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo,
// else check if instruction is a last use and save it in the hash_map
bool hasLastUse = false;
const BasicBlock* bb = graphNode->getBB();
- const ValueSet *liveVars =
- methodLiveVarInfo.getLiveVarSetBeforeMInst(minstr, bb);
+ const ValueSet &LVs = methodLiveVarInfo.getLiveVarSetBeforeMInst(minstr, bb);
- for (MachineInstr::val_const_op_iterator vo(minstr); ! vo.done(); ++vo)
- if (liveVars->find(*vo) == liveVars->end()) {
+ for (MachineInstr::val_const_op_iterator vo(minstr); !vo.done(); ++vo)
+ if (!LVs.count(*vo)) {
hasLastUse = true;
break;
}
-
- lastUseMap[minstr] = hasLastUse;
- return hasLastUse;
+
+ return lastUseMap[minstr] = hasLastUse;
}