File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
test/SILOptimizer/Inputs/cross-module Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,9 @@ bool CrossModuleOptimization::canSerializeFunction(
207207 // Do the same check for the specializations of such functions.
208208 if (function->isSpecialization ()) {
209209 const SILFunction *parent = function->getSpecializationInfo ()->getParent ();
210- if (!parent->getSpecializeAttrs ().empty ())
210+ // Don't serialize exported (public) specializations.
211+ if (!parent->getSpecializeAttrs ().empty () &&
212+ function->getLinkage () == SILLinkage::Public)
211213 return false ;
212214 }
213215
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public struct Container {
1717 var arr = Array < Base > ( )
1818 arr. append ( Base ( ) )
1919 print ( arr)
20+ dontBlockSerialization ( arr)
2021 return t
2122 }
2223
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ public func genericSubmoduleFunc<T>(_ t: T) {
1010 printit ( t)
1111}
1212
13+ @_specialize ( exported: true , where T == Int)
14+ @inlinable
15+ @inline ( never)
16+ public func dontBlockSerialization< T> ( _ t: T ) {
17+ print ( t)
18+ }
You can’t perform that action at this time.
0 commit comments