Skip to content

Commit bda3c7f

Browse files
committed
Use BRIDGED_INLINE to avoid dummy constructor in BridgedConsumedLookupResult.
1 parent d724230 commit bda3c7f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

include/swift/AST/ASTBridging.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,9 @@ struct BridgedConsumedLookupResult {
103103
SWIFT_NAME("flag")
104104
SwiftInt Flag;
105105

106-
#ifdef USED_IN_CPP_SOURCE
107-
BridgedConsumedLookupResult(swift::Identifier name,
108-
swift::SourceLoc sourceLoc, SwiftInt flag)
109-
: Name(BridgedIdentifier(name)), NameLoc(BridgedSourceLoc(sourceLoc)),
110-
Flag(flag) {}
111-
#endif
112-
113-
BridgedConsumedLookupResult(void*_Nullable, void*_Nullable, int); // DO NOT CALL
106+
BRIDGED_INLINE BridgedConsumedLookupResult(swift::Identifier name,
107+
swift::SourceLoc sourceLoc,
108+
SwiftInt flag);
114109
};
115110

116111
class BridgedDeclBaseName {

include/swift/AST/ASTBridgingImpl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ swift::DeclBaseName BridgedDeclBaseName::unbridged() const {
4848
return swift::DeclBaseName(Ident.unbridged());
4949
}
5050

51+
//===----------------------------------------------------------------------===//
52+
// MARK: BridgedDeclBaseName
53+
//===----------------------------------------------------------------------===//
54+
55+
BridgedConsumedLookupResult::BridgedConsumedLookupResult(
56+
swift::Identifier name, swift::SourceLoc sourceLoc, SwiftInt flag)
57+
: Name(BridgedIdentifier(name)), NameLoc(BridgedSourceLoc(sourceLoc)),
58+
Flag(flag) {}
59+
5160
//===----------------------------------------------------------------------===//
5261
// MARK: BridgedDeclNameRef
5362
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)