From f91d08712514fca6b1e66abf51a13f2d7041bb05 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 17 Feb 2011 18:14:32 +0000 Subject: [PATCH] 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125756 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 2 -- lib/AST/DeclBase.cpp | 3 --- 2 files changed, 5 deletions(-) diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index c67391653a..6670d9de12 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -270,8 +270,6 @@ protected: if (Decl::CollectingStats()) add(DK); } - virtual ~Decl(); - public: /// \brief Source range that this declaration covers. diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 437089a415..be4d82a054 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -288,9 +288,6 @@ void PrettyStackTraceDecl::print(llvm::raw_ostream &OS) const { // Decl Implementation //===----------------------------------------------------------------------===// -// Out-of-line virtual method providing a home for Decl. -Decl::~Decl() { } - bool Decl::isOutOfLine() const { if (const VarDecl *VD = dyn_cast(this)) return VD->isOutOfLine(); -- 2.50.1