[ownership] Do not specialize transparent ossa functions called from non-ossa functions.

This commit is contained in:
Michael Gottesman
2019-02-11 19:14:41 -08:00
parent 32b7c26a94
commit c4b701980b
2 changed files with 37 additions and 0 deletions

View File

@@ -2292,6 +2292,15 @@ void swift::trySpecializeApplyOfGeneric(
if (shouldNotSpecialize(RefF, F))
return;
// If our callee has ownership, do not specialize for now. This should only
// occur with transparent referenced functions.
//
// FIXME: Support this.
if (RefF->hasOwnership()) {
assert(RefF->isTransparent());
return;
}
// If the caller and callee are both fragile, preserve the fragility when
// cloning the callee. Otherwise, strip it off so that we can optimize
// the body more.