@@ -781,19 +781,15 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
781781 OMD->getLocation (), StartLoc);
782782
783783 if (OMD->isDirectMethod ()) {
784- if (CGM.getLangOpts ().ObjCRuntime .isNeXTFamily ()) {
785- // Having `InnerFn` indicates that we are generating a nil check thunk.
786- // In that case our job is done here.
787- if (InnerFn)
788- return ;
789- if (CGM.shouldHaveNilCheckThunk (OMD))
790- // Go generate a nil check thunk around `Fn`
791- CodeGenFunction (CGM, /* InnerFn=*/ Fn).GenerateObjCDirectThunk (OMD, CD);
792- CGM.getObjCRuntime ().GenerateDirectMethodPrologue (*this , Fn, OMD, CD);
793- } else {
794- // For GNU family, since GNU Step2 also supports direct methods now.
795- CGM.getObjCRuntime ().GenerateDirectMethodPrologue (*this , Fn, OMD, CD);
796- }
784+ // Having `InnerFn` indicates that we are generating a nil check thunk.
785+ // In that case our job is done here.
786+ if (InnerFn)
787+ return ;
788+ // Only NeXTFamily can have nil check thunk.
789+ if (CGM.shouldHaveNilCheckThunk (OMD))
790+ // Go generate a nil check thunk around `Fn`
791+ CodeGenFunction (CGM, /* InnerFn=*/ Fn).GenerateObjCDirectThunk (OMD, CD);
792+ CGM.getObjCRuntime ().GenerateDirectMethodPrologue (*this , Fn, OMD, CD);
797793 }
798794
799795 // In ARC, certain methods get an extra cleanup.
0 commit comments