From c0a42c263e1cf8f3d3cd69afec9c4264d23c616c Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Sat, 15 Mar 2014 04:05:59 +0000 Subject: [PATCH] Support: Make error_category's constructor public Since our error_category is based on the std one, we should have the same visibility for the constructor. This also allows us to avoid using the _do_message implementation detail in our own categories. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203998 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/system_error.h | 2 +- lib/Bitcode/Reader/BitcodeReader.cpp | 2 +- lib/Object/Error.cpp | 8 ++++---- tools/llvm-readobj/Error.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h index 046132f8598..4ca4b069748 100644 --- a/include/llvm/Support/system_error.h +++ b/include/llvm/Support/system_error.h @@ -628,8 +628,8 @@ class error_category public: virtual ~error_category(); -private: error_category(); +private: error_category(const error_category&) LLVM_DELETED_FUNCTION; error_category& operator=(const error_category&) LLVM_DELETED_FUNCTION; diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 19528c8e67b..ab0a1249f2d 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3257,7 +3257,7 @@ error_code BitcodeReader::InitLazyStream() { } namespace { -class BitcodeErrorCategoryType : public _do_message { +class BitcodeErrorCategoryType : public error_category { const char *name() const override { return "llvm.bitcode"; } diff --git a/lib/Object/Error.cpp b/lib/Object/Error.cpp index 47ce38c8883..8e508696cfb 100644 --- a/lib/Object/Error.cpp +++ b/lib/Object/Error.cpp @@ -18,11 +18,11 @@ using namespace llvm; using namespace object; namespace { -class _object_error_category : public _do_message { +class _object_error_category : public error_category { public: - virtual const char* name() const; - virtual std::string message(int ev) const; - virtual error_condition default_error_condition(int ev) const; + const char* name() const override; + std::string message(int ev) const override; + error_condition default_error_condition(int ev) const override; }; } diff --git a/tools/llvm-readobj/Error.cpp b/tools/llvm-readobj/Error.cpp index 1aed92bc8dd..83ed6a7dfc0 100644 --- a/tools/llvm-readobj/Error.cpp +++ b/tools/llvm-readobj/Error.cpp @@ -17,7 +17,7 @@ using namespace llvm; namespace { -class _readobj_error_category : public _do_message { +class _readobj_error_category : public error_category { public: const char* name() const override; std::string message(int ev) const override;