Skip to content

Commit 8037b5d

Browse files
committed
[Backtracing] Turn off MemberImportVisibility for the Runtime module.
The Runtime module is using C++ interop, which doesn't seem to play nicely with MemberImportVisibility. rdar://124913332
1 parent a0e726c commit 8037b5d

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

stdlib/public/RuntimeModule/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ set(RUNTIME_COMPILE_FLAGS
6262
"-Xfrontend;-experimental-spi-only-imports"
6363
"-Xcc;-I${SWIFT_SOURCE_DIR}/include"
6464
"-Xcc;-I${CMAKE_BINARY_DIR}/include"
65-
"-Xcc;-I${SWIFT_STDLIB_SOURCE_DIR}/public/RuntimeModule/modules")
65+
"-Xcc;-I${SWIFT_STDLIB_SOURCE_DIR}/public/RuntimeModule/modules"
66+
"-disable-upcoming-feature MemberImportVisibility")
6667

6768
###TODO: Add these when we add static linking support
6869
#

stdlib/public/RuntimeModule/modules/Runtime/Runtime.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,29 @@
2323
#include "swift/Runtime/CrashInfo.h"
2424

2525
#ifdef __cplusplus
26-
extern "C" {
26+
namespace swift {
27+
namespace runtime {
28+
29+
#define EXTERN_C extern "C"
30+
#else
31+
#define EXTERN_C
2732
#endif
2833

2934
// Can't import swift/Runtime/Debug.h because it assumes C++
30-
void swift_reportWarning(uint32_t flags, const char *message);
35+
EXTERN_C void swift_reportWarning(uint32_t flags, const char *message);
3136

3237
// Returns true if the given function is a thunk function
33-
bool _swift_backtrace_isThunkFunction(const char *rawName);
38+
EXTERN_C bool _swift_backtrace_isThunkFunction(const char *rawName);
3439

3540
// Demangle the given raw name (supports Swift and C++)
36-
char *_swift_backtrace_demangle(const char *rawName,
37-
size_t rawNameLength,
38-
char *outputBuffer,
39-
size_t *outputBufferSize);
41+
EXTERN_C char *_swift_backtrace_demangle(const char *rawName,
42+
size_t rawNameLength,
43+
char *outputBuffer,
44+
size_t *outputBufferSize);
4045

4146
#ifdef __cplusplus
42-
}
47+
} // namespace runtime
48+
} // namespace swift
4349
#endif
4450

4551
#endif // SWIFT_BACKTRACING_RUNTIME_H

0 commit comments

Comments
 (0)