@@ -444,6 +444,8 @@ std::error_code ParseableInterfaceModuleLoader::openModuleFiles(
444
444
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
445
445
llvm::SmallVectorImpl<char > &Scratch) {
446
446
447
+ namespace path = llvm::sys::path;
448
+
447
449
// If running in OnlySerialized mode, ParseableInterfaceModuleLoader
448
450
// should not have been constructed at all.
449
451
assert (LoadMode != ModuleLoadingMode::OnlySerialized);
@@ -454,11 +456,11 @@ std::error_code ParseableInterfaceModuleLoader::openModuleFiles(
454
456
455
457
// First check to see if the .swiftinterface exists at all. Bail if not.
456
458
ModPath = DirName;
457
- llvm::sys:: path::append (ModPath, ModuleFilename);
459
+ path::append (ModPath, ModuleFilename);
458
460
459
461
auto Ext = file_types::getExtension (file_types::TY_SwiftParseableInterfaceFile);
460
462
InPath = ModPath;
461
- llvm::sys:: path::replace_extension (InPath, Ext);
463
+ path::replace_extension (InPath, Ext);
462
464
if (!FS.exists (InPath))
463
465
return std::make_error_code (std::errc::no_such_file_or_directory);
464
466
@@ -477,24 +479,23 @@ std::error_code ParseableInterfaceModuleLoader::openModuleFiles(
477
479
// from the SDK.
478
480
if (!PrebuiltCacheDir.empty ()) {
479
481
StringRef SDKPath = Ctx.SearchPathOpts .SDKPath ;
480
- if (!SDKPath.empty () && hasPrefix (llvm::sys:: path::begin (InPath),
481
- llvm::sys:: path::end (InPath),
482
- llvm::sys:: path::begin (SDKPath),
483
- llvm::sys:: path::end (SDKPath))) {
482
+ if (!SDKPath.empty () && hasPrefix (path::begin (InPath),
483
+ path::end (InPath),
484
+ path::begin (SDKPath),
485
+ path::end (SDKPath))) {
484
486
// Assemble the expected path: $PREBUILT_CACHE/Foo.swiftmodule or
485
487
// $PREBUILT_CACHE/Foo.swiftmodule/arch.swiftmodule. Note that there's no
486
488
// cache key here.
487
489
OutPath = PrebuiltCacheDir;
488
490
489
491
// FIXME: Would it be possible to only have architecture-specific names
490
492
// here? Then we could skip this check.
491
- StringRef InParentDirName =
492
- llvm::sys::path::filename (llvm::sys::path::parent_path (InPath));
493
- if (llvm::sys::path::extension (InParentDirName) == " .swiftmodule" ) {
494
- assert (llvm::sys::path::stem (InParentDirName) == ModuleID.first .str ());
495
- llvm::sys::path::append (OutPath, InParentDirName);
493
+ StringRef InParentDirName = path::filename (path::parent_path (InPath));
494
+ if (path::extension (InParentDirName) == " .swiftmodule" ) {
495
+ assert (path::stem (InParentDirName) == ModuleID.first .str ());
496
+ path::append (OutPath, InParentDirName);
496
497
}
497
- llvm::sys:: path::append (OutPath, ModuleFilename);
498
+ path::append (OutPath, ModuleFilename);
498
499
499
500
if (!swiftModuleIsUpToDate (FS, ModuleID, OutPath, Diags,
500
501
dependencyTracker)) {
@@ -534,9 +535,8 @@ std::error_code ParseableInterfaceModuleLoader::openModuleFiles(
534
535
// original directory. We should probably just not try to match the signature
535
536
// of the overridable entry point.
536
537
auto ErrorCode = SerializedModuleLoaderBase::openModuleFiles (
537
- ModuleID, llvm::sys::path::parent_path (OutPath),
538
- llvm::sys::path::filename (OutPath), ModuleDocFilename, ModuleBuffer,
539
- ModuleDocBuffer, Scratch);
538
+ ModuleID, path::parent_path (OutPath), path::filename (OutPath),
539
+ ModuleDocFilename, ModuleBuffer, ModuleDocBuffer, Scratch);
540
540
LLVM_DEBUG (llvm::dbgs () << " Loaded " << OutPath
541
541
<< " via normal module loader" );
542
542
if (ErrorCode) {
0 commit comments