Skip to content

Commit 2e7e884

Browse files
committed
Documentation comment cleanups
1 parent 71b96e9 commit 2e7e884

File tree

1 file changed

+20
-20
lines changed
  • lib/ClangImporter/SwiftBridging/swift

1 file changed

+20
-20
lines changed

lib/ClangImporter/SwiftBridging/swift/bridging

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// -*- C++ -*-
2-
//===------------------ bridging - C++ and Swift Interop --------*- C++ -*-===//
1+
// -*- C -*-
2+
//===------------------ bridging - C and Swift Interop ----------*- C++ -*-===//
33
//
44
// This source file is part of the Swift.org open source project
55
//
@@ -32,7 +32,7 @@
3232
/// that return a `class` or `struct` type that is annotated with this macro.
3333
#define SWIFT_SELF_CONTAINED __attribute__((swift_attr("import_owned")))
3434

35-
/// Specifies that a C++ method returns a value that is presumed to contain
35+
/// Specifies that a method returns a value that is presumed to contain
3636
/// objects whose lifetime is not dependent on `this` or other parameters passed
3737
/// to the method.
3838
#define SWIFT_RETURNS_INDEPENDENT_VALUE __attribute__((swift_attr("import_unsafe")))
@@ -45,7 +45,7 @@
4545
#define _CXX_INTEROP_CONCAT(...) \
4646
_CXX_INTEROP_CONCAT_(__VA_ARGS__,,,,,,,,,,,,,,,,,)
4747

48-
/// Specifies that a C `class` or `struct` is reference-counted using
48+
/// Specifies that a `class` or `struct` is reference-counted using
4949
/// the given `retain` and `release` functions. This annotation lets Swift import
5050
/// such a type as reference counted type in Swift, taking advantage of Swift's
5151
/// automatic reference counting.
@@ -103,7 +103,7 @@
103103
__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(retain:immortal)))) \
104104
__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(release:immortal))))
105105

106-
/// Specifies that a C++ `class` or `struct` is a reference type whose lifetime
106+
/// Specifies that a `class` or `struct` is a reference type whose lifetime
107107
/// is not managed automatically. The programmer must validate that any reference
108108
/// to such object is valid themselves. This annotation lets Swift import such a type as a reference type in Swift.
109109
#define SWIFT_UNSAFE_REFERENCE \
@@ -115,7 +115,7 @@
115115
/// Specifies a name that will be used in Swift for this declaration instead of its original name.
116116
#define SWIFT_NAME(_name) __attribute__((swift_name(#_name)))
117117

118-
/// Specifies that a specific C++ `class` or `struct` conforms to a
118+
/// Specifies that a specific `class` or `struct` conforms to a
119119
/// a specific Swift protocol.
120120
///
121121
/// This example shows how to use this macro to conform a class template to a Swift protocol:
@@ -147,7 +147,7 @@
147147
#define SWIFT_MUTATING \
148148
__attribute__((swift_attr("mutating")))
149149

150-
/// Specifies that a specific c++ type such class or struct should be imported as type marked
150+
/// Specifies that a specific class or struct should be imported as type marked
151151
/// as `@unchecked Sendable` type in swift. If this annotation is used, the type is therefore allowed to
152152
/// use safely across async contexts.
153153
///
@@ -160,13 +160,13 @@
160160
#define SWIFT_UNCHECKED_SENDABLE \
161161
__attribute__((swift_attr("@Sendable")))
162162

163-
/// Specifies that a class or struct should be imported as a non-copyable
163+
/// Specifies that a `class` or `struct` should be imported as a non-copyable
164164
/// Swift value type.
165165
#define SWIFT_NONCOPYABLE \
166166
__attribute__((swift_attr("~Copyable")))
167167

168-
/// Specifies that a class or struct should be imported as a non-copyable
169-
/// Swift value type that calls the given _destroy function when a value is no
168+
/// Specifies that a `class` or `struct` should be imported as a non-copyable
169+
/// Swift value type that calls the given `_destroy` function when a value is no
170170
/// longer used.
171171
///
172172
/// This example shows how to use this macro to let Swift know that
@@ -185,18 +185,18 @@
185185
/// let mt = mytypeCreate()
186186
/// let mt2 = mt // consumes mt
187187
/// // once mt2 is unused, Swift will call mytypeFreeMembers(mt2)
188+
/// ```
188189
#define SWIFT_NONCOPYABLE_WITH_DESTROY(_destroy) \
189190
__attribute__((swift_attr("~Copyable"))) \
190191
__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(destroy:_destroy))))
191192

192-
/// Specifies that a specific c++ type such class or struct should be imported
193-
/// as a non-escapable Swift value type when the non-escapable language feature
194-
/// is enabled.
193+
/// Specifies that a specific class or struct should be imported
194+
/// as a non-escapable Swift value type.
195195
#define SWIFT_NONESCAPABLE \
196196
__attribute__((swift_attr("~Escapable")))
197197

198-
/// Specifies that a specific c++ type such class or struct should be imported
199-
/// as a escapable Swift value. While this matches the default behavior,
198+
/// Specifies that a specific class or struct should be imported
199+
/// as an escapable Swift value. While this matches the default behavior,
200200
/// in safe mode interop mode it ensures that the type is not marked as
201201
/// unsafe.
202202
#define SWIFT_ESCAPABLE \
@@ -207,16 +207,16 @@
207207
#define SWIFT_ESCAPABLE_IF(...) \
208208
__attribute__((swift_attr("escapable_if:" _CXX_INTEROP_CONCAT(__VA_ARGS__))))
209209

210-
/// Specifies that the return value is passed as owned for C++ functions and
210+
/// Specifies that the return value is passed as owned for functions and
211211
/// methods returning types annotated as `SWIFT_SHARED_REFERENCE`
212212
#define SWIFT_RETURNS_RETAINED __attribute__((swift_attr("returns_retained")))
213-
/// Specifies that the return value is passed as unowned for C++ functions and
213+
/// Specifies that the return value is passed as unowned for functions and
214214
/// methods returning types annotated as `SWIFT_SHARED_REFERENCE`
215215
#define SWIFT_RETURNS_UNRETAINED \
216216
__attribute__((swift_attr("returns_unretained")))
217217

218-
/// Applied to a C++ foreign reference type annotated with
219-
/// SWIFT_SHARED_REFERENCE. Indicates that C++ APIs returning this type are
218+
/// Applied to a foreign reference type annotated with
219+
/// SWIFT_SHARED_REFERENCE. Indicates that APIs returning this type are
220220
/// assumed to return an unowned (+0) value by default, unless explicitly annotated
221221
/// with SWIFT_RETURNS_RETAINED.
222222
///
@@ -227,7 +227,7 @@
227227
/// Bar { ... };
228228
/// ```
229229
///
230-
/// In Swift, C++ APIs returning `Bar*` will be assumed to return an unowned
230+
/// In Swift, APIs returning `Bar*` will be assumed to return an unowned
231231
/// value.
232232
#define SWIFT_RETURNED_AS_UNRETAINED_BY_DEFAULT \
233233
__attribute__((swift_attr("returned_as_unretained_by_default")))

0 commit comments

Comments
 (0)