diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index ca7aa3260c62f105f926fbc0d8088d1c6d83d5b4..c9679b7d1e7f67e402043b245135deff3e58e919 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -34,6 +34,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/System/Path.h" #include #include #include @@ -1086,11 +1087,9 @@ void PCHReader::MaybeAddSystemRootToFilename(std::string &Filename) { if (!RelocatablePCH) return; - if (Filename.empty() || Filename[0] == '/' || Filename[0] == '<') + if (Filename.empty() || llvm::sys::Path(Filename).isAbsolute()) return; - std::string FIXME = Filename; - if (isysroot == 0) { // If no system root was given, default to '/' Filename.insert(Filename.begin(), '/');