From 2a826e40fa51fcae4adb564d789cafe95776e0bb Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 13 Jun 2014 17:20:48 +0000 Subject: 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 --- llvm/lib/Support/Path.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Support/Path.cpp') diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 1f843d8f2ae..15edf0ddbbd 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 -- cgit v1.2.3