mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil-generic-specializer] Provide a possibility to disable the indirect-to-direct conversions of parameters and results
This is required by the capture propagation pass. Indirect-to-direct conversions are still performed by default.
This commit is contained in:
@@ -290,10 +290,13 @@ bool ReabstractionInfo::canBeSpecialized(ApplySite Apply, SILFunction *Callee,
|
||||
}
|
||||
|
||||
ReabstractionInfo::ReabstractionInfo(ApplySite Apply, SILFunction *Callee,
|
||||
ArrayRef<Substitution> ParamSubs) {
|
||||
ArrayRef<Substitution> ParamSubs,
|
||||
bool ConvertIndirectToDirect) {
|
||||
if (!prepareAndCheck(Apply, Callee, ParamSubs))
|
||||
return;
|
||||
|
||||
this->ConvertIndirectToDirect = ConvertIndirectToDirect;
|
||||
|
||||
if (SpecializeGenericSubstitutions) {
|
||||
specializeConcreteAndGenericSubstitutions(Apply, Callee, ParamSubs);
|
||||
} else {
|
||||
@@ -639,6 +642,8 @@ ReabstractionInfo::ReabstractionInfo(SILFunction *OrigF,
|
||||
checkSpecializationRequirements(Requirements);
|
||||
|
||||
OriginalF = OrigF;
|
||||
ConvertIndirectToDirect = true;
|
||||
|
||||
SILModule &M = OrigF->getModule();
|
||||
auto &Ctx = M.getASTContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user