[cfe-commits] r109380 - in /cfe/trunk: 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
Douglas Gregor
dgregor at apple.com
Sun Jul 25 11:38:02 PDT 2010
Author: dgregor
Date: Sun Jul 25 13:38:02 2010
New Revision: 109380
URL: http://llvm.org/viewvc/llvm-project?rev=109380&view=rev
Log:
Remove destructors from declaration nodes
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/include/clang/AST/DeclObjC.h
cfe/trunk/include/clang/AST/DeclTemplate.h
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/AST/DeclBase.cpp
cfe/trunk/lib/AST/DeclCXX.cpp
cfe/trunk/lib/AST/DeclTemplate.cpp
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Sun Jul 25 13:38:02 2010
@@ -417,8 +417,6 @@
: ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo) {}
public:
- virtual ~DeclaratorDecl();
-
TypeSourceInfo *getTypeSourceInfo() const {
return hasExtInfo()
? getExtInfo()->TInfo
@@ -604,8 +602,6 @@
QualType T, TypeSourceInfo *TInfo, StorageClass S,
StorageClass SCAsWritten);
- virtual ~VarDecl();
-
virtual SourceLocation getInnerLocStart() const;
virtual SourceRange getSourceRange() const;
@@ -1187,8 +1183,6 @@
HasImplicitReturnZero(false),
EndRangeLoc(L), TemplateOrSpecialization() {}
- virtual ~FunctionDecl() {}
-
typedef Redeclarable<FunctionDecl> redeclarable_base;
virtual FunctionDecl *getNextRedeclaration() { return RedeclLink.getNext(); }
@@ -1698,7 +1692,6 @@
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 @@
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 @@
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 @@
IsVariadic(false), ParamInfo(0), NumParams(0), Body(0),
SignatureAsWritten(0) {}
- virtual ~BlockDecl();
-
public:
static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L);
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Sun Jul 25 13:38:02 2010
@@ -400,8 +400,6 @@
CXXRecordDecl *PrevDecl,
SourceLocation TKL = SourceLocation());
- ~CXXRecordDecl();
-
public:
/// base_class_iterator - Iterator that traverses the base classes
/// of a class.
@@ -2237,8 +2235,6 @@
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; }
Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Sun Jul 25 13:38:02 2010
@@ -41,9 +41,6 @@
public:
ObjCListBase() : List(0), NumElts(0) {}
- ~ObjCListBase() {
- }
-
unsigned size() const { return NumElts; }
bool empty() const { return NumElts == 0; }
@@ -183,8 +180,6 @@
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 @@
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 @@
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 @@
isForwardProtoDecl(true) {
}
- virtual ~ObjCProtocolDecl() {}
-
public:
static ObjCProtocolDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id);
@@ -820,7 +809,6 @@
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 @@
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 @@
ClassInterface(classInterface) {}
public:
- virtual ~ObjCImplDecl() {}
-
const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
void setClassInterface(ObjCInterfaceDecl *IFace);
Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Sun Jul 25 13:38:02 2010
@@ -193,8 +193,6 @@
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 @@
: NamedDecl(DK, DC, L, Name), TemplatedDecl(Decl),
TemplateParams(Params) { }
public:
- ~TemplateDecl();
-
/// Get the list of template parameters
TemplateParameterList *getTemplateParameters() const {
return TemplateParams;
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Sun Jul 25 13:38:02 2010
@@ -531,8 +531,6 @@
return decl->getInnerLocStart();
}
-DeclaratorDecl::~DeclaratorDecl() {}
-
SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {
TypeSourceInfo *TSI = getTypeSourceInfo();
if (TSI) return TSI->getTypeLoc().getBeginLoc();
@@ -621,9 +619,6 @@
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 @@
SourceLocation());
}
-RecordDecl::~RecordDecl() {
-}
-
bool RecordDecl::isInjectedClassName() const {
return isImplicit() && getDeclName() && getDeclContext()->isRecord() &&
cast<RecordDecl>(getDeclContext())->getDeclName() == getDeclName();
@@ -1694,9 +1686,6 @@
// BlockDecl Implementation
//===----------------------------------------------------------------------===//
-BlockDecl::~BlockDecl() {
-}
-
void BlockDecl::setParams(ParmVarDecl **NewParamInfo,
unsigned NParms) {
assert(ParamInfo == 0 && "Already has param info!");
@@ -1762,9 +1751,6 @@
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) {
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Sun Jul 25 13:38:02 2010
@@ -470,12 +470,7 @@
}
}
-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.
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Sun Jul 25 13:38:02 2010
@@ -65,9 +65,6 @@
SourceLocation());
}
-CXXRecordDecl::~CXXRecordDecl() {
-}
-
void
CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
unsigned NumBases) {
@@ -1046,9 +1043,6 @@
return new (C) StaticAssertDecl(DC, L, AssertExpr, Message);
}
-StaticAssertDecl::~StaticAssertDecl() {
-}
-
static const char *getAccessName(AccessSpecifier AS) {
switch (AS) {
default:
Modified: cfe/trunk/lib/AST/DeclTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=109380&r1=109379&r2=109380&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclTemplate.cpp (original)
+++ cfe/trunk/lib/AST/DeclTemplate.cpp Sun Jul 25 13:38:02 2010
@@ -84,13 +84,6 @@
}
//===----------------------------------------------------------------------===//
-// TemplateDecl Implementation
-//===----------------------------------------------------------------------===//
-
-TemplateDecl::~TemplateDecl() {
-}
-
-//===----------------------------------------------------------------------===//
// FunctionTemplateDecl Implementation
//===----------------------------------------------------------------------===//
@@ -462,8 +455,6 @@
StructuredArguments.setInt(0); // Doesn't own the pointer.
}
-TemplateArgumentList::~TemplateArgumentList() {}
-
//===----------------------------------------------------------------------===//
// ClassTemplateSpecializationDecl Implementation
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list