diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-10 21:26:47 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-10 21:26:47 +0000 |
commit | fbb5f701863550f56438db7cb690fa1751f4148b (patch) | |
tree | c5791735bfa3712b88300aa5d04e5d72d110639a | |
parent | f85ae2a8c29d4391a487f91b03bb8add99d80639 (diff) | |
download | llvm-fbb5f701863550f56438db7cb690fa1751f4148b.tar.gz llvm-fbb5f701863550f56438db7cb690fa1751f4148b.tar.bz2 llvm-fbb5f701863550f56438db7cb690fa1751f4148b.tar.xz |
Mark a few functions noexcept.
This reduces the difference between std::error_code and llvm::error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210591 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/system_error.h | 10 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 2 | ||||
-rw-r--r-- | lib/Object/Error.cpp | 4 | ||||
-rw-r--r-- | lib/ProfileData/InstrProf.cpp | 4 | ||||
-rw-r--r-- | lib/Support/system_error.cpp | 4 | ||||
-rw-r--r-- | tools/llvm-readobj/Error.cpp | 4 | ||||
-rw-r--r-- | tools/obj2yaml/Error.cpp | 4 |
7 files changed, 17 insertions, 15 deletions
diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h index 104cbc42e5..724e3cef92 100644 --- a/include/llvm/Support/system_error.h +++ b/include/llvm/Support/system_error.h @@ -624,10 +624,12 @@ private: error_category& operator=(const error_category&) LLVM_DELETED_FUNCTION; public: - virtual const char* name() const = 0; - virtual error_condition default_error_condition(int _ev) const; - virtual bool equivalent(int _code, const error_condition& _condition) const; - virtual bool equivalent(const error_code& _code, int _condition) const; + virtual const char* name() const LLVM_NOEXCEPT = 0; + virtual error_condition default_error_condition(int _ev) const LLVM_NOEXCEPT; + virtual bool + equivalent(int _code, const error_condition &_condition) const LLVM_NOEXCEPT; + virtual bool equivalent(const error_code &_code, + int _condition) const LLVM_NOEXCEPT; virtual std::string message(int _ev) const = 0; bool operator==(const error_category& _rhs) const {return this == &_rhs;} diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 96381175bd..849c548e0b 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3301,7 +3301,7 @@ error_code BitcodeReader::InitLazyStream() { namespace { class BitcodeErrorCategoryType : public error_category { - const char *name() const override { + const char *name() const LLVM_NOEXCEPT override { return "llvm.bitcode"; } std::string message(int IE) const override { diff --git a/lib/Object/Error.cpp b/lib/Object/Error.cpp index f1d0f0184d..6bcc6f9a78 100644 --- a/lib/Object/Error.cpp +++ b/lib/Object/Error.cpp @@ -20,9 +20,9 @@ using namespace object; namespace { class _object_error_category : public error_category { public: - const char* name() const override; + const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; - error_condition default_error_condition(int ev) const override; + error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override; }; } diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index a6583130ee..94a79e9ed0 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -19,7 +19,7 @@ using namespace llvm; namespace { class InstrProfErrorCategoryType : public error_category { - const char *name() const override { return "llvm.instrprof"; } + const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; } std::string message(int IE) const override { instrprof_error E = static_cast<instrprof_error>(IE); switch (E) { @@ -52,7 +52,7 @@ class InstrProfErrorCategoryType : public error_category { } llvm_unreachable("A value of instrprof_error has no message."); } - error_condition default_error_condition(int EV) const override { + error_condition default_error_condition(int EV) const LLVM_NOEXCEPT override { if (static_cast<instrprof_error>(EV) == instrprof_error::success) return error_condition(); return errc::invalid_argument; diff --git a/lib/Support/system_error.cpp b/lib/Support/system_error.cpp index 299f54abb1..0ca183e40a 100644 --- a/lib/Support/system_error.cpp +++ b/lib/Support/system_error.cpp @@ -48,7 +48,7 @@ _do_message::message(int ev) const { class _generic_error_category : public _do_message { public: - const char* name() const override; + const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; }; @@ -74,7 +74,7 @@ generic_category() { class _system_error_category : public _do_message { public: - const char* name() const override; + const char* name() const LLVM_NOEXCEPT 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 75c392e0f9..424dfbea06 100644 --- a/tools/llvm-readobj/Error.cpp +++ b/tools/llvm-readobj/Error.cpp @@ -19,9 +19,9 @@ using namespace llvm; namespace { class _readobj_error_category : public error_category { public: - const char* name() const override; + const char* name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; - error_condition default_error_condition(int ev) const override; + error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override; }; } // namespace diff --git a/tools/obj2yaml/Error.cpp b/tools/obj2yaml/Error.cpp index 0003b7bb8d..7f25d745e1 100644 --- a/tools/obj2yaml/Error.cpp +++ b/tools/obj2yaml/Error.cpp @@ -15,9 +15,9 @@ using namespace llvm; namespace { class _obj2yaml_error_category : public error_category { public: - const char *name() const override; + const char *name() const LLVM_NOEXCEPT override; std::string message(int ev) const override; - error_condition default_error_condition(int ev) const override; + error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override; }; } // namespace |