@@ -50,6 +50,10 @@ class ReabstractionInfo {
50
50
// / to direct.
51
51
llvm::SmallBitVector Conversions;
52
52
53
+ // / If set, indirect to direct conversions should be performned by the generic
54
+ // / specializer.
55
+ bool ConvertIndirectToDirect;
56
+
53
57
// / The first NumResults bits in Conversions refer to formal indirect
54
58
// / out-parameters.
55
59
unsigned NumFormalIndirectResults;
@@ -130,7 +134,8 @@ class ReabstractionInfo {
130
134
// / If specialization is not possible getSpecializedType() will return an
131
135
// / invalid type.
132
136
ReabstractionInfo (ApplySite Apply, SILFunction *Callee,
133
- SubstitutionList ParamSubs);
137
+ SubstitutionList ParamSubs,
138
+ bool ConvertIndirectToDirect = true );
134
139
135
140
// / Constructs the ReabstractionInfo for generic function \p Orig with
136
141
// / additional requirements. Requirements may contain new layout,
@@ -140,14 +145,15 @@ class ReabstractionInfo {
140
145
// / Returns true if the \p ParamIdx'th (non-result) formal parameter is
141
146
// / converted from indirect to direct.
142
147
bool isParamConverted (unsigned ParamIdx) const {
143
- return Conversions.test (ParamIdx + NumFormalIndirectResults);
148
+ return ConvertIndirectToDirect &&
149
+ Conversions.test (ParamIdx + NumFormalIndirectResults);
144
150
}
145
151
146
152
// / Returns true if the \p ResultIdx'th formal result is converted from
147
153
// / indirect to direct.
148
154
bool isFormalResultConverted (unsigned ResultIdx) const {
149
155
assert (ResultIdx < NumFormalIndirectResults);
150
- return Conversions.test (ResultIdx);
156
+ return ConvertIndirectToDirect && Conversions.test (ResultIdx);
151
157
}
152
158
153
159
// / Gets the total number of original function arguments.
0 commit comments