Minor change: Methods that return ValueSet's that are guaranteed to be valid
[oota-llvm.git] / lib / Target / SparcV9 / InstrSched / SchedPriorities.cpp
index 74f659993e2a9d5efc8a47ac5f1714bb63bda3ec..fed3f941fef58b44537b9c72e286159368ccd96b 100644 (file)
@@ -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;
 }