diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
commit | 2a826e40fa51fcae4adb564d789cafe95776e0bb (patch) | |
tree | fc0dea973c66e8777a6354c1e01199057d38b023 /llvm/lib/Support/Path.cpp | |
parent | 372bc70c639a45e69a519a2e47f0b9a06e23914a (diff) | |
download | llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.zip llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.gz llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.bz2 |
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.
This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.
llvm-svn: 210920
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 1f843d8..15edf0dd 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Support/Errc.h" #include "llvm/Support/Path.h" #include "llvm/Support/Endian.h" #include "llvm/Support/ErrorHandling.h" @@ -204,7 +205,7 @@ retry_random_path: if (std::error_code EC = sys::fs::openFileForWrite(Twine(ResultPath.begin()), ResultFD, sys::fs::F_RW | sys::fs::F_Excl, Mode)) { - if (EC == std::errc::file_exists) + if (EC == errc::file_exists) goto retry_random_path; return EC; } @@ -225,7 +226,7 @@ retry_random_path: case FS_Dir: { if (std::error_code EC = sys::fs::create_directory(ResultPath.begin(), false)) { - if (EC == std::errc::file_exists) + if (EC == errc::file_exists) goto retry_random_path; return EC; } @@ -830,7 +831,7 @@ std::error_code create_directories(const Twine &Path, bool IgnoreExisting) { std::error_code EC = create_directory(P, IgnoreExisting); // If we succeeded, or had any error other than the parent not existing, just // return it. - if (EC != std::errc::no_such_file_or_directory) + if (EC != errc::no_such_file_or_directory) return EC; // We failed because of a no_such_file_or_directory, try to create the |