Author: dblaikie Date: Thu Aug 13 16:15:23 2015 New Revision: 244956 URL: http://llvm.org/viewvc/llvm-project?rev=244956&view=rev Log: Wdeprecated: Replace deprecated throw() with LLVM_NOEXCEPT which expands to 'noexcept' where available (and throw() otherwise)
Modified: cfe/trunk/include/clang/AST/Attr.h cfe/trunk/include/clang/AST/Stmt.h cfe/trunk/include/clang/Lex/PreprocessingRecord.h Modified: cfe/trunk/include/clang/AST/Attr.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Attr.h?rev=244956&r1=244955&r2=244956&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Attr.h (original) +++ cfe/trunk/include/clang/AST/Attr.h Thu Aug 13 16:15:23 2015 @@ -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); } Modified: cfe/trunk/include/clang/AST/Stmt.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=244956&r1=244955&r2=244956&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Stmt.h (original) +++ cfe/trunk/include/clang/AST/Stmt.h Thu Aug 13 16:15:23 2015 @@ -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 Modified: cfe/trunk/include/clang/Lex/PreprocessingRecord.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PreprocessingRecord.h?rev=244956&r1=244955&r2=244956&view=diff ============================================================================== --- cfe/trunk/include/clang/Lex/PreprocessingRecord.h (original) +++ cfe/trunk/include/clang/Lex/PreprocessingRecord.h Thu Aug 13 16:15:23 2015 @@ -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); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits