Skip to content

Commit 1d14e5d

Browse files
[wasm] Revert lib/ClangImporter/ClangImporter.cpp changes
1 parent c6a1dbf commit 1d14e5d

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -453,42 +453,6 @@ static inline bool isPCHFilenameExtension(StringRef path) {
453453
.endswith(file_types::getExtension(file_types::TY_PCH));
454454
}
455455

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-
492456
void
493457
importer::getNormalInvocationArguments(
494458
std::vector<std::string> &invocationArgStrs,
@@ -665,13 +629,6 @@ importer::getNormalInvocationArguments(
665629
});
666630
}
667631

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-
675632
if (triple.isOSWindows()) {
676633
switch (triple.getArch()) {
677634
default: llvm_unreachable("unsupported Windows architecture");

0 commit comments

Comments
 (0)