@@ -453,42 +453,6 @@ static inline bool isPCHFilenameExtension(StringRef path) {
453
453
.endswith (file_types::getExtension (file_types::TY_PCH));
454
454
}
455
455
456
- static Optional<StringRef>
457
- getWasiLibcModuleMapPath (SearchPathOptions& Opts, llvm::Triple triple,
458
- SmallVectorImpl<char > &buffer) {
459
- StringRef platform = swift::getPlatformNameForTriple (triple);
460
- StringRef arch = swift::getMajorArchitectureName (triple);
461
- StringRef SDKPath = Opts.getSDKPath ();
462
-
463
- if (!SDKPath.empty ()) {
464
- buffer.clear ();
465
- buffer.append (SDKPath.begin (), SDKPath.end ());
466
- llvm::sys::path::append (buffer, " usr" , " lib" , " swift" );
467
- llvm::sys::path::append (buffer, platform, arch, " wasi.modulemap" );
468
-
469
- // Only specify the module map if that file actually exists. It may not;
470
- // for example in the case that `swiftc -target x86_64-unknown-linux-gnu
471
- // -emit-ir` is invoked using a Swift compiler not built for Linux targets.
472
- if (llvm::sys::fs::exists (buffer))
473
- return StringRef (buffer.data (), buffer.size ());
474
- }
475
-
476
- if (!Opts.RuntimeResourcePath .empty ()) {
477
- buffer.clear ();
478
- buffer.append (Opts.RuntimeResourcePath .begin (),
479
- Opts.RuntimeResourcePath .end ());
480
- llvm::sys::path::append (buffer, platform, arch, " wasi.modulemap" );
481
-
482
- // Only specify the module map if that file actually exists. It may not;
483
- // for example in the case that `swiftc -target x86_64-unknown-linux-gnu
484
- // -emit-ir` is invoked using a Swift compiler not built for Linux targets.
485
- if (llvm::sys::fs::exists (buffer))
486
- return StringRef (buffer.data (), buffer.size ());
487
- }
488
-
489
- return None;
490
- }
491
-
492
456
void
493
457
importer::getNormalInvocationArguments (
494
458
std::vector<std::string> &invocationArgStrs,
@@ -665,13 +629,6 @@ importer::getNormalInvocationArguments(
665
629
});
666
630
}
667
631
668
- if (triple.isOSWASI ()) {
669
- SmallString<128 > buffer;
670
- if (auto path = getWasiLibcModuleMapPath (searchPathOpts, triple, buffer)) {
671
- invocationArgStrs.push_back ((Twine (" -fmodule-map-file=" ) + *path).str ());
672
- }
673
- }
674
-
675
632
if (triple.isOSWindows ()) {
676
633
switch (triple.getArch ()) {
677
634
default : llvm_unreachable (" unsupported Windows architecture" );
0 commit comments