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
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index 9af470a..f910c9b 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -1251,11 +1251,11 @@
   }
 
 
-  const ValueSet *LVSetAft =  PRA.LVI->getLiveVarSetAfterMInst(MInst, BB);
-  ValueSet::const_iterator LIt = LVSetAft->begin();
+  const ValueSet &LVSetAft =  PRA.LVI->getLiveVarSetAfterMInst(MInst, BB);
+  ValueSet::const_iterator LIt = LVSetAft.begin();
 
   // for each live var in live variable set after machine inst
-  for( ; LIt != LVSetAft->end(); ++LIt) {
+  for( ; LIt != LVSetAft.end(); ++LIt) {
 
    //  get the live range corresponding to live var
     LiveRange *const LR = PRA.LRI.getLiveRangeForValue(*LIt );    
@@ -1302,25 +1302,25 @@
 	      // Handle IntCCRegType specially since we cannot directly 
 	      // push %ccr on to the stack
 
-	      const ValueSet *LVSetBef = 
+	      const ValueSet &LVSetBef = 
 		PRA.LVI->getLiveVarSetBeforeMInst(MInst, BB);
 
 	      // get a free INTEGER register
 	      int FreeIntReg = 
 		PRA.getUsableUniRegAtMI(LR->getRegClass(), IntRegType, MInst, 
-				     LVSetBef, AdIBefCC, AdIAftCC);
+                                        &LVSetBef, AdIBefCC, AdIAftCC);
 
 	      // insert the instructions in reverse order since we are
 	      // adding them to the front of InstrnsBefore
 
 	      if(AdIAftCC)
-		(PRA.AddedInstrMap[MInst]->InstrnsBefore).push_front(AdIAftCC);
+		PRA.AddedInstrMap[MInst]->InstrnsBefore.push_front(AdIAftCC);
 
 	      AdICpCC = cpCCR2IntMI(FreeIntReg);
-	      (PRA.AddedInstrMap[MInst]->InstrnsBefore).push_front(AdICpCC);
+	      PRA.AddedInstrMap[MInst]->InstrnsBefore.push_front(AdICpCC);
 
 	      if(AdIBefCC)
-		(PRA.AddedInstrMap[MInst]->InstrnsBefore).push_front(AdIBefCC);
+		PRA.AddedInstrMap[MInst]->InstrnsBefore.push_front(AdIBefCC);
 
 	      if(DEBUG_RA) {
 		cerr << "\n!! Inserted caller saving (push) inst for %ccr:";
@@ -1332,13 +1332,13 @@
 	    } else  {  
 	      // for any other register type, just add the push inst
 	      AdIBef = cpReg2MemMI(Reg, getFramePointer(), StackOff, RegType );
-	      ((PRA.AddedInstrMap[MInst])->InstrnsBefore).push_front(AdIBef);
+	      PRA.AddedInstrMap[MInst]->InstrnsBefore.push_front(AdIBef);
 	    }
 
 
 	    //---- Insert code for popping the reg from the stack ----------
 
-	    if( RegType == IntCCRegType ) {
+	    if (RegType == IntCCRegType) {
 
 	      // Handle IntCCRegType specially since we cannot directly 
 	      // pop %ccr on from the stack
@@ -1346,16 +1346,16 @@
 	      // get a free INT register
 	      int FreeIntReg = 
 		PRA.getUsableUniRegAtMI(LR->getRegClass(), IntRegType, MInst, 
-				     LVSetAft, AdIBefCC, AdIAftCC);
+                                        &LVSetAft, AdIBefCC, AdIAftCC);
 	      
 	      if(AdIBefCC)
-		(PRA.AddedInstrMap[MInst]->InstrnsAfter).push_back(AdIBefCC);
+		PRA.AddedInstrMap[MInst]->InstrnsAfter.push_back(AdIBefCC);
 
 	      AdICpCC = cpInt2CCRMI(FreeIntReg);
-	      (PRA.AddedInstrMap[MInst]->InstrnsAfter).push_back(AdICpCC);
+	      PRA.AddedInstrMap[MInst]->InstrnsAfter.push_back(AdICpCC);
 	    
 	      if(AdIAftCC)
-		(PRA.AddedInstrMap[MInst]->InstrnsAfter).push_back(AdIAftCC);
+		PRA.AddedInstrMap[MInst]->InstrnsAfter.push_back(AdIAftCC);
 
 	      if(DEBUG_RA) {
 
@@ -1368,10 +1368,10 @@
 	    } else {
 	      // for any other register type, just add the pop inst
 	      AdIAft = cpMem2RegMI(getFramePointer(), StackOff, Reg, RegType );
-	      ((PRA.AddedInstrMap[MInst])->InstrnsAfter).push_back(AdIAft);
+	      PRA.AddedInstrMap[MInst]->InstrnsAfter.push_back(AdIAft);
 	    }
 	    
-	    PushedRegSet.insert( Reg );
+	    PushedRegSet.insert(Reg);
 
 	    if(DEBUG_RA) {
 	      cerr << "\nFor call inst:" << *MInst;