llvm.org GIT mirror llvm / bbf97ea
Don't use PathV1.h in FileUtilities.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183941 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
5 changed file(s) with 13 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1616
1717 #include "llvm/Support/FileSystem.h"
1818 #include "llvm/Support/Path.h"
19 #include "llvm/Support/PathV1.h"
2019
2120 namespace llvm {
2221
2726 /// option, it will set the string to an error message if an error occurs, or
2827 /// if the files are different.
2928 ///
30 int DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
31 const sys::PathWithStatus &FileB,
29 int DiffFilesWithTolerance(StringRef FileA,
30 StringRef FileB,
3231 double AbsTol, double RelTol,
3332 std::string *Error = 0);
3433
1616 #include "llvm/ADT/SmallString.h"
1717 #include "llvm/Support/MemoryBuffer.h"
1818 #include "llvm/Support/Path.h"
19 #include "llvm/Support/PathV1.h"
1920 #include "llvm/Support/raw_ostream.h"
2021 #include "llvm/Support/system_error.h"
2122 #include
170171 /// error occurs, allowing the caller to distinguish between a failed diff and a
171172 /// file system error.
172173 ///
173 int llvm::DiffFilesWithTolerance(const sys::PathWithStatus &FileA,
174 const sys::PathWithStatus &FileB,
174 int llvm::DiffFilesWithTolerance(StringRef NameA,
175 StringRef NameB,
175176 double AbsTol, double RelTol,
176177 std::string *Error) {
178 sys::PathWithStatus FileA(NameA);
179 sys::PathWithStatus FileB(NameB);
180
177181 const sys::FileStatus *FileAStat = FileA.getFileStatus(false, Error);
178182 if (!FileAStat)
179183 return 2;
445445
446446 std::string Error;
447447 bool FilesDifferent = false;
448 if (int Diff = DiffFilesWithTolerance(sys::Path(ReferenceOutputFile),
449 sys::Path(Output.str()),
448 if (int Diff = DiffFilesWithTolerance(ReferenceOutputFile,
449 Output.str(),
450450 AbsTolerance, RelTolerance, &Error)) {
451451 if (Diff == 2) {
452452 errs() << "While diffing output: " << Error << '\n';
2424 #include "llvm/Support/Debug.h"
2525 #include "llvm/Support/FileUtilities.h"
2626 #include "llvm/Support/Path.h"
27 #include "llvm/Support/PathV1.h"
2728 #include "llvm/Support/Program.h"
2829 #include "llvm/Support/SystemUtils.h"
2930 #include "llvm/Support/ToolOutputFile.h"
3232 cl::ParseCommandLineOptions(argc, argv);
3333
3434 std::string ErrorMsg;
35 int DF = DiffFilesWithTolerance(sys::PathWithStatus(File1),
36 sys::PathWithStatus(File2),
37 AbsTolerance, RelTolerance, &ErrorMsg);
35 int DF = DiffFilesWithTolerance(File1, File2, AbsTolerance, RelTolerance,
36 &ErrorMsg);
3837 if (!ErrorMsg.empty())
3938 errs() << argv[0] << ": " << ErrorMsg << "\n";
4039 return DF;