From 15aa07b2e8e1c5f2a3fc0a8f5f738b4e80b8df35 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 12 Jun 2014 14:11:22 +0000 Subject: [PATCH] Replace llvm::error_code with std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210783 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/ErrorOr.h | 2 +- include/llvm/Support/YAMLTraits.h | 4 ++-- lib/Support/Windows/Path.inc | 8 ++++---- tools/obj2yaml/obj2yaml.h | 8 ++++---- unittests/Transforms/DebugIR/DebugIR.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index d2a316fbf40..c59f86f1b90 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -103,7 +103,7 @@ public: new (getErrorStorage()) error_code(make_error_code(ErrorCode)); } - ErrorOr(llvm::error_code EC) : HasError(true) { + ErrorOr(std::error_code EC) : HasError(true) { new (getErrorStorage()) error_code(EC); } diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h index 50da7693424..b69169bc79f 100644 --- a/include/llvm/Support/YAMLTraits.h +++ b/include/llvm/Support/YAMLTraits.h @@ -880,7 +880,7 @@ public: ~Input(); // Check if there was an syntax or semantic error during parsing. - llvm::error_code error(); + std::error_code error(); private: bool outputting() override; @@ -988,7 +988,7 @@ private: llvm::SourceMgr SrcMgr; // must be before Strm std::unique_ptr Strm; std::unique_ptr TopNode; - llvm::error_code EC; + std::error_code EC; llvm::BumpPtrAllocator StringAllocator; llvm::yaml::document_iterator DocIterator; std::vector BitValuesUsed; diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index a26d9e89e6c..0e695c2e720 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -865,7 +865,7 @@ bool home_directory(SmallVectorImpl &result) { } // end namespace path namespace windows { -llvm::error_code UTF8ToUTF16(llvm::StringRef utf8, +std::error_code UTF8ToUTF16(llvm::StringRef utf8, llvm::SmallVectorImpl &utf16) { if (!utf8.empty()) { int len = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8.begin(), @@ -888,10 +888,10 @@ llvm::error_code UTF8ToUTF16(llvm::StringRef utf8, utf16.push_back(0); utf16.pop_back(); - return llvm::error_code(); + return std::error_code(); } -llvm::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, +std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, llvm::SmallVectorImpl &utf8) { if (utf16_len) { // Get length. @@ -916,7 +916,7 @@ llvm::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, utf8.push_back(0); utf8.pop_back(); - return llvm::error_code(); + return std::error_code(); } } // end namespace windows } // end namespace sys diff --git a/tools/obj2yaml/obj2yaml.h b/tools/obj2yaml/obj2yaml.h index 73c58fa958e..19476f78f42 100644 --- a/tools/obj2yaml/obj2yaml.h +++ b/tools/obj2yaml/obj2yaml.h @@ -17,9 +17,9 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" -llvm::error_code coff2yaml(llvm::raw_ostream &Out, - const llvm::object::COFFObjectFile &Obj); -llvm::error_code elf2yaml(llvm::raw_ostream &Out, - const llvm::object::ObjectFile &Obj); +std::error_code coff2yaml(llvm::raw_ostream &Out, + const llvm::object::COFFObjectFile &Obj); +std::error_code elf2yaml(llvm::raw_ostream &Out, + const llvm::object::ObjectFile &Obj); #endif diff --git a/unittests/Transforms/DebugIR/DebugIR.cpp b/unittests/Transforms/DebugIR/DebugIR.cpp index 5860e31b9d7..c4ebc5cfa4a 100644 --- a/unittests/Transforms/DebugIR/DebugIR.cpp +++ b/unittests/Transforms/DebugIR/DebugIR.cpp @@ -57,7 +57,7 @@ void insertCUDescriptor(Module *M, StringRef File, StringRef Dir, bool removeIfExists(StringRef Path) { // This is an approximation, on error we don't know in general if the file // existed or not. - llvm::error_code EC = sys::fs::remove(Path, false); + std::error_code EC = sys::fs::remove(Path, false); return EC != std::errc::no_such_file_or_directory; }