[lld] r210732 - Use error_category from the std namespace.

Rafael Espindola rafael.espindola at gmail.com
Wed Jun 11 18:44:19 PDT 2014


Author: rafael
Date: Wed Jun 11 20:44:19 2014
New Revision: 210732

URL: http://llvm.org/viewvc/llvm-project?rev=210732&view=rev
Log:
Use error_category from the std namespace.

Modified:
    lld/trunk/include/lld/Core/Error.h
    lld/trunk/lib/Core/Error.cpp

Modified: lld/trunk/include/lld/Core/Error.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Error.h?rev=210732&r1=210731&r2=210732&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Error.h (original)
+++ lld/trunk/include/lld/Core/Error.h Wed Jun 11 20:44:19 2014
@@ -19,7 +19,7 @@
 
 namespace lld {
 
-const llvm::error_category &native_reader_category();
+const std::error_category &native_reader_category();
 
 enum class NativeReaderError {
   success = 0,
@@ -34,7 +34,7 @@ inline llvm::error_code make_error_code(
   return llvm::error_code(static_cast<int>(e), native_reader_category());
 }
 
-const llvm::error_category &YamlReaderCategory();
+const std::error_category &YamlReaderCategory();
 
 enum class YamlReaderError {
   success = 0,
@@ -46,7 +46,7 @@ inline llvm::error_code make_error_code(
   return llvm::error_code(static_cast<int>(e), YamlReaderCategory());
 }
 
-const llvm::error_category &LinkerScriptReaderCategory();
+const std::error_category &LinkerScriptReaderCategory();
 
 enum class LinkerScriptReaderError {
   success = 0,
@@ -58,7 +58,7 @@ inline llvm::error_code make_error_code(
 }
 
 /// \brief Errors returned by InputGraph functionality
-const llvm::error_category &InputGraphErrorCategory();
+const std::error_category &InputGraphErrorCategory();
 
 enum class InputGraphError {
   success = 0,
@@ -72,7 +72,7 @@ inline llvm::error_code make_error_code(
 }
 
 /// \brief Errors returned by Reader.
-const llvm::error_category &ReaderErrorCategory();
+const std::error_category &ReaderErrorCategory();
 
 enum class ReaderError {
   success = 0,

Modified: lld/trunk/lib/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Error.cpp?rev=210732&r1=210731&r2=210732&view=diff
==============================================================================
--- lld/trunk/lib/Core/Error.cpp (original)
+++ lld/trunk/lib/Core/Error.cpp Wed Jun 11 20:44:19 2014
@@ -18,7 +18,7 @@
 
 using namespace lld;
 
-class _NativeReaderErrorCategory : public llvm::error_category {
+class _NativeReaderErrorCategory : public std::error_category {
 public:
   const char* name() const LLVM_NOEXCEPT override {
     return "lld.native.reader";
@@ -49,12 +49,12 @@ public:
   }
 };
 
-const llvm::error_category &lld::native_reader_category() {
+const std::error_category &lld::native_reader_category() {
   static _NativeReaderErrorCategory o;
   return o;
 }
 
-class _YamlReaderErrorCategory : public llvm::error_category {
+class _YamlReaderErrorCategory : public std::error_category {
 public:
   const char* name() const LLVM_NOEXCEPT override {
     return "lld.yaml.reader";
@@ -79,12 +79,12 @@ public:
   }
 };
 
-const llvm::error_category &lld::YamlReaderCategory() {
+const std::error_category &lld::YamlReaderCategory() {
   static _YamlReaderErrorCategory o;
   return o;
 }
 
-class _LinkerScriptReaderErrorCategory : public llvm::error_category {
+class _LinkerScriptReaderErrorCategory : public std::error_category {
 public:
   const char *name() const LLVM_NOEXCEPT override {
     return "lld.linker-script.reader";
@@ -110,12 +110,12 @@ public:
   }
 };
 
-const llvm::error_category &lld::LinkerScriptReaderCategory() {
+const std::error_category &lld::LinkerScriptReaderCategory() {
   static _LinkerScriptReaderErrorCategory o;
   return o;
 }
 
-class _InputGraphErrorCategory : public llvm::error_category {
+class _InputGraphErrorCategory : public std::error_category {
 public:
   const char *name() const LLVM_NOEXCEPT override {
     return "lld.inputGraph.parse";
@@ -136,12 +136,12 @@ public:
   }
 };
 
-const llvm::error_category &lld::InputGraphErrorCategory() {
+const std::error_category &lld::InputGraphErrorCategory() {
   static _InputGraphErrorCategory i;
   return i;
 }
 
-class _ReaderErrorCategory : public llvm::error_category {
+class _ReaderErrorCategory : public std::error_category {
 public:
   const char *name() const LLVM_NOEXCEPT override {
     return "lld.inputGraph.parse";
@@ -165,7 +165,7 @@ public:
   }
 };
 
-const llvm::error_category &lld::ReaderErrorCategory() {
+const std::error_category &lld::ReaderErrorCategory() {
   static _ReaderErrorCategory i;
   return i;
 }
@@ -179,7 +179,7 @@ namespace lld {
 /// Temporary class to enable make_dynamic_error_code() until
 /// llvm::ErrorOr<> is updated to work with error encapsulations 
 /// other than error_code.
-class dynamic_error_category : public llvm::error_category {
+class dynamic_error_category : public std::error_category {
 public:
   const char *name() const LLVM_NOEXCEPT override {
     return "lld.dynamic_error";





More information about the llvm-commits mailing list