]> granicus.if.org Git - clang/commitdiff
Get rid of the static FileManager::FixupRelativePath.
authorAnders Carlsson <andersca@mac.com>
Mon, 14 Mar 2011 01:13:54 +0000 (01:13 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 14 Mar 2011 01:13:54 +0000 (01:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127573 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/FileManager.h
lib/Basic/FileManager.cpp
lib/Frontend/CompilerInstance.cpp

index d14371d7a8bff614de1bbbf8cec22934326dd719..57f7d71660d062a4564e9c51b3c5a5b8f2df0726 100644 (file)
@@ -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
index add4ec00b1fa56b91ebdca8625fddae399a0542c..6512d76aae53303defe8aec8763816f0ce0237b6 100644 (file)
@@ -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;
index 70d6fef2951c2ae9ca89f001d2b77e64775d9b59..b47da312a19cd6e80db6c55f74599f6a7f865244 100644 (file)
@@ -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)