]> granicus.if.org Git - clang/commitdiff
Remove destructors from declaration nodes
authorDouglas Gregor <dgregor@apple.com>
Sun, 25 Jul 2010 18:38:02 +0000 (18:38 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 25 Jul 2010 18:38:02 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109380 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
include/clang/AST/DeclCXX.h
include/clang/AST/DeclObjC.h
include/clang/AST/DeclTemplate.h
lib/AST/Decl.cpp
lib/AST/DeclBase.cpp
lib/AST/DeclCXX.cpp
lib/AST/DeclTemplate.cpp

index e61e860b3e1cefe4a67389c876cdf41d1907787f..9647d0145e5730c9b31a3c1342799c0d4d0d7600 100644 (file)
@@ -417,8 +417,6 @@ protected:
     : ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo) {}
 
 public:
-  virtual ~DeclaratorDecl();
-
   TypeSourceInfo *getTypeSourceInfo() const {
     return hasExtInfo()
       ? getExtInfo()->TInfo
@@ -604,8 +602,6 @@ public:
                          QualType T, TypeSourceInfo *TInfo, StorageClass S,
                          StorageClass SCAsWritten);
 
-  virtual ~VarDecl();
-
   virtual SourceLocation getInnerLocStart() const;
   virtual SourceRange getSourceRange() const;
 
@@ -1187,8 +1183,6 @@ protected:
       HasImplicitReturnZero(false),
       EndRangeLoc(L), TemplateOrSpecialization() {}
 
-  virtual ~FunctionDecl() {}
-
   typedef Redeclarable<FunctionDecl> redeclarable_base;
   virtual FunctionDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
 
@@ -1698,7 +1692,6 @@ protected:
                    const llvm::APSInt &V)
     : ValueDecl(EnumConstant, DC, L, Id, T), Init((Stmt*)E), Val(V) {}
 
-  virtual ~EnumConstantDecl() {}
 public:
 
   static EnumConstantDecl *Create(ASTContext &C, EnumDecl *DC,
@@ -1761,8 +1754,6 @@ class TypedefDecl : public TypeDecl, public Redeclarable<TypedefDecl> {
               IdentifierInfo *Id, TypeSourceInfo *TInfo)
     : TypeDecl(Typedef, DC, L, Id), TInfo(TInfo) {}
 
-  virtual ~TypedefDecl();
-
 protected:
   typedef Redeclarable<TypedefDecl> redeclarable_base;
   virtual TypedefDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
@@ -2156,7 +2147,6 @@ protected:
   RecordDecl(Kind DK, TagKind TK, DeclContext *DC,
              SourceLocation L, IdentifierInfo *Id,
              RecordDecl *PrevDecl, SourceLocation TKL);
-  virtual ~RecordDecl();
 
 public:
   static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
@@ -2294,8 +2284,6 @@ protected:
       IsVariadic(false), ParamInfo(0), NumParams(0), Body(0),
       SignatureAsWritten(0) {}
 
-  virtual ~BlockDecl();
-
 public:
   static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L);
 
index 19bdc9c3c33d1c386f21c7b8110e0ced481a84b3..3fee44175007c08f0d45905d5bec9a60aa1f4c09 100644 (file)
@@ -400,8 +400,6 @@ protected:
                 CXXRecordDecl *PrevDecl,
                 SourceLocation TKL = SourceLocation());
 
-  ~CXXRecordDecl();
-
 public:
   /// base_class_iterator - Iterator that traverses the base classes
   /// of a class.
@@ -2237,8 +2235,6 @@ public:
   StringLiteral *getMessage() { return Message; }
   const StringLiteral *getMessage() const { return Message; }
 
-  virtual ~StaticAssertDecl();
-
   static bool classof(const Decl *D) { return classofKind(D->getKind()); }
   static bool classof(StaticAssertDecl *D) { return true; }
   static bool classofKind(Kind K) { return K == StaticAssert; }
index 0c298779a1303300829ae621490258f85f062ded..7dbfd2a3ad008fc1423bc5bdc02baa8ffeaf9206 100644 (file)
@@ -41,9 +41,6 @@ protected:
 
 public:
   ObjCListBase() : List(0), NumElts(0) {}
