diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/CacheTokens.cpp | 5 | ||||
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index ee8c8aaa2c..cd5723aa82 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/lib/Frontend/CacheTokens.cpp @@ -475,8 +475,7 @@ void PTHWriter::GeneratePTH(const std::string &MainFile) { const FileEntry *FE = C.Entry; // FIXME: Handle files with non-absolute paths. - llvm::sys::Path P(FE->getName()); - if (!P.isAbsolute()) + if (llvm::sys::path::is_relative(FE->getName())) continue; const llvm::MemoryBuffer *B = C.getBuffer(PP.getDiagnostics(), SM); @@ -525,7 +524,7 @@ public: PM.insert(PTHEntryKeyVariant(Path), PTHEntry()); else if (S_ISDIR(StatBuf.st_mode)) { // Only cache directories with absolute paths. - if (!llvm::sys::Path(Path).isAbsolute()) + if (llvm::sys::path::is_relative(Path)) return Result; PM.insert(PTHEntryKeyVariant(&StatBuf, Path), PTHEntry()); diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index 438556e8da..5bae3ea396 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -106,10 +106,10 @@ void InitHeaderSearch::AddPath(const llvm::Twine &Path, // Compute the actual path, taking into consideration -isysroot. llvm::SmallString<256> MappedPathStorage; llvm::StringRef MappedPathStr = Path.toStringRef(MappedPathStorage); - llvm::sys::Path MappedPath(MappedPathStr); // Handle isysroot. - if (Group == System && !IgnoreSysRoot && MappedPath.isAbsolute() && + if (Group == System && !IgnoreSysRoot && + llvm::sys::path::is_absolute(MappedPathStr) && IncludeSysroot != llvm::sys::Path::GetRootDirectory()) { MappedPathStorage.clear(); MappedPathStr = |