diff options
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/FileManager.cpp | 9 | ||||
-rw-r--r-- | lib/Basic/FileSystemStatCache.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 488d4c3b8d..921778d7d1 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -392,10 +392,11 @@ FileManager::getVirtualFile(llvm::StringRef Filename, off_t Size, void FileManager::FixupRelativePath(llvm::sys::Path &path, const FileSystemOptions &FSOpts) { - if (FSOpts.WorkingDir.empty() || path.isAbsolute()) return; - - llvm::sys::Path NewPath(FSOpts.WorkingDir); - NewPath.appendComponent(path.str()); + if (FSOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(path.str())) + return; + + llvm::SmallString<128> NewPath(FSOpts.WorkingDir); + llvm::sys::path::append(NewPath, path.str()); path = NewPath; } diff --git a/lib/Basic/FileSystemStatCache.cpp b/lib/Basic/FileSystemStatCache.cpp index d9e89cd8df..c8b07af295 100644 --- a/lib/Basic/FileSystemStatCache.cpp +++ b/lib/Basic/FileSystemStatCache.cpp @@ -113,7 +113,7 @@ MemorizeStatCalls::getStat(const char *Path, struct stat &StatBuf, return Result; // Cache file 'stat' results and directories with absolutely paths. - if (!S_ISDIR(StatBuf.st_mode) || llvm::sys::Path(Path).isAbsolute()) + if (!S_ISDIR(StatBuf.st_mode) || llvm::sys::path::is_absolute(Path)) StatCalls[Path] = StatBuf; return Result; |