blob: 04ee44a480a86c5826d233a0ab78e2fc3db1ecb7 [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001//===--- Decl.cpp - Declaration AST Node Implementation -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner959e5be2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner4b009652007-07-25 00:24:17 +00007//
8//===----------------------------------------------------------------------===//
9//
Argiris Kirtzidise7dfca12008-06-04 13:04:04 +000010// This file implements the Decl subclasses.
Chris Lattner4b009652007-07-25 00:24:17 +000011//
12//===----------------------------------------------------------------------===//
13
14#include "clang/AST/Decl.h"
Douglas Gregor7a7be652009-02-03 19:21:40 +000015#include "clang/AST/DeclCXX.h"
Chris Lattnere4650482008-03-15 06:12:44 +000016#include "clang/AST/ASTContext.h"
Daniel Dunbarde300732008-08-11 04:54:23 +000017#include "clang/AST/Stmt.h"
Nuno Lopesc98406e2008-12-17 23:39:55 +000018#include "clang/AST/Expr.h"
Daniel Dunbarde300732008-08-11 04:54:23 +000019#include "clang/Basic/IdentifierTable.h"
Douglas Gregor09be81b2009-02-04 17:27:36 +000020#include <vector>
Ted Kremenekafdf8112008-05-20 00:43:19 +000021
Chris Lattner4b009652007-07-25 00:24:17 +000022using namespace clang;
23
Chris Lattnera8344c32008-03-15 05:43:15 +000024//===----------------------------------------------------------------------===//
Chris Lattnere4650482008-03-15 06:12:44 +000025// Decl Allocation/Deallocation Method Implementations
26//===----------------------------------------------------------------------===//
Argiris Kirtzidis03e6aaf2008-04-27 13:50:30 +000027
Argiris Kirtzidisd3586002008-04-17 14:40:12 +000028TranslationUnitDecl *TranslationUnitDecl::Create(ASTContext &C) {
Steve Naroff5abb0282009-01-27 21:25:57 +000029 return new (C) TranslationUnitDecl();
Argiris Kirtzidisd3586002008-04-17 14:40:12 +000030}
31
Argiris Kirtzidis03e6aaf2008-04-27 13:50:30 +000032NamespaceDecl *NamespaceDecl::Create(ASTContext &C, DeclContext *DC,
33 SourceLocation L, IdentifierInfo *Id) {
Steve Naroff5abb0282009-01-27 21:25:57 +000034 return new (C) NamespaceDecl(DC, L, Id);
Argiris Kirtzidis03e6aaf2008-04-27 13:50:30 +000035}
36
Ted Kremenek5be49242008-05-20 04:49:55 +000037void NamespaceDecl::Destroy(ASTContext& C) {
38 // NamespaceDecl uses "NextDeclarator" to chain namespace declarations
39 // together. They are all top-level Decls.
40
Ted Kremenek0f433842008-05-24 15:09:56 +000041 this->~NamespaceDecl();
Steve Naroff5abb0282009-01-27 21:25:57 +000042 C.Deallocate((void *)this);
Ted Kremenek5be49242008-05-20 04:49:55 +000043}
44
45
Chris Lattner8c7c6a12008-06-17 18:05:57 +000046ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +000047 SourceLocation L, IdentifierInfo *Id, QualType T) {
Steve Naroff5abb0282009-01-27 21:25:57 +000048 return new (C) ImplicitParamDecl(ImplicitParam, DC, L, Id, T);
Chris Lattner8c7c6a12008-06-17 18:05:57 +000049}
50
Chris Lattneref87a202008-04-22 18:39:57 +000051ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
Chris Lattnereee57c02008-04-04 06:12:32 +000052 SourceLocation L, IdentifierInfo *Id,
53 QualType T, StorageClass S,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +000054 Expr *DefArg) {
Steve Naroff5abb0282009-01-27 21:25:57 +000055 return new (C) ParmVarDecl(ParmVar, DC, L, Id, T, S, DefArg);
Fariborz Jahaniane26cb432008-12-20 23:29:59 +000056}
57
58QualType ParmVarDecl::getOriginalType() const {
Douglas Gregor469fc9a2009-02-02 23:39:07 +000059 if (const OriginalParmVarDecl *PVD =
60 dyn_cast<OriginalParmVarDecl>(this))
Fariborz Jahaniane26cb432008-12-20 23:29:59 +000061 return PVD->OriginalType;
62 return getType();
Chris Lattner48d225c2008-03-15 21:10:16 +000063}
64
Douglas Gregor469fc9a2009-02-02 23:39:07 +000065OriginalParmVarDecl *OriginalParmVarDecl::Create(
Fariborz Jahanian160e8812008-12-20 20:56:12 +000066 ASTContext &C, DeclContext *DC,
67 SourceLocation L, IdentifierInfo *Id,
68 QualType T, QualType OT, StorageClass S,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +000069 Expr *DefArg) {
Douglas Gregor469fc9a2009-02-02 23:39:07 +000070 return new (C) OriginalParmVarDecl(DC, L, Id, T, OT, S, DefArg);
Fariborz Jahanian160e8812008-12-20 20:56:12 +000071}
72
Chris Lattneref87a202008-04-22 18:39:57 +000073FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC,
Chris Lattnereee57c02008-04-04 06:12:32 +000074 SourceLocation L,
Douglas Gregor6704b312008-11-17 22:58:34 +000075 DeclarationName N, QualType T,
Chris Lattner4c7802b2008-03-15 21:24:04 +000076 StorageClass S, bool isInline,
Steve Naroff71cd7762008-10-03 00:02:03 +000077 SourceLocation TypeSpecStartLoc) {
Steve Naroff5abb0282009-01-27 21:25:57 +000078 return new (C) FunctionDecl(Function, DC, L, N, T, S, isInline,
Steve Naroff71cd7762008-10-03 00:02:03 +000079 TypeSpecStartLoc);
Chris Lattner4c7802b2008-03-15 21:24:04 +000080}
81
Steve Naroff52059382008-10-10 01:28:17 +000082BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {
Steve Naroff5abb0282009-01-27 21:25:57 +000083 return new (C) BlockDecl(DC, L);
Steve Naroff9ac456d2008-10-08 17:01:13 +000084}
85
Douglas Gregor8acb7272008-12-11 16:49:14 +000086FieldDecl *FieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
87 IdentifierInfo *Id, QualType T, Expr *BW,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +000088 bool Mutable) {
Steve Naroff5abb0282009-01-27 21:25:57 +000089 return new (C) FieldDecl(Decl::Field, DC, L, Id, T, BW, Mutable);
Chris Lattner81db64a2008-03-16 00:16:02 +000090}
91
Douglas Gregorc7f01612009-01-07 19:46:03 +000092bool FieldDecl::isAnonymousStructOrUnion() const {
93 if (!isImplicit() || getDeclName())
94 return false;
95
96 if (const RecordType *Record = getType()->getAsRecordType())
97 return Record->getDecl()->isAnonymousStructOrUnion();
98
99 return false;
100}
Chris Lattner4c7802b2008-03-15 21:24:04 +0000101
Chris Lattnereee57c02008-04-04 06:12:32 +0000102EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD,
103 SourceLocation L,
Chris Lattner58114f02008-03-15 21:32:50 +0000104 IdentifierInfo *Id, QualType T,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000105 Expr *E, const llvm::APSInt &V) {
Steve Naroff5abb0282009-01-27 21:25:57 +0000106 return new (C) EnumConstantDecl(CD, L, Id, T, E, V);
Chris Lattnere4650482008-03-15 06:12:44 +0000107}
108
Ted Kremenek5be49242008-05-20 04:49:55 +0000109void EnumConstantDecl::Destroy(ASTContext& C) {
110 if (Init) Init->Destroy(C);
111 Decl::Destroy(C);
112}
113
Chris Lattneref87a202008-04-22 18:39:57 +0000114TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
Chris Lattnereee57c02008-04-04 06:12:32 +0000115 SourceLocation L,
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000116 IdentifierInfo *Id, QualType T) {
Steve Naroff5abb0282009-01-27 21:25:57 +0000117 return new (C) TypedefDecl(DC, L, Id, T);
Chris Lattnere4650482008-03-15 06:12:44 +0000118}
119
Chris Lattneref87a202008-04-22 18:39:57 +0000120EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
Chris Lattnereee57c02008-04-04 06:12:32 +0000121 IdentifierInfo *Id,
Douglas Gregorae644892008-12-15 16:32:14 +0000122 EnumDecl *PrevDecl) {
Steve Naroff207b9ec2009-01-27 23:20:32 +0000123 EnumDecl *Enum = new (C) EnumDecl(DC, L, Id);
Douglas Gregorae644892008-12-15 16:32:14 +0000124 C.getTypeDeclType(Enum, PrevDecl);
125 return Enum;
Chris Lattnere4650482008-03-15 06:12:44 +0000126}
127
Ted Kremenek25d8be12008-09-02 20:13:32 +0000128void EnumDecl::Destroy(ASTContext& C) {
Ted Kremenek25d8be12008-09-02 20:13:32 +0000129 Decl::Destroy(C);
130}
131
Douglas Gregor8acb7272008-12-11 16:49:14 +0000132void EnumDecl::completeDefinition(ASTContext &C, QualType NewType) {
133 assert(!isDefinition() && "Cannot redefine enums!");
Douglas Gregor8acb7272008-12-11 16:49:14 +0000134 IntegerType = NewType;
Douglas Gregor98b27542009-01-17 00:42:38 +0000135 TagDecl::completeDefinition();
Douglas Gregor8acb7272008-12-11 16:49:14 +0000136}
137
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000138FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC,
Chris Lattnereee57c02008-04-04 06:12:32 +0000139 SourceLocation L,
Chris Lattner81db64a2008-03-16 00:16:02 +0000140 StringLiteral *Str) {
Steve Naroff5abb0282009-01-27 21:25:57 +0000141 return new (C) FileScopeAsmDecl(DC, L, Str);
Chris Lattner81db64a2008-03-16 00:16:02 +0000142}
143
Chris Lattnere4650482008-03-15 06:12:44 +0000144//===----------------------------------------------------------------------===//
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000145// NamedDecl Implementation
Argiris Kirtzidis881964b2008-11-09 23:41:00 +0000146//===----------------------------------------------------------------------===//
147
Douglas Gregor09be81b2009-02-04 17:27:36 +0000148std::string NamedDecl::getQualifiedNameAsString() const {
149 std::vector<std::string> Names;
150 std::string QualName;
151 const DeclContext *Ctx = getDeclContext();
152
153 if (Ctx->isFunctionOrMethod())
154 return getNameAsString();
155
156 while (Ctx) {
157 if (Ctx->isFunctionOrMethod())
158 // FIXME: That probably will happen, when D was member of local
159 // scope class/struct/union. How do we handle this case?
160 break;
161
162 if (const NamedDecl *ND = dyn_cast<NamedDecl>(Ctx))
163 Names.push_back(ND->getNameAsString());
164 else
165 break;
166
167 Ctx = Ctx->getParent();
168 }
169
170 std::vector<std::string>::reverse_iterator
171 I = Names.rbegin(),
172 End = Names.rend();
173
174 for (; I!=End; ++I)
175 QualName += *I + "::";
176
177 QualName += getNameAsString();
178
179 return QualName;
180}
181
182
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000183bool NamedDecl::declarationReplaces(NamedDecl *OldD) const {
Douglas Gregor6e71edc2008-12-23 21:05:05 +0000184 assert(getDeclName() == OldD->getDeclName() && "Declaration name mismatch");
185
Douglas Gregor7a7be652009-02-03 19:21:40 +0000186 // UsingDirectiveDecl's are not really NamedDecl's, and all have same name.
187 // We want to keep it, unless it nominates same namespace.
188 if (getKind() == Decl::UsingDirective) {
189 return cast<UsingDirectiveDecl>(this)->getNominatedNamespace() ==
190 cast<UsingDirectiveDecl>(OldD)->getNominatedNamespace();
191 }
192
Douglas Gregor6e71edc2008-12-23 21:05:05 +0000193 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(this))
194 // For function declarations, we keep track of redeclarations.
195 return FD->getPreviousDeclaration() == OldD;
196
197 // For non-function declarations, if the declarations are of the
198 // same kind then this must be a redeclaration, or semantic analysis
199 // would not have given us the new declaration.
200 return this->getKind() == OldD->getKind();
201}
202
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000203
Argiris Kirtzidis881964b2008-11-09 23:41:00 +0000204//===----------------------------------------------------------------------===//
Nuno Lopesc98406e2008-12-17 23:39:55 +0000205// VarDecl Implementation
206//===----------------------------------------------------------------------===//
207
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000208VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
209 IdentifierInfo *Id, QualType T, StorageClass S,
Nuno Lopesc98406e2008-12-17 23:39:55 +0000210 SourceLocation TypeSpecStartLoc) {
Steve Naroff5abb0282009-01-27 21:25:57 +0000211 return new (C) VarDecl(Var, DC, L, Id, T, S, TypeSpecStartLoc);
Nuno Lopesc98406e2008-12-17 23:39:55 +0000212}
213
214void VarDecl::Destroy(ASTContext& C) {
Sebastian Redl2ee55612009-02-05 15:12:41 +0000215 Expr *Init = getInit();
216 if (Init)
217 Init->Destroy(C);
Nuno Lopesc98406e2008-12-17 23:39:55 +0000218 this->~VarDecl();
Steve Naroff5abb0282009-01-27 21:25:57 +0000219 C.Deallocate((void *)this);
Nuno Lopesc98406e2008-12-17 23:39:55 +0000220}
221
222VarDecl::~VarDecl() {
Nuno Lopesc98406e2008-12-17 23:39:55 +0000223}
224
225//===----------------------------------------------------------------------===//
Chris Lattnerc72d22d2008-03-31 00:36:02 +0000226// FunctionDecl Implementation
227//===----------------------------------------------------------------------===//
228
Ted Kremenekafdf8112008-05-20 00:43:19 +0000229void FunctionDecl::Destroy(ASTContext& C) {
Ted Kremenek345b93d2008-05-20 03:56:00 +0000230 if (Body)
231 Body->Destroy(C);
232
233 for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I)
234 (*I)->Destroy(C);
Nuno Lopescb8cc5b2009-01-18 19:57:27 +0000235
Steve Naroff5abb0282009-01-27 21:25:57 +0000236 C.Deallocate(ParamInfo);
Nuno Lopescb8cc5b2009-01-18 19:57:27 +0000237
Ted Kremenekafdf8112008-05-20 00:43:19 +0000238 Decl::Destroy(C);
239}
240
241
Douglas Gregor42214c52008-04-21 02:02:58 +0000242Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const {
243 for (const FunctionDecl *FD = this; FD != 0; FD = FD->PreviousDeclaration) {
244 if (FD->Body) {
245 Definition = FD;
246 return FD->Body;
247 }
248 }
249
250 return 0;
Chris Lattner4b009652007-07-25 00:24:17 +0000251}
252
Ted Kremeneka6ded352008-10-29 18:41:34 +0000253// Helper function for FunctionDecl::getNumParams and FunctionDecl::setParams()
254static unsigned getNumTypeParams(QualType T) {
255 const FunctionType *FT = T->getAsFunctionType();
Chris Lattnere8733592008-04-06 23:09:52 +0000256 if (isa<FunctionTypeNoProto>(FT))
Chris Lattnera8344c32008-03-15 05:43:15 +0000257 return 0;
Chris Lattnere8733592008-04-06 23:09:52 +0000258 return cast<FunctionTypeProto>(FT)->getNumArgs();
Chris Lattner4b009652007-07-25 00:24:17 +0000259}
260
Ted Kremeneka6ded352008-10-29 18:41:34 +0000261unsigned FunctionDecl::getNumParams() const {
262 // Can happen if a FunctionDecl is declared using typeof(some_other_func) bar;
263 if (!ParamInfo)
264 return 0;
265
266 return getNumTypeParams(getType());
267}
268
Ted Kremenek8494c962009-01-14 00:42:25 +0000269void FunctionDecl::setParams(ASTContext& C, ParmVarDecl **NewParamInfo,
270 unsigned NumParams) {
Chris Lattner4b009652007-07-25 00:24:17 +0000271 assert(ParamInfo == 0 && "Already has param info!");
Ted Kremeneka6ded352008-10-29 18:41:34 +0000272 assert(NumParams == getNumTypeParams(getType()) &&
273 "Parameter count mismatch!");
Chris Lattner4b009652007-07-25 00:24:17 +0000274
275 // Zero params -> null pointer.
276 if (NumParams) {
Steve Naroff207b9ec2009-01-27 23:20:32 +0000277 void *Mem = C.Allocate(sizeof(ParmVarDecl*)*NumParams);
Ted Kremenek8494c962009-01-14 00:42:25 +0000278 ParamInfo = new (Mem) ParmVarDecl*[NumParams];
Chris Lattner4b009652007-07-25 00:24:17 +0000279 memcpy(ParamInfo, NewParamInfo, sizeof(ParmVarDecl*)*NumParams);
280 }
281}
282
Chris Lattner97316c02008-04-10 02:22:51 +0000283/// getMinRequiredArguments - Returns the minimum number of arguments
284/// needed to call this function. This may be fewer than the number of
285/// function parameters, if some of the parameters have default
Chris Lattnerb1856db2008-04-12 23:52:44 +0000286/// arguments (in C++).
Chris Lattner97316c02008-04-10 02:22:51 +0000287unsigned FunctionDecl::getMinRequiredArguments() const {
288 unsigned NumRequiredArgs = getNumParams();
289 while (NumRequiredArgs > 0
290 && getParamDecl(NumRequiredArgs-1)->getDefaultArg())
291 --NumRequiredArgs;
292
293 return NumRequiredArgs;
294}
295
Douglas Gregore60e5d32008-11-06 22:13:31 +0000296/// getOverloadedOperator - Which C++ overloaded operator this
297/// function represents, if any.
298OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const {
Douglas Gregor96a32dd2008-11-18 14:39:36 +0000299 if (getDeclName().getNameKind() == DeclarationName::CXXOperatorName)
300 return getDeclName().getCXXOverloadedOperator();
Douglas Gregore60e5d32008-11-06 22:13:31 +0000301 else
302 return OO_None;
303}
304
Chris Lattnerc72d22d2008-03-31 00:36:02 +0000305//===----------------------------------------------------------------------===//
Douglas Gregor723d3332009-01-07 00:43:41 +0000306// TagDecl Implementation
Ted Kremenek46a837c2008-09-05 17:16:31 +0000307//===----------------------------------------------------------------------===//
308
Douglas Gregor98b27542009-01-17 00:42:38 +0000309void TagDecl::startDefinition() {
310 cast<TagType>(TypeForDecl)->decl.setPointer(this);
311 cast<TagType>(TypeForDecl)->decl.setInt(1);
312}
313
314void TagDecl::completeDefinition() {
315 assert((!TypeForDecl ||
316 cast<TagType>(TypeForDecl)->decl.getPointer() == this) &&
317 "Attempt to redefine a tag definition?");
318 IsDefinition = true;
319 cast<TagType>(TypeForDecl)->decl.setPointer(this);
320 cast<TagType>(TypeForDecl)->decl.setInt(0);
321}
322
Ted Kremenek46a837c2008-09-05 17:16:31 +0000323TagDecl* TagDecl::getDefinition(ASTContext& C) const {
324 QualType T = C.getTypeDeclType(const_cast<TagDecl*>(this));
325 TagDecl* D = cast<TagDecl>(cast<TagType>(T)->getDecl());
326 return D->isDefinition() ? D : 0;
327}
328
329//===----------------------------------------------------------------------===//
Chris Lattnerc72d22d2008-03-31 00:36:02 +0000330// RecordDecl Implementation
331//===----------------------------------------------------------------------===//
Chris Lattner4b009652007-07-25 00:24:17 +0000332
Argiris Kirtzidis2538a8c2008-10-15 00:42:39 +0000333RecordDecl::RecordDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L,
Ted Kremenek2c984042008-09-05 01:34:33 +0000334 IdentifierInfo *Id)
Douglas Gregoraf8ad2b2009-01-20 01:17:11 +0000335 : TagDecl(DK, TK, DC, L, Id) {
Ted Kremenek6f0a2412008-09-02 21:12:32 +0000336 HasFlexibleArrayMember = false;
Douglas Gregor723d3332009-01-07 00:43:41 +0000337 AnonymousStructOrUnion = false;
Ted Kremenek6f0a2412008-09-02 21:12:32 +0000338 assert(classof(static_cast<Decl*>(this)) && "Invalid Kind!");
Ted Kremenek6f0a2412008-09-02 21:12:32 +0000339}
340
341RecordDecl *RecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC,
Ted Kremenek46a837c2008-09-05 17:16:31 +0000342 SourceLocation L, IdentifierInfo *Id,
343 RecordDecl* PrevDecl) {
Ted Kremenek2c984042008-09-05 01:34:33 +0000344
Steve Naroff5abb0282009-01-27 21:25:57 +0000345 RecordDecl* R = new (C) RecordDecl(Record, TK, DC, L, Id);
Ted Kremenek46a837c2008-09-05 17:16:31 +0000346 C.getTypeDeclType(R, PrevDecl);
347 return R;
Ted Kremenek6f0a2412008-09-02 21:12:32 +0000348}
349
Argiris Kirtzidisd64c1112008-08-08 14:08:55 +0000350RecordDecl::~RecordDecl() {
Argiris Kirtzidisd64c1112008-08-08 14:08:55 +0000351}
352
353void RecordDecl::Destroy(ASTContext& C) {
Argiris Kirtzidisd64c1112008-08-08 14:08:55 +0000354 TagDecl::Destroy(C);
355}
356
Douglas Gregor8acb7272008-12-11 16:49:14 +0000357/// completeDefinition - Notes that the definition of this type is now
358/// complete.
359void RecordDecl::completeDefinition(ASTContext& C) {
Chris Lattner4b009652007-07-25 00:24:17 +0000360 assert(!isDefinition() && "Cannot redefine record!");
Douglas Gregor98b27542009-01-17 00:42:38 +0000361 TagDecl::completeDefinition();
Chris Lattner4b009652007-07-25 00:24:17 +0000362}
363
Steve Naroff9ac456d2008-10-08 17:01:13 +0000364//===----------------------------------------------------------------------===//
365// BlockDecl Implementation
366//===----------------------------------------------------------------------===//
367
368BlockDecl::~BlockDecl() {
369}
370
371void BlockDecl::Destroy(ASTContext& C) {
372 if (Body)
373 Body->Destroy(C);
374
375 for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I)
376 (*I)->Destroy(C);
377
378 Decl::Destroy(C);
379}