diff options
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/DeclBase.cpp | 1 | ||||
-rw-r--r-- | lib/AST/DeclCXX.cpp | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 686aba2460..3c6c91ea0a 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -237,6 +237,7 @@ void Decl::addDeclKind(Kind k) { case CXXRecord: nCXXSUC++; break; // FIXME: Statistics for C++ decls. case CXXMethod: + case CXXConstructor: case CXXClassVar: break; } diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 0d0b746ad6..3ec6824566 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -39,6 +39,14 @@ CXXRecordDecl::~CXXRecordDecl() { delete [] Bases; } +void CXXRecordDecl::Destroy(ASTContext &C) { + for (OverloadedFunctionDecl::function_iterator func + = Constructors.function_begin(); + func != Constructors.function_end(); ++func) + (*func)->Destroy(C); + RecordDecl::Destroy(C); +} + void CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases, unsigned NumBases) { @@ -74,6 +82,17 @@ QualType CXXMethodDecl::getThisType(ASTContext &C) const { return C.getPointerType(ClassTy).withConst(); } +CXXConstructorDecl * +CXXConstructorDecl::Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, IdentifierInfo *Id, + QualType T, bool isExplicit, + bool isInline, bool isImplicitlyDeclared) { + void *Mem = C.getAllocator().Allocate<CXXConstructorDecl>(); + return new (Mem) CXXConstructorDecl(RD, L, Id, T, isExplicit, isInline, + isImplicitlyDeclared); +} + + CXXClassVarDecl *CXXClassVarDecl::Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, IdentifierInfo *Id, QualType T, ScopedDecl *PrevDecl) { |