Skip to content

Commit 58d82f0

Browse files
committed
IDE: Break CMake cycle involving IDE, FrontendTool, Frontend, and Migrator.
These libraries formed a strongly connected component in the CMake build graph. The weakest link I could find was from IDE to FrontendTool and Frontend, which was necessitated by the `CompileInstance` class (#40645). I moved a few files out of IDE into a new IDETools library to break the cycle.
1 parent b0de482 commit 58d82f0

19 files changed

+28
-16
lines changed

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ add_subdirectory(Frontend)
3232
add_subdirectory(FrontendTool)
3333
add_subdirectory(Index)
3434
add_subdirectory(IDE)
35+
add_subdirectory(IDETool)
3536
add_subdirectory(Immediate)
3637
add_subdirectory(IRGen)
3738
add_subdirectory(LLVMPasses)

lib/Frontend/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_dependencies(swiftFrontend
1818
SwiftOptions)
1919
target_link_libraries(swiftFrontend PRIVATE
2020
swiftAST
21+
swiftConstExtract
2122
swiftSIL
2223
swiftMigrator
2324
swiftOption

lib/IDE/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ add_swift_host_library(swiftIDE STATIC
1515
CodeCompletionString.cpp
1616
CodeCompletionStringPrinter.cpp
1717
CommentConversion.cpp
18-
CompileInstance.cpp
19-
CompletionInstance.cpp
2018
CompletionLookup.cpp
2119
CompletionOverrideLookup.cpp
2220
ConformingMethodList.cpp
23-
DependencyChecking.cpp
2421
ExprCompletion.cpp
2522
ExprContextAnalysis.cpp
2623
Formatting.cpp
@@ -45,8 +42,6 @@ target_link_libraries(swiftIDE PRIVATE
4542
swiftAST
4643
swiftClangImporter
4744
swiftDriver
48-
swiftFrontend
49-
swiftFrontendTool
5045
swiftIndex
5146
swiftParse
5247
swiftSema)

lib/IDETool/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
add_swift_host_library(swiftIDETool STATIC
3+
CompileInstance.cpp
4+
CompletionInstance.cpp
5+
DependencyChecking.cpp
6+
)
7+
8+
target_link_libraries(swiftIDETool PRIVATE
9+
swiftAST
10+
swiftDriver
11+
swiftFrontend
12+
swiftFrontendTool)
13+
14+
set_swift_llvm_is_available(swiftIDETool)

lib/IDE/CompileInstance.cpp renamed to lib/IDETool/CompileInstance.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "swift/IDE/CompileInstance.h"
13+
#include "swift/IDETool/CompileInstance.h"
1414

1515
#include "DependencyChecking.h"
1616
#include "swift/AST/ASTContext.h"
@@ -25,7 +25,6 @@
2525
#include "swift/Driver/FrontendUtil.h"
2626
#include "swift/Frontend/Frontend.h"
2727
#include "swift/FrontendTool/FrontendTool.h"
28-
#include "swift/IDE/Utils.h"
2928
#include "swift/Parse/Lexer.h"
3029
#include "swift/Parse/PersistentParserState.h"
3130
#include "swift/Subsystems.h"

lib/IDE/CompletionInstance.cpp renamed to lib/IDETool/CompletionInstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "swift/IDE/CompletionInstance.h"
13+
#include "swift/IDETool/CompletionInstance.h"
1414

1515
#include "DependencyChecking.h"
1616
#include "swift/AST/ASTContext.h"
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)