Wdeprecated: Replace deprecated throw() with LLVM_NOEXCEPT which expands to 'noexcept' where available (and throw() otherwise)

llvm-svn: 244956
This commit is contained in:
David Blaikie 2015-08-13 21:15:23 +00:00
parent 80e4ac802a
commit 6646e4c193
3 changed files with 32 additions and 36 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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);
}