Skip to content

Commit 6ae383d

Browse files
committed
---
yaml --- r: 445643 b: refs/heads/master-rebranch c: 1cb4eda h: refs/heads/master i: 445641: 109adfa 445639: 1d0e0d2
1 parent 0a3fb6c commit 6ae383d

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-19-a: 550bd4128211e1135c31ab186d2a9
17011701
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a: f3e865a19683d7e9664718c41e4e956686efb1b3
17021702
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-21-a: 0852188b163c7ebd7054379e729cedc41c361f95
17031703
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-22-a: 4832e0c5e8723b7b4a2c626ac6a8a523576f1317
1704-
refs/heads/master-rebranch: ec9cd91c1b11884f68d640da025a0625fa49878a
1704+
refs/heads/master-rebranch: 1cb4eda4b6f3623c30032b5cc03209a73e53f213
17051705
refs/heads/revert-29064-handle-csdiag-coerce-diagnostics: 69656f1629e2cde21bb7f44179c535c1f3ad5dfd
17061706
refs/heads/swift-5.1-DEVELOPMENT-SNAPSHOT-2018-11-16-a: 51fe19105062bb86b997c7698bb3f83ffc536d2c
17071707
refs/heads/tgmath-derivatives-wip: 00adac82d118281f701c26fe8702ecb4bbe33e82
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

branches/master-rebranch/tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,10 @@ EnableSwiftSourceInfo("enable-swiftsourceinfo",
723723
llvm::cl::cat(Category),
724724
llvm::cl::init(false));
725725

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));
726730
} // namespace options
727731

728732
static std::unique_ptr<llvm::MemoryBuffer>
@@ -3462,6 +3466,11 @@ int main(int argc, char *argv[]) {
34623466
for (auto ConfigName : options::BuildConfigs)
34633467
InitInvok.getLangOptions().addCustomConditionalCompilationFlag(ConfigName);
34643468

3469+
if (!options::ExplicitSwiftModuleMap.empty()) {
3470+
InitInvok.getSearchPathOptions().ExplicitSwiftModuleMap =
3471+
options::ExplicitSwiftModuleMap;
3472+
InitInvok.getFrontendOptions().DisableImplicitModules = true;
3473+
}
34653474
// Process the clang arguments last and allow them to override previously
34663475
// set options.
34673476
if (!CCArgs.empty()) {

0 commit comments

Comments
 (0)