Files
swift-mirror/test/Macros
Henrik G. Olsson df05addb44 Merge pull request #79552 from hnrklssn/swiftify-span-with-counted-by
[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.
2025-02-24 13:49:17 -08:00
..