mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #80577 from atrick/addressable-escape
Fix GenericSpecializer for addressable parameters.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -641,6 +641,10 @@ public:
|
||||
return getArgumentParameterInfo(oper).hasOption(SILParameterInfo::Sending);
|
||||
}
|
||||
|
||||
/// Return true if 'operand' is addressable after type substitution in the
|
||||
/// caller's context.
|
||||
bool isAddressable(const Operand &operand) const;
|
||||
|
||||
static ApplySite getFromOpaqueValue(void *p) { return ApplySite(p); }
|
||||
|
||||
friend bool operator==(ApplySite lhs, ApplySite rhs) {
|
||||
|
||||
@@ -84,7 +84,8 @@ class ReabstractionInfo {
|
||||
/// specializer.
|
||||
bool ConvertIndirectToDirect = true;
|
||||
|
||||
/// If true, drop unused arguments.
|
||||
/// If true, drop unused arguments. Dropping unused arguments is a
|
||||
/// prerequisite before promoting an indirect argument to a direct argument.
|
||||
/// See `droppedArguments`.
|
||||
bool dropUnusedArguments = false;
|
||||
|
||||
@@ -204,7 +205,7 @@ public:
|
||||
ReabstractionInfo(ModuleDecl *targetModule, bool isModuleWholeModule,
|
||||
ApplySite Apply, SILFunction *Callee,
|
||||
SubstitutionMap ParamSubs, SerializedKind_t Serialized,
|
||||
bool ConvertIndirectToDirect, bool dropMetatypeArgs,
|
||||
bool ConvertIndirectToDirect, bool dropUnusedArguments,
|
||||
OptRemark::Emitter *ORE = nullptr);
|
||||
|
||||
/// Constructs the ReabstractionInfo for generic function \p Callee with
|
||||
|
||||
Reference in New Issue
Block a user