mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ClangImporter][Swiftify] merge importBoundsAttributes with importSpanAttributes and support lifetime bounds for __counted_by - [ClangImporter] Merge paths for std::span and __counted_by importBoundsAttributes and importSpanAttributes are merged into a single function named swiftify. This allows us to not have to duplicate the effort of attaching _SwiftifyImport macros, but is also necessary to allow importing a function with both __counted_by and std::span types. - [ClangImporter] Enable parsing bounds safety attributes in C++ This allows combining __counted_by and std::span for safe interop. Previously we disabled this in C++ mode due to issues when bounds attributes occurred directly or indirectly in templated contexts, but this has now been resolved on the clang side. - [Swiftify] Emit Span for counted_by return values with lifetime info __counted_by return values with .lifetimeDependence are now mapped to Span instead of UnsafeBufferPointer. Also fixes bug where std::span return values would map to Span even if lifetime dependence info was missing.