[cfe-commits] r125756 - in /cfe/trunk: include/clang/AST/DeclBase.h lib/AST/DeclBase.cpp

Douglas Gregor dgregor at apple.com
Thu Feb 17 10:14:32 PST 2011


Author: dgregor
Date: Thu Feb 17 12:14:32 2011
New Revision: 125756

URL: http://llvm.org/viewvc/llvm-project?rev=125756&view=rev
Log:
Remove the last virtual member function from the Decl hierarchy,
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).

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

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=125756&r1=125755&r2=125756&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Thu Feb 17 12:14:32 2011
@@ -270,8 +270,6 @@
     if (Decl::CollectingStats()) add(DK);
   }
 
-  virtual ~Decl();
-  
 public:
 
   /// \brief Source range that this declaration covers.

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=125756&r1=125755&r2=125756&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Thu Feb 17 12:14:32 2011
@@ -288,9 +288,6 @@
 // Decl Implementation
 //===----------------------------------------------------------------------===//
 
-// Out-of-line virtual method providing a home for Decl.
-Decl::~Decl() { }
-
 bool Decl::isOutOfLine() const {
   if (const VarDecl *VD = dyn_cast<VarDecl>(this))
     return VD->isOutOfLine();





More information about the cfe-commits mailing list