File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,7 @@ class RefCountBitsT {
546
546
// Returns true if the increment is a fast-path result.
547
547
// Returns false if the increment should fall back to some slow path
548
548
// (for example, because UseSlowRC is set or because the refcount overflowed).
549
- LLVM_NODISCARD SWIFT_ALWAYS_INLINE bool
549
+ SWIFT_NODISCARD SWIFT_ALWAYS_INLINE bool
550
550
incrementStrongExtraRefCount (uint32_t inc) {
551
551
// This deliberately overflows into the UseSlowRC field.
552
552
bits += BitsType (inc) << Offsets::StrongExtraRefCountShift;
@@ -557,7 +557,7 @@ class RefCountBitsT {
557
557
// Returns false if the decrement should fall back to some slow path
558
558
// (for example, because UseSlowRC is set
559
559
// or because the refcount is now zero and should deinit).
560
- LLVM_NODISCARD SWIFT_ALWAYS_INLINE bool
560
+ SWIFT_NODISCARD SWIFT_ALWAYS_INLINE bool
561
561
decrementStrongExtraRefCount (uint32_t dec) {
562
562
#ifndef NDEBUG
563
563
if (!hasSideTable () && !isImmortal (false )) {
@@ -1409,8 +1409,8 @@ class HeapObjectSideTableEntry {
1409
1409
1410
1410
1411
1411
// WEAK
1412
-
1413
- LLVM_NODISCARD
1412
+
1413
+ SWIFT_NODISCARD
1414
1414
HeapObjectSideTableEntry* incrementWeak () {
1415
1415
// incrementWeak need not be atomic w.r.t. concurrent deinit initiation.
1416
1416
// The client can't actually get a reference to the object without
Original file line number Diff line number Diff line change 149
149
#define SWIFT_FALLTHROUGH
150
150
#endif
151
151
152
+ #if __cplusplus >= 201402l && __has_cpp_attribute(nodiscard)
153
+ #define SWIFT_NODISCARD [[nodiscard]]
154
+ #elif __has_cpp_attribute(clang::warn_unused_result)
155
+ #define SWIFT_NODISCARD [[clang::warn_unused_result]]
156
+ #else
157
+ #define SWIFT_NODISCARD
158
+ #endif
159
+
152
160
153
161
// / Attributes for runtime-stdlib interfaces.
154
162
// / Use these for C implementations that are imported into Swift via SwiftShims
You can’t perform that action at this time.
0 commit comments