[cfe-commits] r127573 - in /cfe/trunk: include/clang/Basic/FileManager.h lib/Basic/FileManager.cpp lib/Frontend/CompilerInstance.cpp

Anders Carlsson andersca at mac.com
Sun Mar 13 18:13:54 PDT 2011


Author: andersca
Date: Sun Mar 13 20:13:54 2011
New Revision: 127573

URL: http://llvm.org/viewvc/llvm-project?rev=127573&view=rev
Log:
Get rid of the static FileManager::FixupRelativePath.

Modified:
    cfe/trunk/include/clang/Basic/FileManager.h
    cfe/trunk/lib/Basic/FileManager.cpp
    cfe/trunk/lib/Frontend/CompilerInstance.cpp

Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=127573&r1=127572&r2=127573&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Sun Mar 13 20:13:54 2011
@@ -197,9 +197,6 @@
   /// \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

Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=127573&r1=127572&r2=127573&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Sun Mar 13 20:13:54 2011
@@ -450,22 +450,18 @@
   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;

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=127573&r1=127572&r2=127573&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Sun Mar 13 20:13:54 2011
@@ -370,7 +370,7 @@
 
         // 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)





More information about the cfe-commits mailing list