r188641 - Remove throw() from Stmt::operator new so the compiler will omit the null check on the result since ASTContext allocator won't return null.

Craig Topper craig.topper at gmail.com
Sun Aug 18 10:45:38 PDT 2013


Author: ctopper
Date: Sun Aug 18 12:45:38 2013
New Revision: 188641

URL: http://llvm.org/viewvc/llvm-project?rev=188641&view=rev
Log:
Remove throw() from Stmt::operator new so the compiler will omit the null check on the result since ASTContext allocator won't return null.

Modified:
    cfe/trunk/include/clang/AST/Stmt.h
    cfe/trunk/lib/AST/Stmt.cpp

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=188641&r1=188640&r2=188641&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Sun Aug 18 12:45:38 2013
@@ -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;

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=188641&r1=188640&r2=188641&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Sun Aug 18 12:45:38 2013
@@ -50,12 +50,12 @@ static StmtClassNameTable &getStmtInfoTa
 }
 
 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);
 }
 





More information about the cfe-commits mailing list