File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 22
22
#include " swift/Basic/Platform.h"
23
23
#include " swift/Basic/StringExtras.h"
24
24
#include " swift/Frontend/CachingUtils.h"
25
+ #include " swift/Frontend/CompileJobCacheResult.h"
25
26
#include " swift/Frontend/Frontend.h"
26
27
#include " swift/Frontend/ModuleInterfaceSupport.h"
27
28
#include " swift/Parse/ParseVersion.h"
@@ -2446,12 +2447,19 @@ struct ExplicitCASModuleLoader::Implementation {
2446
2447
if (!moduleRef)
2447
2448
return nullptr ;
2448
2449
2449
- clang::cas::CompileJobResultSchema schema (CAS);
2450
+ auto proxy = CAS.getProxy (*moduleRef);
2451
+ if (!proxy)
2452
+ return proxy.takeError ();
2453
+
2454
+ swift::cas::CompileJobResultSchema schema (CAS);
2455
+ if (!schema.isRootNode (*proxy))
2456
+ return nullptr ;
2457
+
2450
2458
auto result = schema.load (*moduleRef);
2451
2459
if (!result)
2452
2460
return result.takeError ();
2453
- auto output = result-> getOutput (
2454
- clang::cas::CompileJobCacheResult::OutputKind::MainOutput );
2461
+
2462
+ auto output = result-> getOutput (file_types::ID::TY_SwiftModuleFile );
2455
2463
if (!output)
2456
2464
return nullptr ;
2457
2465
Original file line number Diff line number Diff line change 14
14
// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:B > %t/B.cmd
15
15
// RUN: %swift_frontend_plain @%t/B.cmd
16
16
17
+ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json C > %t/C.cmd
18
+ // RUN: %swift_frontend_plain @%t/C.cmd
19
+
17
20
// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json
18
21
// RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid
19
22
@@ -38,9 +41,18 @@ import A.Missing
38
41
func b( ) { }
39
42
#endif
40
43
44
+ #if canImport(C, _version: 1.0)
45
+ import C
46
+ #endif
47
+
48
+ #if canImport(C, _version: 2.0)
49
+ import Missing
50
+ #endif
51
+
41
52
func useA( ) {
42
53
a ( )
43
54
b ( )
55
+ c ( )
44
56
}
45
57
46
58
//--- include/module.modulemap
@@ -61,3 +73,8 @@ void notused(void);
61
73
62
74
//--- include/B.h
63
75
void notused2 ( void) ;
76
+
77
+ //--- include/C.swiftinterface
78
+ // swift-interface-format-version: 1.0
79
+ // swift-module-flags: -module-name C -O -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib -user-module-version 1.0
80
+ public func c( ) { }
You can’t perform that action at this time.
0 commit comments