File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1701,7 +1701,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-19-a: 550bd4128211e1135c31ab186d2a9
1701
1701
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a: f3e865a19683d7e9664718c41e4e956686efb1b3
1702
1702
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-21-a: 0852188b163c7ebd7054379e729cedc41c361f95
1703
1703
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-22-a: 4832e0c5e8723b7b4a2c626ac6a8a523576f1317
1704
- refs/heads/master-rebranch: ec9cd91c1b11884f68d640da025a0625fa49878a
1704
+ refs/heads/master-rebranch: 1cb4eda4b6f3623c30032b5cc03209a73e53f213
1705
1705
refs/heads/revert-29064-handle-csdiag-coerce-diagnostics: 69656f1629e2cde21bb7f44179c535c1f3ad5dfd
1706
1706
refs/heads/swift-5.1-DEVELOPMENT-SNAPSHOT-2018-11-16-a: 51fe19105062bb86b997c7698bb3f83ffc536d2c
1707
1707
refs/heads/tgmath-derivatives-wip: 00adac82d118281f701c26fe8702ecb4bbe33e82
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: mkdir -p %t/clang-module-cache
3
+ // RUN: mkdir -p %t/inputs
4
+ // RUN: echo "/// Some cool comments" > %t/foo.swift
5
+ // RUN: echo "public func foo() {}" >> %t/foo.swift
6
+ // RUN: %target-swift-frontend -emit-module -emit-module-path %t/inputs/Foo.swiftmodule -emit-module-doc-path %t/inputs/Foo.swiftdoc -emit-module-source-info -emit-module-source-info-path %t/inputs/Foo.swiftsourceinfo -module-cache-path %t.module-cache %t/foo.swift -module-name Foo
7
+
8
+ // RUN: echo "{" > %t/inputs/map.json
9
+ // RUN: echo "\"Foo\": {" >> %t/inputs/map.json
10
+ // RUN: echo "\"SwiftModulePath\": \"%t/inputs/Foo.swiftmodule\"," >> %t/inputs/map.json
11
+ // RUN: echo "\"SwiftDocPath\": \"%t/inputs/Foo.swiftdoc\"," >> %t/inputs/map.json
12
+ // RUN: echo "\"SwiftSourceInfoPath\": \"%t/inputs/Foo.swiftsourceinfo\"" >> %t/inputs/map.json
13
+ // RUN: echo "}" >> %t/inputs/map.json
14
+ // RUN: echo "}" >> %t/inputs/map.json
15
+
16
+ // RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s
17
+
18
+ // CHECK: foo.swift:2:13: Func/foo RawComment=[/// Some cool comments
Original file line number Diff line number Diff line change @@ -723,6 +723,10 @@ EnableSwiftSourceInfo("enable-swiftsourceinfo",
723
723
llvm::cl::cat(Category),
724
724
llvm::cl::init(false ));
725
725
726
+ static llvm::cl::opt<std::string>
727
+ ExplicitSwiftModuleMap (" explicit-swift-module-map-file" ,
728
+ llvm::cl::desc (" JSON file to include explicit Swift modules" ),
729
+ llvm::cl::cat(Category));
726
730
} // namespace options
727
731
728
732
static std::unique_ptr<llvm::MemoryBuffer>
@@ -3462,6 +3466,11 @@ int main(int argc, char *argv[]) {
3462
3466
for (auto ConfigName : options::BuildConfigs)
3463
3467
InitInvok.getLangOptions ().addCustomConditionalCompilationFlag (ConfigName);
3464
3468
3469
+ if (!options::ExplicitSwiftModuleMap.empty ()) {
3470
+ InitInvok.getSearchPathOptions ().ExplicitSwiftModuleMap =
3471
+ options::ExplicitSwiftModuleMap;
3472
+ InitInvok.getFrontendOptions ().DisableImplicitModules = true ;
3473
+ }
3465
3474
// Process the clang arguments last and allow them to override previously
3466
3475
// set options.
3467
3476
if (!CCArgs.empty ()) {
You can’t perform that action at this time.
0 commit comments