File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -611,19 +611,23 @@ EffectsKind SILDeclRef::getEffectsAttribute() const {
611611}
612612
613613bool SILDeclRef::isForeignToNativeThunk () const {
614+ // If this isn't a native entry-point, it's not a foreign-to-native thunk.
615+ if (isForeign)
616+ return false ;
617+
614618 // Non-decl entry points are never natively foreign, so they would never
615619 // have a foreign-to-native thunk.
616620 if (!hasDecl ())
617621 return false ;
618622 if (requiresForeignToNativeThunk (getDecl ()))
619- return !isForeign ;
623+ return true ;
620624 // ObjC initializing constructors and factories are foreign.
621625 // We emit a special native allocating constructor though.
622626 if (isa<ConstructorDecl>(getDecl ())
623627 && (kind == Kind::Initializer
624628 || cast<ConstructorDecl>(getDecl ())->isFactoryInit ())
625629 && getDecl ()->hasClangNode ())
626- return !isForeign ;
630+ return true ;
627631 return false ;
628632}
629633
You can’t perform that action at this time.
0 commit comments