File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -203,21 +203,27 @@ class TypeRefinementContextBuilder : private ASTWalker {
203
203
204
204
return NewTRC;
205
205
}
206
-
206
+
207
207
// / Returns true if the declaration should introduce a new refinement context.
208
208
bool declarationIntroducesNewContext (Decl *D) {
209
209
if (!isa<ValueDecl>(D) && !isa<ExtensionDecl>(D)) {
210
210
return false ;
211
211
}
212
-
212
+
213
+ // Explicit inlinability may to the decl being used on an earlier OS
214
+ // version when inlined on the client side. This check assumes that
215
+ // implicit decls are handled elsewhere.
216
+ bool isExplicitlyInlinable = !D->isImplicit () &&
217
+ (D->getAttrs ().hasAttribute <InlinableAttr>() ||
218
+ D->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>());
219
+
213
220
// No need to introduce a context if the declaration does not have an
214
- // availability or inlinable attribute.
221
+ // availability or non-implicit inlinable attribute.
215
222
if (!hasActiveAvailableAttribute (D, Context) &&
216
- !D->getAttrs ().hasAttribute <InlinableAttr>() &&
217
- !D->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
223
+ !isExplicitlyInlinable) {
218
224
return false ;
219
225
}
220
-
226
+
221
227
// Only introduce for an AbstractStorageDecl if it is not local.
222
228
// We introduce for the non-local case because these may
223
229
// have getters and setters (and these may be synthesized, so they might
@@ -228,7 +234,7 @@ class TypeRefinementContextBuilder : private ASTWalker {
228
234
return false ;
229
235
}
230
236
}
231
-
237
+
232
238
return true ;
233
239
}
234
240
You can’t perform that action at this time.
0 commit comments