Skip to content

Commit a168a94

Browse files
committed
[ClangImporter] NFC: Transform applyTypeAttributes into getConcurrencyAttrs
It has to be reachable to declaration converter to handle attributes associated with generic parameters.
1 parent 2e36b2c commit a168a94

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ static ImportedType adjustTypeForConcreteImport(
16331633
return {importedType, isIUO};
16341634
}
16351635

1636-
static void applyTypeAttributes(ASTContext &SwiftContext,
1636+
void swift::getConcurrencyAttrs(ASTContext &SwiftContext,
16371637
ImportTypeKind importKind,
16381638
ImportTypeAttrs &attrs, clang::QualType type) {
16391639
bool isMainActor = false;
@@ -1728,7 +1728,7 @@ ImportedType ClangImporter::Implementation::importType(
17281728
optionality = translateNullability(*nullability, stripNonResultOptionality);
17291729
}
17301730

1731-
applyTypeAttributes(SwiftContext, importKind, attrs, type);
1731+
getConcurrencyAttrs(SwiftContext, importKind, attrs, type);
17321732

17331733
// If this is a completion handler parameter, record the function type whose
17341734
// parameters will act as the results of the completion handler.

lib/ClangImporter/ImporterImpl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ using ImportTypeAttrs = OptionSet<ImportTypeAttr>;
229229
/// attributes will be imported.
230230
ImportTypeAttrs getImportTypeAttrs(const clang::Decl *D, bool isParam = false);
231231

232+
/// Extract concurrency related attributes from a type.
233+
///
234+
/// \param SwiftContext The context.
235+
/// \param importKind The kind of import being performed.
236+
/// \param attrs The list to add the new attributes to.
237+
/// \param type The type to extract attributes from.
238+
void getConcurrencyAttrs(ASTContext &SwiftContext, ImportTypeKind importKind,
239+
ImportTypeAttrs &attrs, clang::QualType type);
240+
232241
struct ImportDiagnostic {
233242
ImportDiagnosticTarget target;
234243
Diagnostic diag;

0 commit comments

Comments
 (0)