diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-14 01:13:54 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-14 01:13:54 +0000 |
commit | 9ba8fb1e48baba536621d544da1299df83847548 (patch) | |
tree | dc00f76f10b585d1346f0e01068615ab7195ed1f /clang | |
parent | d91d5f162f099eea10054ef3b083a18ca1558e0c (diff) | |
download | bcm5719-llvm-9ba8fb1e48baba536621d544da1299df83847548.tar.gz bcm5719-llvm-9ba8fb1e48baba536621d544da1299df83847548.zip |
Get rid of the static FileManager::FixupRelativePath.
llvm-svn: 127573
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Basic/FileManager.h | 3 | ||||
-rw-r--r-- | clang/lib/Basic/FileManager.cpp | 12 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 2 |
3 files changed, 5 insertions, 12 deletions
diff --git a/clang/include/clang/Basic/FileManager.h b/clang/include/clang/Basic/FileManager.h index d14371d7a8b..57f7d71660d 100644 --- a/clang/include/clang/Basic/FileManager.h +++ b/clang/include/clang/Basic/FileManager.h @@ -197,9 +197,6 @@ public: /// \brief If path is not absolute and FileSystemOptions set the working /// directory, the path is modified to be relative to the given /// working directory. - static void FixupRelativePath(llvm::SmallVectorImpl<char> &path, - const FileSystemOptions &FSOpts); - void FixupRelativePath(llvm::SmallVectorImpl<char> &path) const; /// \brief Produce an array mapping from the unique IDs assigned to each diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index add4ec00b1f..6512d76aae5 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -450,22 +450,18 @@ FileManager::getVirtualFile(llvm::StringRef Filename, off_t Size, return UFE; } -void FileManager::FixupRelativePath(llvm::SmallVectorImpl<char> &path, - const FileSystemOptions &FSOpts) { +void FileManager::FixupRelativePath(llvm::SmallVectorImpl<char> &path) const { llvm::StringRef pathRef(path.data(), path.size()); - if (FSOpts.WorkingDir.empty() || llvm::sys::path::is_absolute(pathRef)) + if (FileSystemOpts.WorkingDir.empty() + || llvm::sys::path::is_absolute(pathRef)) return; - llvm::SmallString<128> NewPath(FSOpts.WorkingDir); + llvm::SmallString<128> NewPath(FileSystemOpts.WorkingDir); llvm::sys::path::append(NewPath, pathRef); path = NewPath; } -void FileManager::FixupRelativePath(llvm::SmallVectorImpl<char> &path) const { - FixupRelativePath(path, FileSystemOpts); -} - llvm::MemoryBuffer *FileManager:: getBufferForFile(const FileEntry *Entry, std::string *ErrorStr) { llvm::OwningPtr<llvm::MemoryBuffer> Result; diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 70d6fef2951..b47da312a19 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -370,7 +370,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) { // If '-working-directory' was passed, the output filename should be // relative to that. - FileManager::FixupRelativePath(NewOutFile, getFileSystemOpts()); + FileMgr->FixupRelativePath(NewOutFile); if (llvm::error_code ec = llvm::sys::fs::rename(it->TempFilename, NewOutFile.str())) { getDiagnostics().Report(diag::err_fe_unable_to_rename_temp) |