[cfe-commits] r122087 - in /cfe/trunk/lib: Basic/FileManager.cpp Basic/FileSystemStatCache.cpp Checker/HTMLDiagnostics.cpp Driver/Driver.cpp Frontend/CacheTokens.cpp Frontend/InitHeaderSearch.cpp Lex/HeaderSearch.cpp Serialization/ASTReader.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Fri Dec 17 13:22:22 PST 2010
Author: mspencer
Date: Fri Dec 17 15:22:22 2010
New Revision: 122087
URL: http://llvm.org/viewvc/llvm-project?rev=122087&view=rev
Log:
Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.
Modified:
cfe/trunk/lib/Basic/FileManager.cpp
cfe/trunk/lib/Basic/FileSystemStatCache.cpp
cfe/trunk/lib/Checker/HTMLDiagnostics.cpp
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Frontend/CacheTokens.cpp
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
cfe/trunk/lib/Lex/HeaderSearch.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Fri Dec 17 15:22:22 2010
@@ -392,10 +392,11 @@
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;
}
Modified: cfe/trunk/lib/Basic/FileSystemStatCache.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileSystemStatCache.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileSystemStatCache.cpp (original)
+++ cfe/trunk/lib/Basic/FileSystemStatCache.cpp Fri Dec 17 15:22:22 2010
@@ -113,7 +113,7 @@
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;
Modified: cfe/trunk/lib/Checker/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/HTMLDiagnostics.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Checker/HTMLDiagnostics.cpp Fri Dec 17 15:22:22 2010
@@ -199,7 +199,7 @@
std::string DirName = "";
- if (!llvm::sys::Path(Entry->getName()).isAbsolute()) {
+ if (llvm::sys::path::is_relative(Entry->getName())) {
llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
DirName = P.str() + "/";
}
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Dec 17 15:22:22 2010
@@ -30,6 +30,7 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
@@ -757,14 +758,15 @@
// Check that the file exists, if enabled.
if (CheckInputsExist && memcmp(Value, "-", 2) != 0) {
- llvm::sys::Path Path(Value);
+ llvm::SmallString<64> Path(Value);
if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory))
- if (!Path.isAbsolute()) {
+ if (llvm::sys::path::is_absolute(Path.str())) {
Path = WorkDir->getValue(Args);
- Path.appendComponent(Value);
+ llvm::sys::path::append(Path, Value);
}
- if (!Path.exists())
+ bool exists = false;
+ if (/*error_code ec =*/llvm::sys::fs::exists(Value, exists) || !exists)
Diag(clang::diag::err_drv_no_such_file) << Path.str();
else
Inputs.push_back(std::make_pair(Ty, A));
Modified: cfe/trunk/lib/Frontend/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CacheTokens.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CacheTokens.cpp (original)
+++ cfe/trunk/lib/Frontend/CacheTokens.cpp Fri Dec 17 15:22:22 2010
@@ -475,8 +475,7 @@
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 @@
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());
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Fri Dec 17 15:22:22 2010
@@ -106,10 +106,10 @@
// 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 =
Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Fri Dec 17 15:22:22 2010
@@ -211,7 +211,7 @@
const DirectoryLookup *&CurDir,
const FileEntry *CurFileEnt) {
// If 'Filename' is absolute, check to see if it exists and no searching.
- if (llvm::sys::Path::isAbsolute(Filename.begin(), Filename.size())) {
+ if (llvm::sys::path::is_absolute(Filename)) {
CurDir = 0;
// If this was an #include_next "/absolute/file", fail.
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=122087&r1=122086&r2=122087&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Dec 17 15:22:22 2010
@@ -1703,7 +1703,7 @@
if (!RelocatablePCH)
return;
- if (Filename.empty() || llvm::sys::Path(Filename).isAbsolute())
+ if (Filename.empty() || llvm::sys::path::is_absolute(Filename))
return;
if (isysroot == 0) {
More information about the cfe-commits
mailing list