@@ -214,15 +214,7 @@ AnalysisType *Pass::getAnalysisIfAvailable() const {
214214 assert (Resolver && " Pass not resident in a PassManager object!" );
215215
216216 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);
226218}
227219
228220// / getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -245,12 +237,7 @@ AnalysisType &Pass::getAnalysisID(AnalysisID PI) const {
245237 assert (ResultPass &&
246238 " getAnalysis*() called on an analysis that was not "
247239 " '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;
254241}
255242
256243// / getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -282,12 +269,7 @@ AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F, bool *Changed) {
282269 else
283270 assert (!LocalChanged &&
284271 " 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;
291273}
292274
293275} // end namespace llvm
0 commit comments