mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Destroy and delete the FieldDecl members of a RecordDecl.
llvm-svn: 54527
This commit is contained in:
@@ -808,6 +808,10 @@ protected:
|
||||
Members = 0;
|
||||
NumMembers = -1;
|
||||
}
|
||||
|
||||
virtual ~RecordDecl();
|
||||
virtual void Destroy(ASTContext& C);
|
||||
|
||||
public:
|
||||
|
||||
static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
|
||||
|
||||
@@ -217,6 +217,19 @@ unsigned FunctionDecl::getMinRequiredArguments() const {
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user