5757#define BRIDGED_INLINE inline
5858#endif
5959
60+ namespace llvm {
61+ class raw_ostream ;
62+ } // end namespace llvm
63+
6064SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
6165
6266typedef intptr_t SwiftInt;
@@ -72,14 +76,14 @@ typedef uintptr_t SwiftUInt;
7276// PURE_BRIDGING_MODE.
7377#define BRIDGING_WRAPPER_IMPL (Node, Name, Nullability ) \
7478 class Bridged ##Name { \
75- swift:: Node * Nullability Ptr; \
79+ Node * Nullability Ptr; \
7680 \
7781 public: \
7882 SWIFT_UNAVAILABLE (" Use init(raw:) instead" ) \
79- Bridged##Name(swift:: Node * Nullability ptr) : Ptr(ptr) {} \
83+ Bridged##Name(Node * Nullability ptr) : Ptr(ptr) {} \
8084 \
8185 SWIFT_UNAVAILABLE (" Use '.raw' instead" ) \
82- swift:: Node * Nullability unbridged () const { return Ptr; } \
86+ Node * Nullability unbridged () const { return Ptr; } \
8387 }; \
8488 \
8589 SWIFT_NAME (" getter:Bridged" #Name " .raw(self:)" ) \
@@ -89,15 +93,15 @@ typedef uintptr_t SwiftUInt;
8993 \
9094 SWIFT_NAME (" Bridged" #Name " .init(raw:)" ) \
9195 inline Bridged##Name Bridged##Name##_fromRaw(void * Nullability ptr) { \
92- return static_cast <swift:: Node *>(ptr); \
96+ return static_cast <Node *>(ptr); \
9397 }
9498
9599// 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)
98102
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)
101105
102106// ===----------------------------------------------------------------------===//
103107// MARK: ArrayRef
@@ -179,9 +183,7 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedFeature {
179183// MARK: OStream
180184// ===----------------------------------------------------------------------===//
181185
182- struct BridgedOStream {
183- void * _Nonnull streamAddr;
184- };
186+ BRIDGING_WRAPPER_NONNULL (llvm::raw_ostream, OStream)
185187
186188// ===----------------------------------------------------------------------===//
187189// MARK: StringRef
0 commit comments