Merge pull request #80708 from atrick/irgen-addressable

Fix IRGen for @_addressable params which may be "captured".
This commit is contained in:
Andrew Trick
2025-04-10 14:22:01 -07:00
committed by GitHub
4 changed files with 97 additions and 25 deletions

View File

@@ -5452,6 +5452,10 @@ public:
return getParameters().back();
}
unsigned getSelfParameterIndex() const {
return NumParameters - 1;
}
/// Return SILParameterInfo for the isolated parameter in this SILFunctionType
/// if one exists. Returns None otherwise.
std::optional<SILParameterInfo> maybeGetIsolatedParameter() const {
@@ -5656,6 +5660,17 @@ public:
/// Defined in SILType.cpp.
bool isAddressable(unsigned paramIdx, SILFunction *caller);
/// Return true of the specified parameter is addressable based on its type
/// lowering. This includes @_addressableForDependencies parameter types.
///
/// 'genericEnv' may be null.
///
/// Defined in SILType.cpp.
bool isAddressable(unsigned paramIdx, SILModule &module,
GenericEnvironment *genericEnv,
Lowering::TypeConverter &typeConverter,
TypeExpansionContext expansion);
/// Returns true if the function type stores a Clang type that cannot
/// be derived from its Swift type. Returns false otherwise, including if
/// the function type is not @convention(c) or @convention(block).