Merge pull request #80577 from atrick/addressable-escape

Fix GenericSpecializer for addressable parameters.
This commit is contained in:
Andrew Trick
2025-04-08 12:44:28 -07:00
committed by GitHub
12 changed files with 221 additions and 83 deletions

View File

@@ -289,11 +289,6 @@ public:
&& scopeLifetimeParamIndices->contains(index);
}
bool checkAddressable(int index) const {
return hasAddressableParamIndices()
&& getAddressableIndices()->contains(index);
}
std::string getString() const;
void Profile(llvm::FoldingSetNodeID &ID) const;
void getConcatenatedData(SmallVectorImpl<bool> &concatenatedData) const;

View File

@@ -5649,6 +5649,13 @@ public:
return getLifetimeDependenceFor(getNumParameters());
}
/// Return true of the specified parameter is addressable based on its type
/// lowering in 'caller's context. This includes @_addressableForDependencies
/// parameter types.
///
/// Defined in SILType.cpp.
bool isAddressable(unsigned paramIdx, SILFunction *caller);
/// 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).