From 5b3ebb4356ac62abd8767c4c3388b773d9d61802 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 18 Aug 2013 17:45:38 +0000 Subject: [PATCH] Remove throw() from Stmt::operator new so the compiler will omit the null check on the result since ASTContext allocator won't return null. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188641 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Stmt.h | 4 ++-- lib/AST/Stmt.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 834a3dc1c0..bc5dabb5ac 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -313,10 +313,10 @@ public: // Only allow allocation of Stmts using the allocator in ASTContext // or by doing a placement new. void* operator new(size_t bytes, const ASTContext& C, - unsigned alignment = 8) throw(); + unsigned alignment = 8); void* operator new(size_t bytes, const ASTContext* C, - unsigned alignment = 8) throw(); + unsigned alignment = 8); void* operator new(size_t bytes, void* mem) throw() { return mem; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 87e55a2fb9..a80bd87d21 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -50,12 +50,12 @@ static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) { } void *Stmt::operator new(size_t bytes, const ASTContext& C, - unsigned alignment) throw() { + unsigned alignment) { return ::operator new(bytes, C, alignment); } void *Stmt::operator new(size_t bytes, const ASTContext* C, - unsigned alignment) throw() { + unsigned alignment) { return ::operator new(bytes, *C, alignment); } -- 2.40.0