[llvm] r183941 - Don't use PathV1.h in FileUtilities.h.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 13 13:41:00 PDT 2013


Author: rafael
Date: Thu Jun 13 15:41:00 2013
New Revision: 183941

URL: http://llvm.org/viewvc/llvm-project?rev=183941&view=rev
Log:
Don't use PathV1.h in FileUtilities.h.

Modified:
    llvm/trunk/include/llvm/Support/FileUtilities.h
    llvm/trunk/lib/Support/FileUtilities.cpp
    llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
    llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
    llvm/trunk/utils/fpcmp/fpcmp.cpp

Modified: llvm/trunk/include/llvm/Support/FileUtilities.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileUtilities.h?rev=183941&r1=183940&r2=183941&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileUtilities.h (original)
+++ llvm/trunk/include/llvm/Support/FileUtilities.h Thu Jun 13 15:41:00 2013
@@ -17,7 +17,6 @@
 
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
-#include "llvm/Support/PathV1.h"
 
 namespace llvm {
 
@@ -28,8 +27,8 @@ namespace llvm {
   /// option, it will set the string to an error message if an error occurs, or
   /// if the files are different.
   ///
-  int DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
-                             const sys::PathWithStatus &FileB,
+  int DiffFilesWithTolerance(StringRef FileA,
+                             StringRef FileB,
                              double AbsTol, double RelTol,
                              std::string *Error = 0);
 

Modified: llvm/trunk/lib/Support/FileUtilities.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=183941&r1=183940&r2=183941&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FileUtilities.cpp (original)
+++ llvm/trunk/lib/Support/FileUtilities.cpp Thu Jun 13 15:41:00 2013
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/PathV1.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/system_error.h"
 #include <cctype>
@@ -171,10 +172,13 @@ static bool CompareNumbers(const char *&
 /// error occurs, allowing the caller to distinguish between a failed diff and a
 /// file system error.
 ///
-int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
-                                 const sys::PathWithStatus &FileB,
+int llvm::DiffFilesWithTolerance(StringRef NameA,
+                                 StringRef NameB,
                                  double AbsTol, double RelTol,
                                  std::string *Error) {
+  sys::PathWithStatus FileA(NameA);
+  sys::PathWithStatus FileB(NameB);
+
   const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
   if (!FileAStat)
     return 2;

Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=183941&r1=183940&r2=183941&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Thu Jun 13 15:41:00 2013
@@ -446,8 +446,8 @@ bool BugDriver::diffProgram(const Module
 
   std::string Error;
   bool FilesDifferent = false;
-  if (int Diff = DiffFilesWithTolerance(sys::Path(ReferenceOutputFile),
-                                        sys::Path(Output.str()),
+  if (int Diff = DiffFilesWithTolerance(ReferenceOutputFile,
+                                        Output.str(),
                                         AbsTolerance, RelTolerance, &Error)) {
     if (Diff == 2) {
       errs() << "While diffing output: " << Error << '\n';

Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=183941&r1=183940&r2=183941&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Thu Jun 13 15:41:00 2013
@@ -25,6 +25,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/PathV1.h"
 #include "llvm/Support/Program.h"
 #include "llvm/Support/SystemUtils.h"
 #include "llvm/Support/ToolOutputFile.h"

Modified: llvm/trunk/utils/fpcmp/fpcmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/fpcmp/fpcmp.cpp?rev=183941&r1=183940&r2=183941&view=diff
==============================================================================
--- llvm/trunk/utils/fpcmp/fpcmp.cpp (original)
+++ llvm/trunk/utils/fpcmp/fpcmp.cpp Thu Jun 13 15:41:00 2013
@@ -33,9 +33,8 @@ int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv);
 
   std::string ErrorMsg;
-  int DF = DiffFilesWithTolerance(sys::PathWithStatus(File1), 
-                                  sys::PathWithStatus(File2),
-                                  AbsTolerance, RelTolerance, &ErrorMsg);
+  int DF = DiffFilesWithTolerance(File1, File2, AbsTolerance, RelTolerance,
+                                  &ErrorMsg);
   if (!ErrorMsg.empty())
     errs() << argv[0] << ": " << ErrorMsg << "\n";
   return DF;





More information about the llvm-commits mailing list