From 9ee34311f3a9f6d49023bc74f6028133f90e1d4f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 12 Jun 2014 01:45:43 +0000 Subject: [PATCH] Don't import error_category into the llvm namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210733 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/Error.h | 2 +- include/llvm/ProfileData/InstrProf.h | 2 +- include/llvm/Support/system_error.h | 1 - lib/Bitcode/Reader/BitcodeReader.cpp | 4 ++-- lib/Bitcode/Reader/BitcodeReader.h | 2 +- lib/Object/Error.cpp | 4 ++-- lib/ProfileData/InstrProf.cpp | 4 ++-- tools/llvm-readobj/Error.cpp | 4 ++-- tools/llvm-readobj/Error.h | 2 +- tools/obj2yaml/Error.cpp | 4 ++-- tools/obj2yaml/Error.h | 2 +- 11 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/llvm/Object/Error.h b/include/llvm/Object/Error.h index 15824f8e116..3db9fa45e38 100644 --- a/include/llvm/Object/Error.h +++ b/include/llvm/Object/Error.h @@ -19,7 +19,7 @@ namespace llvm { namespace object { -const error_category &object_category(); +const std::error_category &object_category(); enum class object_error { success = 0, diff --git a/include/llvm/ProfileData/InstrProf.h b/include/llvm/ProfileData/InstrProf.h index 755ba36bcab..b44b92ef626 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -20,7 +20,7 @@ namespace llvm { -const error_category &instrprof_category(); +const std::error_category &instrprof_category(); enum class instrprof_error { success = 0, diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h index 83645173b9c..932fc1e1ad0 100644 --- a/include/llvm/Support/system_error.h +++ b/include/llvm/Support/system_error.h @@ -19,7 +19,6 @@ namespace llvm { using std::error_code; using std::generic_category; -using std::error_category; using std::make_error_code; } diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 849c548e0bc..a5eec0f70d4 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3300,7 +3300,7 @@ error_code BitcodeReader::InitLazyStream() { } namespace { -class BitcodeErrorCategoryType : public error_category { +class BitcodeErrorCategoryType : public std::error_category { const char *name() const LLVM_NOEXCEPT override { return "llvm.bitcode"; } @@ -3351,7 +3351,7 @@ class BitcodeErrorCategoryType : public error_category { }; } -const error_category &BitcodeReader::BitcodeErrorCategory() { +const std::error_category &BitcodeReader::BitcodeErrorCategory() { static BitcodeErrorCategoryType O; return O; } diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index 593d8f93ccf..65821caf857 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -193,7 +193,7 @@ class BitcodeReader : public GVMaterializer { /// not need this flag. bool UseRelativeIDs; - static const error_category &BitcodeErrorCategory(); + static const std::error_category &BitcodeErrorCategory(); public: enum ErrorType { diff --git a/lib/Object/Error.cpp b/lib/Object/Error.cpp index 39d765f884e..0a29cac6c4e 100644 --- a/lib/Object/Error.cpp +++ b/lib/Object/Error.cpp @@ -18,7 +18,7 @@ using namespace llvm; using namespace object; namespace { -class _object_error_category : public error_category { +class _object_error_category : public std::error_category { public: const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; @@ -55,7 +55,7 @@ _object_error_category::default_error_condition(int EV) const { return std::errc::invalid_argument; } -const error_category &object::object_category() { +const std::error_category &object::object_category() { static _object_error_category o; return o; } diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index 88ae7582ccb..628edfb86cd 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -18,7 +18,7 @@ using namespace llvm; namespace { -class InstrProfErrorCategoryType : public error_category { +class InstrProfErrorCategoryType : public std::error_category { const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; } std::string message(int IE) const override { instrprof_error E = static_cast(IE); @@ -61,7 +61,7 @@ class InstrProfErrorCategoryType : public error_category { }; } -const error_category &llvm::instrprof_category() { +const std::error_category &llvm::instrprof_category() { static InstrProfErrorCategoryType C; return C; } diff --git a/tools/llvm-readobj/Error.cpp b/tools/llvm-readobj/Error.cpp index 35e0a48fda0..4245e8d561a 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 error_category { +class _readobj_error_category : public std::error_category { public: const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; @@ -56,7 +56,7 @@ _readobj_error_category::default_error_condition(int EV) const { } namespace llvm { -const error_category &readobj_category() { +const std::error_category &readobj_category() { static _readobj_error_category o; return o; } diff --git a/tools/llvm-readobj/Error.h b/tools/llvm-readobj/Error.h index b3aab327cbe..b4ffb82efcd 100644 --- a/tools/llvm-readobj/Error.h +++ b/tools/llvm-readobj/Error.h @@ -18,7 +18,7 @@ namespace llvm { -const error_category &readobj_category(); +const std::error_category &readobj_category(); enum class readobj_error { success = 0, diff --git a/tools/obj2yaml/Error.cpp b/tools/obj2yaml/Error.cpp index 3034e089514..5b07b9cda8d 100644 --- a/tools/obj2yaml/Error.cpp +++ b/tools/obj2yaml/Error.cpp @@ -13,7 +13,7 @@ using namespace llvm; namespace { -class _obj2yaml_error_category : public error_category { +class _obj2yaml_error_category : public std::error_category { public: const char *name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; @@ -47,7 +47,7 @@ _obj2yaml_error_category::default_error_condition(int ev) const { } namespace llvm { -const error_category &obj2yaml_category() { + const std::error_category &obj2yaml_category() { static _obj2yaml_error_category o; return o; } diff --git a/tools/obj2yaml/Error.h b/tools/obj2yaml/Error.h index 7180d543075..b4d13ba7d03 100644 --- a/tools/obj2yaml/Error.h +++ b/tools/obj2yaml/Error.h @@ -14,7 +14,7 @@ namespace llvm { -const error_category &obj2yaml_category(); +const std::error_category &obj2yaml_category(); enum class obj2yaml_error { success = 0, -- 2.34.1