@@ -144,7 +144,7 @@ class StackColoring : public MachineFunctionPass {
144
144
145
145
private:
146
146
// / Debug.
147
- void dump ();
147
+ void dump () const ;
148
148
149
149
// / Removes all of the lifetime marker instructions from the function.
150
150
// / \returns true if any markers were removed.
@@ -199,30 +199,36 @@ void StackColoring::getAnalysisUsage(AnalysisUsage &AU) const {
199
199
MachineFunctionPass::getAnalysisUsage (AU);
200
200
}
201
201
202
- void StackColoring::dump () {
202
+ void StackColoring::dump () const {
203
203
for (df_iterator<MachineFunction*> FI = df_begin (MF), FE = df_end (MF);
204
204
FI != FE; ++FI) {
205
- DEBUG (dbgs ()<<" Inspecting block #" <<BasicBlocks[ *FI] <<
205
+ DEBUG (dbgs ()<<" Inspecting block #" <<BasicBlocks. lookup ( *FI) <<
206
206
" [" <<FI->getName ()<<" ]\n " );
207
+
208
+ DenseMap<MachineBasicBlock*, BlockLifetimeInfo>::const_iterator BI =
209
+ BlockLiveness.find (*FI);
210
+ assert (BI != BlockLiveness.end () && " Block not found" );
211
+ const BlockLifetimeInfo &BlockInfo = BI->second ;
212
+
207
213
DEBUG (dbgs ()<<" BEGIN : {" );
208
- for (unsigned i=0 ; i < BlockLiveness[*FI] .Begin .size (); ++i)
209
- DEBUG (dbgs ()<<BlockLiveness[*FI] .Begin .test (i)<<" " );
214
+ for (unsigned i=0 ; i < BlockInfo .Begin .size (); ++i)
215
+ DEBUG (dbgs ()<<BlockInfo .Begin .test (i)<<" " );
210
216
DEBUG (dbgs ()<<" }\n " );
211
217
212
218
DEBUG (dbgs ()<<" END : {" );
213
- for (unsigned i=0 ; i < BlockLiveness[*FI] .End .size (); ++i)
214
- DEBUG (dbgs ()<<BlockLiveness[*FI] .End .test (i)<<" " );
219
+ for (unsigned i=0 ; i < BlockInfo .End .size (); ++i)
220
+ DEBUG (dbgs ()<<BlockInfo .End .test (i)<<" " );
215
221
216
222
DEBUG (dbgs ()<<" }\n " );
217
223
218
224
DEBUG (dbgs ()<<" LIVE_IN: {" );
219
- for (unsigned i=0 ; i < BlockLiveness[*FI] .LiveIn .size (); ++i)
220
- DEBUG (dbgs ()<<BlockLiveness[*FI] .LiveIn .test (i)<<" " );
225
+ for (unsigned i=0 ; i < BlockInfo .LiveIn .size (); ++i)
226
+ DEBUG (dbgs ()<<BlockInfo .LiveIn .test (i)<<" " );
221
227
222
228
DEBUG (dbgs ()<<" }\n " );
223
229
DEBUG (dbgs ()<<" LIVEOUT: {" );
224
- for (unsigned i=0 ; i < BlockLiveness[*FI] .LiveOut .size (); ++i)
225
- DEBUG (dbgs ()<<BlockLiveness[*FI] .LiveOut .test (i)<<" " );
230
+ for (unsigned i=0 ; i < BlockInfo .LiveOut .size (); ++i)
231
+ DEBUG (dbgs ()<<BlockInfo .LiveOut .test (i)<<" " );
226
232
DEBUG (dbgs ()<<" }\n " );
227
233
}
228
234
}
0 commit comments