llvm.org GIT mirror llvm / 5b1c9f3
Remove LLVM_NOEXCEPT and replace it with noexcept Now that we have dropped MSVC 2013, all supported compilers support noexcept and we can drop this portability macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284672 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 2 years ago
19 changed file(s) with 26 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
577577 /// allocator supports it).
578578 /// \return The allocated memory. Could be NULL.
579579 inline void *operator new(size_t Bytes, llvm::MCContext &C,
580 size_t Alignment = 8) LLVM_NOEXCEPT {
580 size_t Alignment = 8) noexcept {
581581 return C.allocate(Bytes, Alignment);
582582 }
583583 /// \brief Placement delete companion to the new above.
586586 /// invoking it directly; see the new operator for more details. This operator
587587 /// is called implicitly by the compiler if a placement new expression using
588588 /// the MCContext throws in the object constructor.
589 inline void operator delete(void *Ptr, llvm::MCContext &C,
590 size_t) LLVM_NOEXCEPT {
589 inline void operator delete(void *Ptr, llvm::MCContext &C, size_t) noexcept {
591590 C.deallocate(Ptr);
592591 }
593592
611610 /// allocator supports it).
612611 /// \return The allocated memory. Could be NULL.
613612 inline void *operator new[](size_t Bytes, llvm::MCContext &C,
614 size_t Alignment = 8) LLVM_NOEXCEPT {
613 size_t Alignment = 8) noexcept {
615614 return C.allocate(Bytes, Alignment);
616615 }
617616
621620 /// invoking it directly; see the new[] operator for more details. This operator
622621 /// is called implicitly by the compiler if a placement new[] expression using
623622 /// the MCContext throws in the object constructor.
624 inline void operator delete[](void *Ptr, llvm::MCContext &C) LLVM_NOEXCEPT {
623 inline void operator delete[](void *Ptr, llvm::MCContext &C) noexcept {
625624 C.deallocate(Ptr);
626625 }
627626
7070
7171 #else
7272 #define LLVM_MSC_PREREQ(version) 0
73 #endif
74
75 #if !defined(_MSC_VER) || defined(__clang__) || LLVM_MSC_PREREQ(1900)
76 #define LLVM_NOEXCEPT noexcept
77 #else
78 #define LLVM_NOEXCEPT throw()
7973 #endif
8074
8175 /// \brief Does the compiler support ref-qualifiers for *this?
143143 unsigned int getType() const { return TypeID; }
144144
145145 void *operator new(size_t Size, BumpPtrAllocator &Alloc,
146 size_t Alignment = 16) LLVM_NOEXCEPT {
146 size_t Alignment = 16) noexcept {
147147 return Alloc.Allocate(Size, Alignment);
148148 }
149149
150150 void operator delete(void *Ptr, BumpPtrAllocator &Alloc,
151 size_t Size) LLVM_NOEXCEPT {
151 size_t Size) noexcept {
152152 Alloc.Deallocate(Ptr, Size);
153153 }
154154
156156 std::unique_ptr &Doc;
157157 SMRange SourceRange;
158158
159 void operator delete(void *) LLVM_NOEXCEPT = delete;
159 void operator delete(void *) noexcept = delete;
160160
161161 ~Node() = default;
162162
65806580 // will be removed once this transition is complete. Clients should prefer to
65816581 // deal with the Error value directly, rather than converting to error_code.
65826582 class BitcodeErrorCategoryType : public std::error_category {
6583 const char *name() const LLVM_NOEXCEPT override {
6583 const char *name() const noexcept override {
65846584 return "llvm.bitcode";
65856585 }
65866586 std::string message(int IE) const override {
1919 // deal with the Error value directly, rather than converting to error_code.
2020 class CodeViewErrorCategory : public std::error_category {
2121 public:
22 const char *name() const LLVM_NOEXCEPT override { return "llvm.codeview"; }
22 const char *name() const noexcept override { return "llvm.codeview"; }
2323
2424 std::string message(int Condition) const override {
2525 switch (static_cast(Condition)) {
1919 // deal with the Error value directly, rather than converting to error_code.
2020 class MSFErrorCategory : public std::error_category {
2121 public:
22 const char *name() const LLVM_NOEXCEPT override { return "llvm.msf"; }
22 const char *name() const noexcept override { return "llvm.msf"; }
2323
2424 std::string message(int Condition) const override {
2525 switch (static_cast(Condition)) {
99 // deal with the Error value directly, rather than converting to error_code.
1010 class DIAErrorCategory : public std::error_category {
1111 public:
12 const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb.dia"; }
12 const char *name() const noexcept override { return "llvm.pdb.dia"; }
1313
1414 std::string message(int Condition) const override {
1515 switch (static_cast(Condition)) {
1919 // deal with the Error value directly, rather than converting to error_code.
2020 class GenericErrorCategory : public std::error_category {
2121 public:
22 const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb"; }
22 const char *name() const noexcept override { return "llvm.pdb"; }
2323
2424 std::string message(int Condition) const override {
2525 switch (static_cast(Condition)) {
1010 // deal with the Error value directly, rather than converting to error_code.
1111 class RawErrorCategory : public std::error_category {
1212 public:
13 const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb.raw"; }
13 const char *name() const noexcept override { return "llvm.pdb.raw"; }
1414
1515 std::string message(int Condition) const override {
1616 switch (static_cast(Condition)) {
2424 // deal with the Error value directly, rather than converting to error_code.
2525 class OrcErrorCategory : public std::error_category {
2626 public:
27 const char *name() const LLVM_NOEXCEPT override { return "orc"; }
27 const char *name() const noexcept override { return "orc"; }
2828
2929 std::string message(int condition) const override {
3030 switch (static_cast(condition)) {
3838 // deal with the Error value directly, rather than converting to error_code.
3939 class RuntimeDyldErrorCategory : public std::error_category {
4040 public:
41 const char *name() const LLVM_NOEXCEPT override { return "runtimedyld"; }
41 const char *name() const noexcept override { return "runtimedyld"; }
4242
4343 std::string message(int Condition) const override {
4444 switch (static_cast(Condition)) {
2323 // deal with the Error value directly, rather than converting to error_code.
2424 class _object_error_category : public std::error_category {
2525 public:
26 const char* name() const LLVM_NOEXCEPT override;
26 const char* name() const noexcept override;
2727 std::string message(int ev) const override;
2828 };
2929 }
3030
31 const char *_object_error_category::name() const LLVM_NOEXCEPT {
31 const char *_object_error_category::name() const noexcept {
3232 return "llvm.object";
3333 }
3434
588588 // will be removed once this transition is complete. Clients should prefer to
589589 // deal with the Error value directly, rather than converting to error_code.
590590 class CoverageMappingErrorCategoryType : public std::error_category {
591 const char *name() const LLVM_NOEXCEPT override { return "llvm.coveragemap"; }
591 const char *name() const noexcept override { return "llvm.coveragemap"; }
592592 std::string message(int IE) const override {
593593 return getCoverageMapErrString(static_cast(IE));
594594 }
7979 // will be removed once this transition is complete. Clients should prefer to
8080 // deal with the Error value directly, rather than converting to error_code.
8181 class InstrProfErrorCategoryType : public std::error_category {
82 const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; }
82 const char *name() const noexcept override { return "llvm.instrprof"; }
8383 std::string message(int IE) const override {
8484 return getInstrProfErrString(static_cast(IE));
8585 }
2323 // will be removed once this transition is complete. Clients should prefer to
2424 // deal with the Error value directly, rather than converting to error_code.
2525 class SampleProfErrorCategoryType : public std::error_category {
26 const char *name() const LLVM_NOEXCEPT override { return "llvm.sampleprof"; }
26 const char *name() const noexcept override { return "llvm.sampleprof"; }
2727 std::string message(int IE) const override {
2828 sampleprof_error E = static_cast(IE);
2929 switch (E) {
2727 // deal with the Error value directly, rather than converting to error_code.
2828 class ErrorErrorCategory : public std::error_category {
2929 public:
30 const char *name() const LLVM_NOEXCEPT override { return "Error"; }
30 const char *name() const noexcept override { return "Error"; }
3131
3232 std::string message(int condition) const override {
3333 switch (static_cast(condition)) {
2121 // deal with the Error value directly, rather than converting to error_code.
2222 class cxxdump_error_category : public std::error_category {
2323 public:
24 const char *name() const LLVM_NOEXCEPT override { return "llvm.cxxdump"; }
24 const char *name() const noexcept override { return "llvm.cxxdump"; }
2525 std::string message(int ev) const override {
2626 switch (static_cast(ev)) {
2727 case cxxdump_error::success:
2121 // deal with the Error value directly, rather than converting to error_code.
2222 class _readobj_error_category : public std::error_category {
2323 public:
24 const char* name() const LLVM_NOEXCEPT override;
24 const char* name() const noexcept override;
2525 std::string message(int ev) const override;
2626 };
2727 } // namespace
2828
29 const char *_readobj_error_category::name() const LLVM_NOEXCEPT {
29 const char *_readobj_error_category::name() const noexcept {
3030 return "llvm.readobj";
3131 }
3232
1717 // deal with the Error value directly, rather than converting to error_code.
1818 class _obj2yaml_error_category : public std::error_category {
1919 public:
20 const char *name() const LLVM_NOEXCEPT override;
20 const char *name() const noexcept override;
2121 std::string message(int ev) const override;
2222 };
2323 } // namespace
2424
25 const char *_obj2yaml_error_category::name() const LLVM_NOEXCEPT {
25 const char *_obj2yaml_error_category::name() const noexcept {
2626 return "obj2yaml";
2727 }
2828