@@ -214,15 +214,7 @@ AnalysisType *Pass::getAnalysisIfAvailable() const {
214
214
assert (Resolver && " Pass not resident in a PassManager object!" );
215
215
216
216
const void *PI = &AnalysisType::ID;
217
-
218
- Pass *ResultPass = Resolver->getAnalysisIfAvailable (PI);
219
- if (!ResultPass) return nullptr ;
220
-
221
- // Because the AnalysisType may not be a subclass of pass (for
222
- // AnalysisGroups), we use getAdjustedAnalysisPointer here to potentially
223
- // adjust the return pointer (because the class may multiply inherit, once
224
- // from pass, once from AnalysisType).
225
- return (AnalysisType*)ResultPass->getAdjustedAnalysisPointer (PI);
217
+ return (AnalysisType *)Resolver->getAnalysisIfAvailable (PI);
226
218
}
227
219
228
220
// / getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -245,12 +237,7 @@ AnalysisType &Pass::getAnalysisID(AnalysisID PI) const {
245
237
assert (ResultPass &&
246
238
" getAnalysis*() called on an analysis that was not "
247
239
" 'required' by pass!" );
248
-
249
- // Because the AnalysisType may not be a subclass of pass (for
250
- // AnalysisGroups), we use getAdjustedAnalysisPointer here to potentially
251
- // adjust the return pointer (because the class may multiply inherit, once
252
- // from pass, once from AnalysisType).
253
- return *(AnalysisType*)ResultPass->getAdjustedAnalysisPointer (PI);
240
+ return *(AnalysisType *)ResultPass;
254
241
}
255
242
256
243
// / getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -282,12 +269,7 @@ AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F, bool *Changed) {
282
269
else
283
270
assert (!LocalChanged &&
284
271
" A pass trigged a code update but the update status is lost" );
285
-
286
- // Because the AnalysisType may not be a subclass of pass (for
287
- // AnalysisGroups), we use getAdjustedAnalysisPointer here to potentially
288
- // adjust the return pointer (because the class may multiply inherit, once
289
- // from pass, once from AnalysisType).
290
- return *(AnalysisType*)ResultPass->getAdjustedAnalysisPointer (PI);
272
+ return *(AnalysisType *)ResultPass;
291
273
}
292
274
293
275
} // end namespace llvm
0 commit comments