You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-2520 Type alias is lost when applying @escaping-ness
SR-2406 Print attribute((noescape)) in the generated header
Issue Description:
When I went to implement SR-2406, I discovered that function types imported from Clang (including function pointers, block pointers, and typedefs thereof) are imported with no regard for __attribute__((noescape)). The attribute should be preserved in the imported type's extInfo.
Here's a summary of how the flow seems to happen right now, from what I saw:
To import a typedef decls, the importer just calls getUnderlyingType() and imports that type:
auto swiftParamTy = Impl.importType(*param, ImportTypeKind::Parameter,
AllowNSUIntegerAsInt,
CanFullyBridgeTypes,
OTK_Optional);
if (!swiftParamTy)
returnType();
// FIXME: If we were walking TypeLocs, we could actually get parameter
// names. The probably doesn't matter outside of a FuncDecl, which
// we'll have to special-case, but it's an interesting bit of data loss.
params.push_back(swiftParamTy);
}
At that point, it seems like the noescape information is not available. Other places which use it are checking hasAttr<clang::NoEscapeAttr>() on a param decl, but this only has access to the param types.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 6d1ad1f08685b164784460a549014381
relates to:
Issue Description:
When I went to implement SR-2406, I discovered that function types imported from Clang (including function pointers, block pointers, and typedefs thereof) are imported with no regard for
__attribute__((noescape))
. The attribute should be preserved in the imported type's extInfo.Here's a summary of how the flow seems to happen right now, from what I saw:
swift/lib/ClangImporter/ImportDecl.cpp
Lines 1685 to 1690 in 1a88c86
swift/lib/ClangImporter/ImportType.cpp
Lines 379 to 382 in 1a88c86
swift/lib/ClangImporter/ImportType.cpp
Lines 482 to 496 in 1a88c86
hasAttr<clang::NoEscapeAttr>()
on a param decl, but this only has access to the param types.The text was updated successfully, but these errors were encountered: