mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Separate swift-syntax libs for the compiler and for the library plugins.
Compiler communicates with library plugins using serialized messages
just like executable plugins.
* `lib/swift/host/compiler/lib_Compiler*.dylib`(`lib/CompilerSwiftSyntax`):
swift-syntax libraries for compiler. Library evolution is disabled.
* Compiler (`ASTGen` and `swiftIDEUtilsBridging`) only depends on
`lib/swift/host/compiler` libraries.
* `SwiftInProcPluginServer`: In-process plugin server shared library.
This has one `swift_inproc_plugins_handle_message` entry point that
receives a message and return the response.
* In the compiler
* Add `-in-process-plugin-server-path` front-end option, which specifies
the `SwiftInProcPluginServer` shared library path.
* Remove `LoadedLibraryPlugin`, because all library plugins are managed
by `SwiftInProcPluginServer`
* Introduce abstract `CompilerPlugin` class that has 2 subclasses:
* `LoadedExecutablePlugin` existing class that represents an
executable plugin
* `InProcessPlugins` wraps `dlopen`ed `SwiftInProcPluginServer`
* Unified the code path in `TypeCheckMacros.cpp` and `ASTGen`, the
difference between executable plugins and library plugins are now
abstracted by `CompilerPlugin`
53 lines
1.1 KiB
CMake
53 lines
1.1 KiB
CMake
|
|
|
|
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
|
|
else()
|
|
set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'")
|
|
endif()
|
|
|
|
add_swift_host_library(swiftParse STATIC
|
|
Confusables.cpp
|
|
Lexer.cpp
|
|
ParseBridging.cpp
|
|
ParseDecl.cpp
|
|
ParseExpr.cpp
|
|
ParseGeneric.cpp
|
|
ParseIfConfig.cpp
|
|
ParsePattern.cpp
|
|
Parser.cpp
|
|
ParseRegex.cpp
|
|
ParseRequests.cpp
|
|
ParseStmt.cpp
|
|
ParseType.cpp
|
|
ParseVersion.cpp
|
|
PersistentParserState.cpp)
|
|
target_link_libraries(swiftParse PRIVATE
|
|
swiftAST
|
|
)
|
|
|
|
if (SWIFT_BUILD_SWIFT_SYNTAX)
|
|
target_link_libraries(swiftParse
|
|
PRIVATE
|
|
swiftASTGen
|
|
)
|
|
|
|
add_dependencies(swiftParse
|
|
swiftASTGen
|
|
)
|
|
endif()
|
|
|
|
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
|
|
target_compile_definitions(swiftParse
|
|
PRIVATE
|
|
SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
|
|
)
|
|
endif()
|
|
|
|
if(SWIFT_COMPILER_VERSION)
|
|
set_property(SOURCE ParseVersion.cpp APPEND_STRING PROPERTY COMPILE_FLAGS
|
|
" -DSWIFT_COMPILER_VERSION=\"\\\"${SWIFT_COMPILER_VERSION}\\\"\"")
|
|
endif()
|
|
|
|
set_swift_llvm_is_available(swiftParse)
|