File tree Expand file tree Collapse file tree 4 files changed +36
-16
lines changed Expand file tree Collapse file tree 4 files changed +36
-16
lines changed Original file line number Diff line number Diff line change 39
39
40
40
#include " swift/Basic/BridgedSwiftObject.h"
41
41
#include " swift/Basic/Compiler.h"
42
+ #include " swift/Basic/SwiftBridging.h"
42
43
43
44
#include < stddef.h>
44
45
#include < stdint.h>
55
56
#include < vector>
56
57
#endif
57
58
58
- // FIXME: We ought to be importing '<swift/bridging>' instead.
59
- #if __has_attribute(swift_name)
60
- #define SWIFT_NAME (NAME ) __attribute__((swift_name(NAME)))
61
- #else
62
- #define SWIFT_NAME (NAME )
63
- #endif
64
-
65
59
#if __has_attribute(availability)
66
60
#define SWIFT_UNAVAILABLE (msg ) \
67
61
__attribute__ ((availability(swift, unavailable, message=msg)))
Original file line number Diff line number Diff line change 90
90
#define SWIFT_IMPORT_UNSAFE
91
91
#endif
92
92
93
- // / Same as `SWIFT_SELF_CONTAINED` in <swift/bridging>.
94
- #if __has_attribute(swift_attr)
95
- #define SWIFT_SELF_CONTAINED __attribute__ ((swift_attr(" import_owned" )))
96
- #else
97
- #define SWIFT_SELF_CONTAINED
98
- #endif
99
-
100
93
#ifdef __GNUC__
101
94
#define SWIFT_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
102
95
#elif defined(_MSC_VER)
Original file line number Diff line number Diff line change
1
+ // ===--- Basic/SwiftBridging.h ----------------------------------*- C++ -*-===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+ // /
13
+ // / This is a wrapper around `<swift/bridging>` that redefines `SWIFT_NAME` to
14
+ // / accept a string literal. String literals enable us to properly format the
15
+ // / long Swift declaration names that many of our bridging functions have.
16
+ // /
17
+ // ===----------------------------------------------------------------------===//
18
+
19
+ #ifndef SWIFT_BASIC_SWIFT_BRIDGING_H
20
+ #define SWIFT_BASIC_SWIFT_BRIDGING_H
21
+
22
+ #include < swift/bridging>
23
+
24
+ #undef SWIFT_NAME
25
+ #if __has_attribute(swift_name)
26
+ #define SWIFT_NAME (NAME ) __attribute__((swift_name(NAME)))
27
+ #else
28
+ #define SWIFT_NAME (NAME )
29
+ #endif
30
+
31
+ #endif // SWIFT_BASIC_SWIFT_BRIDGING_H
32
+
Original file line number Diff line number Diff line change 13
13
#ifndef SWIFT_SIL_LOCATION_H
14
14
#define SWIFT_SIL_LOCATION_H
15
15
16
- #include " llvm/ADT/PointerUnion.h"
17
16
#include " swift/AST/ASTNode.h"
17
+ #include " swift/AST/TypeAlignments.h"
18
18
#include " swift/Basic/SourceLoc.h"
19
+ #include " swift/Basic/SwiftBridging.h"
19
20
#include " swift/SIL/SILAllocated.h"
20
- #include " swift/AST/TypeAlignments .h"
21
+ #include " llvm/ADT/PointerUnion .h"
21
22
22
23
#include < cstddef>
23
24
#include < type_traits>
You can’t perform that action at this time.
0 commit comments