@@ -40,7 +40,7 @@ void vset_union(const std::set<Value *> &S1, const std::set<Value *> &S2,
4040}
4141
4242namespace llvm {
43- // / Find the successor instructions of the specified instruction.
43+
4444std::set<Instruction *>
4545LivenessAnalysis::getSuccessorInstructions (Instruction *I) {
4646 Instruction *Term = I->getParent ()->getTerminator ();
@@ -58,12 +58,10 @@ LivenessAnalysis::getSuccessorInstructions(Instruction *I) {
5858 return SuccInsts;
5959}
6060
61- // / Replaces the value set behind the pointer `S` with the value set `R` and
62- // / returns whether the set behind `S` changed.
63- bool LivenessAnalysis::updateValueSet (std::set<Value *> *S,
64- const std::set<Value *> R) {
65- const bool Changed = (*S != R);
66- *S = R;
61+ bool LivenessAnalysis::updateValueSet (std::set<Value *> &S,
62+ const std::set<Value *> &R) {
63+ const bool Changed = (S != R);
64+ S = R;
6765 return Changed;
6866}
6967
@@ -138,22 +136,20 @@ LivenessAnalysis::LivenessAnalysis(Function *Func) {
138136 for (Instruction *SI : SuccInsts) {
139137 NewOut.insert (In[SI].begin (), In[SI].end ());
140138 }
141- Changed |= updateValueSet (& Out[I], std::move ( NewOut) );
139+ Changed |= updateValueSet (Out[I], NewOut);
142140
143141 // Update in[I].
144142 std::set<Value *> OutMinusDef;
145143 vset_difference (Out[I], Defs[I], OutMinusDef);
146144
147145 std::set<Value *> NewIn;
148146 vset_union (Uses[I], OutMinusDef, NewIn);
149- Changed |= updateValueSet (& In[I], std::move ( NewIn) );
147+ Changed |= updateValueSet (In[I], NewIn);
150148 }
151149 }
152150 } while (Changed); // Until a fixed-point.
153151}
154152
155- // / Returns the set of live variables immediately before the specified
156- // / instruction.
157153std::set<Value *> LivenessAnalysis::getLiveVarsBefore (Instruction *I) {
158154 return In[I];
159155}
0 commit comments