r188648 - Make the version of Stmt::operator new that takes ASTContext* call the ASTContext& version in Stmt inline instead of having two out of line functions that both call to the global versions.

Craig Topper craig.topper at gmail.com
Sun Aug 18 20:11:35 PDT 2013


Author: ctopper
Date: Sun Aug 18 22:11:34 2013
New Revision: 188648

URL: http://llvm.org/viewvc/llvm-project?rev=188648&view=rev
Log:
Make the version of Stmt::operator new that takes ASTContext* call the ASTContext& version in Stmt inline instead of having two out of line functions that both call to the global versions.

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=188648&r1=188647&r2=188648&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Sun Aug 18 22:11:34 2013
@@ -316,7 +316,9 @@ public:
                      unsigned alignment = 8);
 
   void* operator new(size_t bytes, const ASTContext* C,
-                     unsigned alignment = 8);
+                     unsigned alignment = 8) {
+    return operator new(bytes, *C, alignment);
+  }
 
   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=188648&r1=188647&r2=188648&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Sun Aug 18 22:11:34 2013
@@ -54,11 +54,6 @@ void *Stmt::operator new(size_t bytes, c
   return ::operator new(bytes, C, alignment);
 }
 
-void *Stmt::operator new(size_t bytes, const ASTContext* C,
-                         unsigned alignment) {
-  return ::operator new(bytes, *C, alignment);
-}
-
 const char *Stmt::getStmtClassName() const {
   return getStmtInfoTableEntry((StmtClass) StmtBits.sClass).Name;
 }





More information about the cfe-commits mailing list