diff options
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/DeclBase.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index de7a1d3ca43..7e51ef50100 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -239,6 +239,7 @@ void Decl::addDeclKind(Kind k) { case CXXMethod: case CXXConstructor: case CXXDestructor: + case CXXConversion: case CXXClassVar: break; } diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index b0df75b404d..b2878b667aa 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -48,6 +48,11 @@ void CXXRecordDecl::Destroy(ASTContext &C) { if (isDefinition()) Destructor->Destroy(C); + for (OverloadedFunctionDecl::function_iterator func + = Conversions.function_begin(); + func != Conversions.function_end(); ++func) + (*func)->Destroy(C); + RecordDecl::Destroy(C); } @@ -101,6 +106,11 @@ CXXRecordDecl::addConstructor(ASTContext &Context, Constructors.addOverload(ConDecl); } +void CXXRecordDecl::addConversionFunction(ASTContext &Context, + CXXConversionDecl *ConvDecl) { + Conversions.addOverload(ConvDecl); +} + CXXMethodDecl * CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, IdentifierInfo *Id, @@ -232,6 +242,14 @@ CXXDestructorDecl::Create(ASTContext &C, CXXRecordDecl *RD, isImplicitlyDeclared); } +CXXConversionDecl * +CXXConversionDecl::Create(ASTContext &C, CXXRecordDecl *RD, + SourceLocation L, IdentifierInfo *Id, + QualType T, bool isInline, bool isExplicit) { + void *Mem = C.getAllocator().Allocate<CXXConversionDecl>(); + return new (Mem) CXXConversionDecl(RD, L, Id, T, isInline, isExplicit); +} + CXXClassVarDecl *CXXClassVarDecl::Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, IdentifierInfo *Id, QualType T, ScopedDecl *PrevDecl) { |

