Skip to content

Commit 57f9c17

Browse files
install a list of symbols generated by the PrintAsClang header
rdar://93504690
1 parent 54102ef commit 57f9c17

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

lib/PrintAsClang/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,19 @@ target_link_libraries(swiftPrintAsClang PRIVATE
1313
swiftIDE)
1414

1515
set_swift_llvm_is_available(swiftPrintAsClang)
16+
17+
# Add target to install the list of symbols added to compatibility headers
18+
set(symbols_file "${CMAKE_CURRENT_SOURCE_DIR}/compatibility_symbols")
19+
20+
add_custom_target(swift-compatibility-symbols DEPENDS ${symbols_file})
21+
22+
add_dependencies(swiftPrintAsClang swift-compatibility-symbols)
23+
24+
swift_install_in_component(
25+
FILES
26+
${symbols_file}
27+
DESTINATION
28+
"share/swift"
29+
COMPONENT
30+
compiler
31+
)

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static void emitObjCConditional(raw_ostream &out,
5353
static void writePrologue(raw_ostream &out, ASTContext &ctx,
5454
StringRef macroGuard) {
5555

56+
// NOTE: If you add macros to this prologue, also add them to the `compatibility_symbols` file!
57+
5658
out << "// Generated by "
5759
<< version::getSwiftFullVersion(ctx.LangOpts.EffectiveLanguageVersion)
5860
<< "\n"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
IBSegueAction
2+
OBJC_DESIGNATED_INITIALIZER
3+
SWIFT_AVAILABILITY
4+
SWIFT_CALL
5+
SWIFT_CLASS
6+
SWIFT_CLASS_EXTRA
7+
SWIFT_CLASS_NAMED
8+
SWIFT_CLASS_PROPERTY
9+
SWIFT_COMPILE_NAME
10+
SWIFT_CXX_INT_DEFINED
11+
SWIFT_DEPRECATED
12+
SWIFT_DEPRECATED_MSG
13+
SWIFT_DEPRECATED_OBJC
14+
SWIFT_ENUM
15+
SWIFT_ENUM_ATTR
16+
SWIFT_ENUM_EXTRA
17+
SWIFT_ENUM_NAMED
18+
SWIFT_EXTENSION
19+
SWIFT_EXTERN
20+
SWIFT_METATYPE
21+
SWIFT_METHOD_FAMILY
22+
SWIFT_NOESCAPE
23+
SWIFT_NOEXCEPT
24+
SWIFT_NORETURN
25+
SWIFT_PASTE
26+
SWIFT_PASTE_HELPER
27+
SWIFT_PROTOCOL
28+
SWIFT_PROTOCOL_EXTRA
29+
SWIFT_PROTOCOL_NAMED
30+
SWIFT_RELEASES_ARGUMENT
31+
SWIFT_RESILIENT_CLASS
32+
SWIFT_RESILIENT_CLASS_NAMED
33+
SWIFT_RUNTIME_NAME
34+
SWIFT_TYPEDEFS
35+
SWIFT_UNAVAILABLE
36+
SWIFT_UNAVAILABLE_MSG
37+
SWIFT_WARN_UNUSED_RESULT
38+
SWIFT_WEAK_IMPORT

0 commit comments

Comments
 (0)