57
57
#define BRIDGED_INLINE inline
58
58
#endif
59
59
60
+ namespace llvm {
61
+ class raw_ostream ;
62
+ } // end namespace llvm
63
+
60
64
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
61
65
62
66
typedef intptr_t SwiftInt;
@@ -72,14 +76,14 @@ typedef uintptr_t SwiftUInt;
72
76
// PURE_BRIDGING_MODE.
73
77
#define BRIDGING_WRAPPER_IMPL (Node, Name, Nullability ) \
74
78
class Bridged ##Name { \
75
- swift:: Node * Nullability Ptr; \
79
+ Node * Nullability Ptr; \
76
80
\
77
81
public: \
78
82
SWIFT_UNAVAILABLE (" Use init(raw:) instead" ) \
79
- Bridged##Name(swift:: Node * Nullability ptr) : Ptr(ptr) {} \
83
+ Bridged##Name(Node * Nullability ptr) : Ptr(ptr) {} \
80
84
\
81
85
SWIFT_UNAVAILABLE (" Use '.raw' instead" ) \
82
- swift:: Node * Nullability unbridged () const { return Ptr; } \
86
+ Node * Nullability unbridged () const { return Ptr; } \
83
87
}; \
84
88
\
85
89
SWIFT_NAME (" getter:Bridged" #Name " .raw(self:)" ) \
@@ -89,15 +93,15 @@ typedef uintptr_t SwiftUInt;
89
93
\
90
94
SWIFT_NAME (" Bridged" #Name " .init(raw:)" ) \
91
95
inline Bridged##Name Bridged##Name##_fromRaw(void * Nullability ptr) { \
92
- return static_cast <swift:: Node *>(ptr); \
96
+ return static_cast <Node *>(ptr); \
93
97
}
94
98
95
99
// Bridging wrapper macros for convenience.
96
- #define BRIDGING_WRAPPER_NONNULL (Name ) \
97
- BRIDGING_WRAPPER_IMPL (Name , Name, _Nonnull)
100
+ #define BRIDGING_WRAPPER_NONNULL (Node, Name ) \
101
+ BRIDGING_WRAPPER_IMPL (Node , Name, _Nonnull)
98
102
99
- #define BRIDGING_WRAPPER_NULLABLE (Name ) \
100
- BRIDGING_WRAPPER_IMPL (Name , Nullable##Name, _Nullable)
103
+ #define BRIDGING_WRAPPER_NULLABLE (Node, Name ) \
104
+ BRIDGING_WRAPPER_IMPL (Node , Nullable##Name, _Nullable)
101
105
102
106
// ===----------------------------------------------------------------------===//
103
107
// MARK: ArrayRef
@@ -179,9 +183,7 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedFeature {
179
183
// MARK: OStream
180
184
// ===----------------------------------------------------------------------===//
181
185
182
- struct BridgedOStream {
183
- void * _Nonnull streamAddr;
184
- };
186
+ BRIDGING_WRAPPER_NONNULL (llvm::raw_ostream, OStream)
185
187
186
188
// ===----------------------------------------------------------------------===//
187
189
// MARK: StringRef
0 commit comments