mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Make sure that we do not try to create shared versions of stdlib_binary_only functions when specializing.
This can only happen in the closure specializer and the generic specializer since all other specializations either copy the linkage of the original function (function signature opts) or clone closures/thunks which have shared linkage. I put in a verifier check that makes sure we do not create shared versions of these functions. The real problem has to do with serializing these sorts of functions, but since we always serialize shared functions, it makes sense to just ban it. rdar://20082696 Swift SVN r26001
This commit is contained in:
@@ -2683,12 +2683,15 @@ public:
|
||||
CanSILFunctionType FTy = F->getLoweredFunctionType();
|
||||
verifySILFunctionType(FTy);
|
||||
|
||||
// If we have shared visibility, make sure that it is legal for this
|
||||
// function to have shared linkage.
|
||||
if (hasSharedVisibility(F->getLinkage()))
|
||||
require(F->canHaveSharedLinkage(),
|
||||
"Function can not legally have shared linkage");
|
||||
|
||||
if (F->isExternalDeclaration()) {
|
||||
assert(F->isAvailableExternally() &&
|
||||
"external declaration of internal SILFunction not allowed");
|
||||
assert(!hasSharedVisibility(F->getLinkage()) &&
|
||||
"external declarations of SILFunctions with shared visiblity is not "
|
||||
"allowed");
|
||||
require(F->isAvailableExternally(),
|
||||
"external declaration of internal SILFunction not allowed");
|
||||
// If F is an external declaration, there is nothing further to do,
|
||||
// return.
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user