SIL: Introduce a new @inout_aliasable parameter convention.

Modeling nonescaping captures as @inout parameters is wrong, because captures are allowed to share state, unlike 'inout' parameters, which are allowed to assume to some degree that there are no aliases during the parameter's scope. To model this, introduce a new @inout_aliasable parameter convention to indicate an indirect parameter that can be written to, not only by the current function, but by well-typed, well-synchronized aliasing accesses too. (This is unrelated to our discussions of adding a "type-unsafe-aliasable" annotation to pointer_to_address to allow for safe pointer punning.)
This commit is contained in:
Joe Groff
2015-11-25 12:41:45 -08:00
parent 6b55e87d2f
commit b1667ec705
36 changed files with 161 additions and 88 deletions

View File

@@ -306,7 +306,7 @@ static bool verifySILSelfParameterType(SILDeclRef DeclRef,
// Otherwise, if this function type has a guaranteed self parameter type,
// make sure that we have a +0 self param.
return !FTy->getExtInfo().hasGuaranteedSelfParam() ||
PInfo.isGuaranteed() || PInfo.isIndirectInOut();
PInfo.isGuaranteed() || PInfo.isIndirectMutating();
}
SILFunction *SILModule::getOrCreateFunction(SILLocation loc,