llvm.org GIT mirror llvm / fbb5f70
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 Rafael Espindola 6 years ago
7 changed file(s) with 17 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
623623 error_category& operator=(const error_category&) LLVM_DELETED_FUNCTION;
624624
625625 public:
626 virtual const char* name() const = 0;
627 virtual error_condition default_error_condition(int _ev) const;
628 virtual bool equivalent(int _code, const error_condition& _condition) const;
629 virtual bool equivalent(const error_code& _code, int _condition) const;
626 virtual const char* name() const LLVM_NOEXCEPT = 0;
627 virtual error_condition default_error_condition(int _ev) const LLVM_NOEXCEPT;
628 virtual bool
629 equivalent(int _code, const error_condition &_condition) const LLVM_NOEXCEPT;
630 virtual bool equivalent(const error_code &_code,
631 int _condition) const LLVM_NOEXCEPT;
630632 virtual std::string message(int _ev) const = 0;
631633
632634 bool operator==(const error_category& _rhs) const {return this == &_rhs;}
33003300
33013301 namespace {
33023302 class BitcodeErrorCategoryType : public error_category {
3303 const char *name() const override {
3303 const char *name() const LLVM_NOEXCEPT override {
33043304 return "llvm.bitcode";
33053305 }
33063306 std::string message(int IE) const override {
1919 namespace {
2020 class _object_error_category : public error_category {
2121 public:
22 const char* name() const override;
22 const char* name() const LLVM_NOEXCEPT override;
2323 std::string message(int ev) const override;
24 error_condition default_error_condition(int ev) const override;
24 error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override;
2525 };
2626 }
2727
1818
1919 namespace {
2020 class InstrProfErrorCategoryType : public error_category {
21 const char *name() const override { return "llvm.instrprof"; }
21 const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; }
2222 std::string message(int IE) const override {
2323 instrprof_error E = static_cast(IE);
2424 switch (E) {
5151 }
5252 llvm_unreachable("A value of instrprof_error has no message.");
5353 }
54 error_condition default_error_condition(int EV) const override {
54 error_condition default_error_condition(int EV) const LLVM_NOEXCEPT override {
5555 if (static_cast(EV) == instrprof_error::success)
5656 return error_condition();
5757 return errc::invalid_argument;
4747
4848 class _generic_error_category : public _do_message {
4949 public:
50 const char* name() const override;
50 const char* name() const LLVM_NOEXCEPT override;
5151 std::string message(int ev) const override;
5252 };
5353
7373
7474 class _system_error_category : public _do_message {
7575 public:
76 const char* name() const override;
76 const char* name() const LLVM_NOEXCEPT override;
7777 std::string message(int ev) const override;
7878 error_condition default_error_condition(int ev) const override;
7979 };
1818 namespace {
1919 class _readobj_error_category : public error_category {
2020 public:
21 const char* name() const override;
21 const char* name() const LLVM_NOEXCEPT override;
2222 std::string message(int ev) const override;
23 error_condition default_error_condition(int ev) const override;
23 error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override;
2424 };
2525 } // namespace
2626
1414 namespace {
1515 class _obj2yaml_error_category : public error_category {
1616 public:
17 const char *name() const override;
17 const char *name() const LLVM_NOEXCEPT override;
1818 std::string message(int ev) const override;
19 error_condition default_error_condition(int ev) const override;
19 error_condition default_error_condition(int ev) const LLVM_NOEXCEPT override;
2020 };
2121 } // namespace
2222