Skip to content

Commit 72d38e9

Browse files
committed
[IDE] Move definition of low-level runNameMatcher entry point to .cpp file
1 parent e8d148a commit 72d38e9

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

include/swift/IDE/IDEBridging.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,4 @@ class BridgedResolvedLocVector {
160160
void *getOpaqueValue() const;
161161
};
162162

163-
#ifdef __cplusplus
164-
extern "C" {
165-
#endif
166-
167-
/// Low-level entry point to run the NameMatcher written in swift-syntax.
168-
///
169-
/// - Warning: The only caller of this should be `swift::ide::runNameMatcher`.
170-
///
171-
/// - Parameters:
172-
/// - sourceFilePtr: A pointer to an `ExportedSourceFile`, used to access the
173-
/// syntax tree
174-
/// - locations: Pointer to a buffer of `BridgedSourceLoc` that should be
175-
/// resolved by the name matcher.
176-
/// - locationsCount: Number of elements in `locations`.
177-
/// - Returns: The opaque value of a `BridgedResolvedLocVector`.
178-
void *swift_SwiftIDEUtilsBridging_runNameMatcher(const void *sourceFilePtr,
179-
BridgedSourceLoc *locations,
180-
size_t locationsCount);
181-
#ifdef __cplusplus
182-
}
183-
#endif
184-
185163
#endif

lib/IDE/Utils.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,21 @@ void swift::ide::getReceiverType(Expr *Base,
10961096
}
10971097

10981098
#if SWIFT_BUILD_SWIFT_SYNTAX
1099+
extern "C" {
1100+
/// Low-level entry point to run the NameMatcher written in swift-syntax.
1101+
///
1102+
/// - Parameters:
1103+
/// - sourceFilePtr: A pointer to an `ExportedSourceFile`, used to access the
1104+
/// syntax tree
1105+
/// - locations: Pointer to a buffer of `BridgedSourceLoc` that should be
1106+
/// resolved by the name matcher.
1107+
/// - locationsCount: Number of elements in `locations`.
1108+
/// - Returns: The opaque value of a `BridgedResolvedLocVector`.
1109+
void *swift_SwiftIDEUtilsBridging_runNameMatcher(const void *sourceFilePtr,
1110+
BridgedSourceLoc *locations,
1111+
size_t locationsCount);
1112+
}
1113+
10991114
std::vector<ResolvedLoc>
11001115
swift::ide::runNameMatcher(const SourceFile &sourceFile,
11011116
ArrayRef<SourceLoc> locations) {

0 commit comments

Comments
 (0)