summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index cf784595c2f1..c754b30d8de4 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -133,7 +133,7 @@ std::error_code FileSystem::makeAbsolute(SmallVectorImpl<char> &Path) const {
if (!WorkingDir)
return WorkingDir.getError();
- llvm::sys::fs::make_absolute(WorkingDir.get(), Path);
+ sys::path::make_absolute(WorkingDir.get(), Path);
return {};
}
@@ -300,7 +300,7 @@ private:
if (!WD || !*WD)
return Path;
Path.toVector(Storage);
- sys::fs::make_absolute(WD->get().Resolved, Storage);
+ sys::path::make_absolute(WD->get().Resolved, Storage);
return Storage;
}
@@ -1908,7 +1908,12 @@ private:
FullPath = FS->getOverlayFileDir();
assert(!FullPath.empty() &&
"External contents prefix directory must exist");
- llvm::sys::path::append(FullPath, Value);
+ SmallString<256> AbsFullPath = Value;
+ if (FS->makeAbsolute(FullPath, AbsFullPath)) {
+ error(N, "failed to make 'external-contents' absolute");
+ return nullptr;
+ }
+ FullPath = AbsFullPath;
} else {
FullPath = Value;
}
@@ -1973,7 +1978,7 @@ private:
EC = FS->makeAbsolute(FullPath, Name);
Name = canonicalize(Name);
} else {
- EC = sys::fs::make_absolute(Name);
+ EC = FS->makeAbsolute(Name);
}
if (EC) {
assert(NameValueNode && "Name presence should be checked earlier");
@@ -2204,7 +2209,7 @@ RedirectingFileSystem::create(std::unique_ptr<MemoryBuffer> Buffer,
// FS->OverlayFileDir => /<absolute_path_to>/dummy.cache/vfs
//
SmallString<256> OverlayAbsDir = sys::path::parent_path(YAMLFilePath);
- std::error_code EC = llvm::sys::fs::make_absolute(OverlayAbsDir);
+ std::error_code EC = FS->makeAbsolute(OverlayAbsDir);
assert(!EC && "Overlay dir final path must be absolute");
(void)EC;
FS->setOverlayFileDir(OverlayAbsDir);