]> granicus.if.org Git - clang/commitdiff
Use llvm::sys::Path to check isAbsolute, instead of hard coding. Also, remove random...
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Nov 2009 19:50:41 +0000 (19:50 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Nov 2009 19:50:41 +0000 (19:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89229 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReader.cpp

index ca7aa3260c62f105f926fbc0d8088d1c6d83d5b4..c9679b7d1e7f67e402043b245135deff3e58e919 100644 (file)
@@ -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 <algorithm>
 #include <iterator>
 #include <cstdio>
@@ -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(), '/');