Don't use PathV1.h in FileUtilities.h.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Jun 2013 20:41:00 +0000 (20:41 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Jun 2013 20:41:00 +0000 (20:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183941 91177308-0d34-0410-b5e6-96231b3b80d8

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

index c6feb9f42689c61a90512f0e8f63deed1c6ee071..79c59e4306c92b422abb1edd82753a53c3762886 100644 (file)
@@ -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);
 
index 4d7b2391f01eb3d42e1aa59b6aadde5ce45f7104..f13c04b961e3e8d14781a29207bf99b0493a1129 100644 (file)
@@ -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 *&F1P, const char *&F2P,
 /// 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;
index da360453ecce66d9cf17c66503f9133a358f54af..fd0cc5988f236690e30ad8a577a770a9bafd4a7a 100644 (file)
@@ -446,8 +446,8 @@ bool BugDriver::diffProgram(const Module *Program,
 
   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';
index 6d96330c9e22d1b9889672237b4cf0405bb8866d..ffa108b522fe659a18d77ee17d25202ffe4e4662 100644 (file)
@@ -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"
index 5f6b5e8d6e59bfea15fc1377424ec759b8dd39a4..bbe7276e13a0d428895e7d381758c864afdc81d6 100644 (file)
@@ -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;