[cfe-commits] r54527 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Aug 8 07:08:58 PDT 2008
Author: akirtzidis
Date: Fri Aug 8 09:08:55 2008
New Revision: 54527
URL: http://llvm.org/viewvc/llvm-project?rev=54527&view=rev
Log:
Destroy and delete the FieldDecl members of a RecordDecl.
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=54527&r1=54526&r2=54527&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Fri Aug 8 09:08:55 2008
@@ -808,6 +808,10 @@
Members = 0;
NumMembers = -1;
}
+
+ virtual ~RecordDecl();
+ virtual void Destroy(ASTContext& C);
+
public:
static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=54527&r1=54526&r2=54527&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Fri Aug 8 09:08:55 2008
@@ -217,6 +217,19 @@
// RecordDecl Implementation
//===----------------------------------------------------------------------===//
+RecordDecl::~RecordDecl() {
+ delete[] Members;
+}
+
+void RecordDecl::Destroy(ASTContext& C) {
+ if (isDefinition())
+ for (field_iterator I=field_begin(), E=field_end(); I!=E; ++I)
+ (*I)->Destroy(C);
+
+ TagDecl::Destroy(C);
+}
+
+
/// defineBody - When created, RecordDecl's correspond to a forward declared
/// record. This method is used to mark the decl as being defined, with the
/// specified contents.
More information about the cfe-commits
mailing list