Skip to content

Commit d27df11

Browse files
committed
link SwiftCompilerSources modules to lldb-moduleimport-test and swift-remoteast-test
This is needed once we implement mandatory passes in Swift, because those testing tools might parse swift interface files from the SDK.
1 parent 9974c33 commit d27df11

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
add_swift_host_tool(lldb-moduleimport-test
22
lldb-moduleimport-test.cpp
33
SWIFT_COMPONENT testsuite-tools
4+
HAS_SWIFT_MODULES
45
)
56
target_link_libraries(lldb-moduleimport-test
67
PRIVATE
78
swiftAST
89
swiftASTSectionImporter
910
swiftClangImporter
10-
swiftFrontend)
11+
swiftFrontend
12+
swiftCompilerModules)
1113

tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/AST/PrintOptions.h"
2222
#include "swift/ASTSectionImporter/ASTSectionImporter.h"
2323
#include "swift/Basic/LLVMInitialize.h"
24+
#include "swift/Basic/InitializeSwiftModules.h"
2425
#include "swift/Frontend/Frontend.h"
2526
#include "swift/Serialization/SerializedModuleLoader.h"
2627
#include "swift/Serialization/Validation.h"
@@ -239,6 +240,7 @@ collectASTModules(llvm::cl::list<std::string> &InputNames,
239240
int main(int argc, char **argv) {
240241
PROGRAM_START(argc, argv);
241242
INITIALIZE_LLVM();
243+
initializeSwiftModules();
242244

243245
// Command line handling.
244246
using namespace llvm::cl;

tools/swift-remoteast-test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
add_swift_host_tool(swift-remoteast-test
22
swift-remoteast-test.cpp
33
SWIFT_COMPONENT testsuite-tools
4+
HAS_SWIFT_MODULES
45
THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY
56
)
67
target_link_libraries(swift-remoteast-test
78
PRIVATE
89
swiftFrontendTool
9-
swiftRemoteAST)
10+
swiftRemoteAST
11+
swiftCompilerModules)
1012
set_target_properties(swift-remoteast-test PROPERTIES ENABLE_EXPORTS 1)
1113

1214
# If building as part of clang, make sure the headers are installed.

tools/swift-remoteast-test/swift-remoteast-test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/FrontendTool/FrontendTool.h"
2222
#include "swift/Basic/LLVM.h"
2323
#include "swift/Basic/LLVMInitialize.h"
24+
#include "swift/Basic/InitializeSwiftModules.h"
2425
#include "llvm/ADT/SmallVector.h"
2526
#include "llvm/Support/Format.h"
2627
#include "llvm/Support/raw_ostream.h"
@@ -221,6 +222,8 @@ int main(int argc, const char *argv[]) {
221222
forwardedArgs.push_back("-interpret");
222223
assert(forwardedArgs.size() == numForwardedArgs);
223224

225+
initializeSwiftModules();
226+
224227
Observer observer;
225228
return performFrontend(forwardedArgs, argv[0], (void*) &printMetadataType,
226229
&observer);

0 commit comments

Comments
 (0)