File tree Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ public struct S1 {
2+ public func foo1( ) { }
3+ public func foo2( ) { }
4+ }
Original file line number Diff line number Diff line change 1+ {
2+ "kind" : " Root" ,
3+ "name" : " TopLevel" ,
4+ "printedName" : " TopLevel" ,
5+ "children" : [
6+ {
7+ "kind" : " TypeDecl" ,
8+ "name" : " S1" ,
9+ "printedName" : " S1" ,
10+ "declKind" : " Struct" ,
11+ "usr" : " s:V4cake2S1" ,
12+ "location" : " " ,
13+ "moduleName" : " cake" ,
14+ "children" : [
15+ {
16+ "kind" : " Function" ,
17+ "name" : " foo1" ,
18+ "printedName" : " foo1()" ,
19+ "declKind" : " Func" ,
20+ "usr" : " s:FV4cake2S14foo1FT_T_" ,
21+ "location" : " " ,
22+ "moduleName" : " cake" ,
23+ "children" : [
24+ {
25+ "kind" : " TypeNominal" ,
26+ "name" : " Void" ,
27+ "printedName" : " ()"
28+ }
29+ ]
30+ },
31+ {
32+ "kind" : " Function" ,
33+ "name" : " foo2" ,
34+ "printedName" : " foo2()" ,
35+ "declKind" : " Func" ,
36+ "usr" : " s:FV4cake2S14foo2FT_T_" ,
37+ "location" : " " ,
38+ "moduleName" : " cake" ,
39+ "children" : [
40+ {
41+ "kind" : " TypeNominal" ,
42+ "name" : " Void" ,
43+ "printedName" : " ()"
44+ }
45+ ]
46+ },
47+ {
48+ "kind" : " Constructor" ,
49+ "name" : " init" ,
50+ "printedName" : " init()" ,
51+ "declKind" : " Constructor" ,
52+ "usr" : " s:FV4cake2S1cFT_S0_" ,
53+ "location" : " " ,
54+ "moduleName" : " cake" ,
55+ "children" : [
56+ {
57+ "kind" : " TypeNominal" ,
58+ "name" : " S1" ,
59+ "printedName" : " S1"
60+ }
61+ ]
62+ }
63+ ]
64+ }
65+ ]
66+ }
Original file line number Diff line number Diff line change 1+ // RUN: rm -rf %t.mod && mkdir -p %t.mod
2+ // RUN: rm -rf %t.sdk && mkdir -p %t.sdk
3+ // RUN: rm -rf %t.module-cache && mkdir -p %t.module-cache
4+ // RUN: %swift -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library
5+ // RUN: %api-digester -dump-sdk -module cake -o %t.dump.json -module-cache-path %t.module-cache -sdk %t.sdk -swift-version 3.0 -I %t.mod
6+ // RUN: diff -u %t.dump.json %S/Outputs/cake.json
7+ // RUN: %api-digester -diagnose-sdk --input-paths %t.dump.json -input-paths %S/Outputs/cake.json
Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ ResourceDir("resource-dir",
9898static llvm::cl::list<std::string>
9999FrameworkPaths (" F" , llvm::cl::desc(" add a directory to the framework search path" ));
100100
101+ static llvm::cl::list<std::string>
102+ ModuleInputPaths (" I" , llvm::cl::desc(" add a module for input" ));
103+
101104static llvm::cl::opt<bool >
102105AbortOnModuleLoadFailure (" abort-on-module-fail" ,
103106 llvm::cl::desc (" Abort if a module failed to load" ));
@@ -3303,6 +3306,7 @@ static int prepareForDump(const char *Main,
33033306 InitInvok.setRuntimeResourcePath (options::ResourceDir);
33043307 }
33053308 InitInvok.setFrameworkSearchPaths (options::FrameworkPaths);
3309+ InitInvok.setImportSearchPaths (options::ModuleInputPaths);
33063310
33073311 if (!options::ModuleList.empty ()) {
33083312 if (readFileLineByLine (options::ModuleList, Modules))
You can’t perform that action at this time.
0 commit comments