-  ~ObjCListBase() {
-  }
-
   unsigned size() const { return NumElts; }
   bool empty() const { return NumElts == 0; }
 
@@ -183,8 +180,6 @@ private:
     ResultTInfo(ResultTInfo),
     EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {}
 
-  virtual ~ObjCMethodDecl() {}
-
   /// \brief A definition will return its interface declaration.
   /// An interface declaration will return its definition.
   /// Otherwise it will return itself.
@@ -356,8 +351,6 @@ public:
                     IdentifierInfo *Id)
     : NamedDecl(DK, DC, L, Id), DeclContext(DK) {}
 
-  virtual ~ObjCContainerDecl() {}
-
   // Iterator access to properties.
   typedef specific_decl_iterator<ObjCPropertyDecl> prop_iterator;
   prop_iterator prop_begin() const {
@@ -483,8 +476,6 @@ class ObjCInterfaceDecl : public ObjCContainerDecl {
   ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id,
                     SourceLocation CLoc, bool FD, bool isInternal);
 
-  virtual ~ObjCInterfaceDecl() {}
-
 public:
   static ObjCInterfaceDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation atLoc,
@@ -746,8 +737,6 @@ class ObjCProtocolDecl : public ObjCContainerDecl {
       isForwardProtoDecl(true) {
   }
 
-  virtual ~ObjCProtocolDecl() {}
-
 public:
   static ObjCProtocolDecl *Create(ASTContext &C, DeclContext *DC,
                                   SourceLocation L, IdentifierInfo *Id);
@@ -820,7 +809,6 @@ private:
   ObjCClassDecl(DeclContext *DC, SourceLocation L,
                 ObjCInterfaceDecl *const *Elts, const SourceLocation *Locs,                
                 unsigned nElts, ASTContext &C);
-  virtual ~ObjCClassDecl() {}
 public:
   static ObjCClassDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                                ObjCInterfaceDecl *const *Elts = 0,
@@ -854,7 +842,6 @@ class ObjCForwardProtocolDecl : public Decl {
   ObjCForwardProtocolDecl(DeclContext *DC, SourceLocation L,
                           ObjCProtocolDecl *const *Elts, unsigned nElts,
                           const SourceLocation *Locs, ASTContext &C);
-  virtual ~ObjCForwardProtocolDecl() {}
 
 public:
   static ObjCForwardProtocolDecl *Create(ASTContext &C, DeclContext *DC,
@@ -1023,8 +1010,6 @@ protected:
       ClassInterface(classInterface) {}
 
 public:
-  virtual ~ObjCImplDecl() {}
-
   const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
   ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
   void setClassInterface(ObjCInterfaceDecl *IFace);
index 6c83e0019817ae778ff71ff39082b1038c024cc3..4084fccbdb07d9da991f42e8a609c1d097cad10b 100644 (file)
@@ -193,8 +193,6 @@ public:
 
   TemplateArgumentList() : NumFlatArguments(0), NumStructuredArguments(0) { }
 
-  ~TemplateArgumentList();
-  
   /// \brief Copies the template arguments into a locally new[]'d array.
   void init(ASTContext &Context,
             const TemplateArgument *Args, unsigned NumArgs);
@@ -250,8 +248,6 @@ protected:
     : NamedDecl(DK, DC, L, Name), TemplatedDecl(Decl),
       TemplateParams(Params) { }
 public:
-  ~TemplateDecl();
-
   /// Get the list of template parameters
   TemplateParameterList *getTemplateParameters() const {
     return TemplateParams;
index e92f530d450fc1fda5a6f7cf4b5aa4c6ce288f54..a30a43038247f289f56caf95147d251605dc333a 100644 (file)
@@ -531,8 +531,6 @@ static SourceLocation getTemplateOrInnerLocStart(const DeclT *decl) {
     return decl->getInnerLocStart();
 }
 
-DeclaratorDecl::~DeclaratorDecl() {}
-
 SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
   TypeSourceInfo *TSI = getTypeSourceInfo();
   if (TSI) return TSI->getTypeLoc().getBeginLoc();
@@ -621,9 +619,6 @@ VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
   return new (C) VarDecl(Var, DC, L, Id, T, TInfo, S, SCAsWritten);
 }
 
-VarDecl::~VarDecl() {
-}
-
 SourceLocation VarDecl::getInnerLocStart() const {
   SourceLocation Start = getTypeSpecStartLoc();
   if (Start.isInvalid())
@@ -1664,9 +1659,6 @@ RecordDecl *RecordDecl::Create(ASTContext &C, EmptyShell Empty) {
                             SourceLocation());
 }
 
-RecordDecl::~RecordDecl() {
-}
-
 bool RecordDecl::isInjectedClassName() const {
   return isImplicit() && getDeclName() && getDeclContext()->isRecord() &&
     cast<RecordDecl>(getDeclContext())->getDeclName() == getDeclName();
@@ -1694,9 +1686,6 @@ ValueDecl *RecordDecl::getAnonymousStructOrUnionObject() {
 // BlockDecl Implementation
 //===----------------------------------------------------------------------===//
 
-BlockDecl::~BlockDecl() {
-}
-
 void BlockDecl::setParams(ParmVarDecl **NewParamInfo,
                           unsigned NParms) {
   assert(ParamInfo == 0 && "Already has param info!");
@@ -1762,9 +1751,6 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
   return new (C) TypedefDecl(DC, L, Id, TInfo);
 }
 
-// Anchor TypedefDecl's vtable here.
-TypedefDecl::~TypedefDecl() {}
-
 FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC,
                                            SourceLocation L,
                                            StringLiteral *Str) {
index b38d0c23b7fc00ae207575b4d1c06cc087772d40..83976a5f23e8ec6cd48da76a39ff729cf015ad75 100644 (file)
@@ -470,12 +470,7 @@ bool DeclContext::classof(const Decl *D) {
   }
 }
 
-DeclContext::~DeclContext() {
-  // FIXME: Currently ~ASTContext will delete the StoredDeclsMaps because
-  // ~DeclContext() is not guaranteed to be called when ASTContext uses
-  // a BumpPtrAllocator.
-  // delete LookupPtr;
-}
+DeclContext::~DeclContext() { }
 
 /// \brief Find the parent context of this context that will be
 /// used for unqualified name lookup.
index 2581f9de573ad7cb18ef03037a0f971e17929045..5801afd76f1dbea5b334dd7c4d40c474fab8c40c 100644 (file)
@@ -65,9 +65,6 @@ CXXRecordDecl *CXXRecordDecl::Create(ASTContext &C, EmptyShell Empty) {
                                SourceLocation());
 }
 
-CXXRecordDecl::~CXXRecordDecl() {
-}
-
 void
 CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
                         unsigned NumBases) {
@@ -1046,9 +1043,6 @@ StaticAssertDecl *StaticAssertDecl::Create(ASTContext &C, DeclContext *DC,
   return new (C) StaticAssertDecl(DC, L, AssertExpr, Message);
 }
 
-StaticAssertDecl::~StaticAssertDecl() {
-}
-
 static const char *getAccessName(AccessSpecifier AS) {
   switch (AS) {
     default:
index 6aa6ec5869870dd50dd738a1ebff5b8a016b45e3..22b297d301bc5f6ba984c6dff1c94367cb77ed0e 100644 (file)
@@ -83,13 +83,6 @@ unsigned TemplateParameterList::getDepth() const {
     return cast<TemplateTemplateParmDecl>(FirstParm)->getDepth();
 }
 
-//===----------------------------------------------------------------------===//
-// TemplateDecl Implementation
-//===----------------------------------------------------------------------===//
-
-TemplateDecl::~TemplateDecl() {
-}
-
 //===----------------------------------------------------------------------===//
 // FunctionTemplateDecl Implementation
 //===----------------------------------------------------------------------===//
@@ -462,8 +455,6 @@ StructuredArguments.setPointer(NewArgs);
 StructuredArguments.setInt(0); // Doesn't own the pointer.
 }
 
-TemplateArgumentList::~TemplateArgumentList() {}
-
 //===----------------------------------------------------------------------===//
 // ClassTemplateSpecializationDecl Implementation
 //===----------------------------------------------------------------------===//