From: David Blaikie Date: Thu, 13 Aug 2015 21:15:23 +0000 (+0000) Subject: Wdeprecated: Replace deprecated throw() with LLVM_NOEXCEPT which expands to 'noexcept... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4980cc38437272680e760484c7fe0d35a93baf33;p=clang Wdeprecated: Replace deprecated throw() with LLVM_NOEXCEPT which expands to 'noexcept' where available (and throw() otherwise) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244956 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 4e282d68b7..8b80e9f639 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -56,21 +56,21 @@ protected: bool IsLateParsed : 1; bool DuplicatesAllowed : 1; - void* operator new(size_t bytes) throw() { + void *operator new(size_t bytes) LLVM_NOEXCEPT { llvm_unreachable("Attrs cannot be allocated with regular 'new'."); } - void operator delete(void* data) throw() { + void operator delete(void *data) LLVM_NOEXCEPT { llvm_unreachable("Attrs cannot be released with regular 'delete'."); } public: // Forward so that the regular new and delete do not hide global ones. - void* operator new(size_t Bytes, ASTContext &C, - size_t Alignment = 8) throw() { + void *operator new(size_t Bytes, ASTContext &C, + size_t Alignment = 8) LLVM_NOEXCEPT { return ::operator new(Bytes, C, Alignment); } void operator delete(void *Ptr, ASTContext &C, - size_t Alignment) throw() { + size_t Alignment) LLVM_NOEXCEPT { return ::operator delete(Ptr, C, Alignment); } diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index eb0bfd3bb5..c64ced450c 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -71,10 +71,10 @@ public: // Make vanilla 'new' and 'delete' illegal for Stmts. protected: - void* operator new(size_t bytes) throw() { + void *operator new(size_t bytes) LLVM_NOEXCEPT { llvm_unreachable("Stmts cannot be allocated with regular 'new'."); } - void operator delete(void* data) throw() { + void operator delete(void *data) LLVM_NOEXCEPT { llvm_unreachable("Stmts cannot be released with regular 'delete'."); } @@ -272,14 +272,12 @@ public: return operator new(bytes, *C, alignment); } - void* operator new(size_t bytes, void* mem) throw() { - return mem; - } + void *operator new(size_t bytes, void *mem) LLVM_NOEXCEPT { return mem; } - void operator delete(void*, const ASTContext&, unsigned) throw() { } - void operator delete(void*, const ASTContext*, unsigned) throw() { } - void operator delete(void*, size_t) throw() { } - void operator delete(void*, void*) throw() { } + void operator delete(void *, const ASTContext &, unsigned) LLVM_NOEXCEPT {} + void operator delete(void *, const ASTContext *, unsigned) LLVM_NOEXCEPT {} + void operator delete(void *, size_t) LLVM_NOEXCEPT {} + void operator delete(void *, void *) LLVM_NOEXCEPT {} public: /// \brief A placeholder type used to construct an empty shell of a diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h index 53367ab854..87b8ce1af0 100644 --- a/include/clang/Lex/PreprocessingRecord.h +++ b/include/clang/Lex/PreprocessingRecord.h @@ -32,12 +32,12 @@ namespace clang { } /// \brief Allocates memory within a Clang preprocessing record. -void* operator new(size_t bytes, clang::PreprocessingRecord& PR, - unsigned alignment = 8) throw(); +void *operator new(size_t bytes, clang::PreprocessingRecord &PR, + unsigned alignment = 8) LLVM_NOEXCEPT; /// \brief Frees memory allocated in a Clang preprocessing record. void operator delete(void *ptr, clang::PreprocessingRecord &PR, - unsigned) throw(); + unsigned) LLVM_NOEXCEPT; namespace clang { class MacroDefinitionRecord; @@ -98,27 +98,25 @@ namespace clang { // Only allow allocation of preprocessed entities using the allocator // in PreprocessingRecord or by doing a placement new. - void* operator new(size_t bytes, PreprocessingRecord& PR, - unsigned alignment = 8) throw() { + void *operator new(size_t bytes, PreprocessingRecord &PR, + unsigned alignment = 8) LLVM_NOEXCEPT { return ::operator new(bytes, PR, alignment); } - - void* operator new(size_t bytes, void* mem) throw() { - return mem; - } - - void operator delete(void* ptr, PreprocessingRecord& PR, - unsigned alignment) throw() { + + void *operator new(size_t bytes, void *mem) LLVM_NOEXCEPT { return mem; } + + void operator delete(void *ptr, PreprocessingRecord &PR, + unsigned alignment) LLVM_NOEXCEPT { return ::operator delete(ptr, PR, alignment); } - - void operator delete(void*, std::size_t) throw() { } - void operator delete(void*, void*) throw() { } - + + void operator delete(void *, std::size_t) LLVM_NOEXCEPT {} + void operator delete(void *, void *) LLVM_NOEXCEPT {} + private: // Make vanilla 'new' and 'delete' illegal for preprocessed entities. - void* operator new(size_t bytes) throw(); - void operator delete(void* data) throw(); + void *operator new(size_t bytes) LLVM_NOEXCEPT; + void operator delete(void *data) LLVM_NOEXCEPT; }; /// \brief Records the presence of a preprocessor directive. @@ -525,13 +523,13 @@ namespace clang { }; } // end namespace clang -inline void* operator new(size_t bytes, clang::PreprocessingRecord& PR, - unsigned alignment) throw() { +inline void *operator new(size_t bytes, clang::PreprocessingRecord &PR, + unsigned alignment) LLVM_NOEXCEPT { return PR.Allocate(bytes, alignment); } -inline void operator delete(void* ptr, clang::PreprocessingRecord& PR, - unsigned) throw() { +inline void operator delete(void *ptr, clang::PreprocessingRecord &PR, + unsigned) LLVM_NOEXCEPT { PR.Deallocate(ptr); }