Skip to content

Commit 5066729

Browse files
committed
Runtime: remove keypath functions in the compiler build
The host tools may be built with the host compiler. cl objects to the "extern C" function returning a C++ type which the keypath functions do. However, these declarations are needed only in the runtime, which is always built with clang. Preprocess away the declarations during the build of the compiler. This allows us to build with cl once more.
1 parent e71b2a5 commit 5066729

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/swift/Runtime/Metadata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ const TypeContextDescriptor *swift_getTypeContextDescriptor(const Metadata *type
805805
SWIFT_RUNTIME_EXPORT
806806
const HeapObject *swift_getKeyPath(const void *pattern, const void *arguments);
807807

808+
#if defined(swiftCore_EXPORTS)
808809
/// Given a pointer to a borrowed value of type `Root` and a
809810
/// `KeyPath<Root, Value>`, project a pointer to a borrowed value of type
810811
/// `Value`.
@@ -826,6 +827,7 @@ swift_modifyAtWritableKeyPath;
826827
SWIFT_RUNTIME_EXPORT
827828
YieldOnceCoroutine<OpaqueValue* (const OpaqueValue *root, void *keyPath)>::type
828829
swift_modifyAtReferenceWritableKeyPath;
830+
#endif
829831

830832
SWIFT_RUNTIME_EXPORT
831833
void swift_enableDynamicReplacementScope(const DynamicReplacementScope *scope);

0 commit comments

Comments
 (0)