diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-11 22:27:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-11 22:27:50 +0000 |
commit | a31472def0d7c5e7a41d051428c60c22ad8b182c (patch) | |
tree | 9ae38d084bf5c1c05023fba8364eb0462bd68af2 /clang/lib/AST/DeclCXX.cpp | |
parent | bbaeca4fef72dc7bea6f0d78fd5e29f6df0b2fdc (diff) | |
download | bcm5719-llvm-a31472def0d7c5e7a41d051428c60c22ad8b182c.tar.gz bcm5719-llvm-a31472def0d7c5e7a41d051428c60c22ad8b182c.zip |
No need to build the visible conversionfunction list for root class.
llvm-svn: 81583
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index e878a3df280..2149005cde5 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -288,11 +288,16 @@ void CXXRecordDecl::addedAssignmentOperator(ASTContext &Context, OverloadedFunctionDecl * CXXRecordDecl::getVisibleConversionFunctions(ASTContext &Context, CXXRecordDecl *RD) { - // If visible conversion list is already evaluated, return it. - if (RD == this && - VisibleConversions.function_begin() != VisibleConversions.function_end()) - return &VisibleConversions; - + if (RD == this) { + // If root class, all conversions are visible. + if (RD->bases_begin() == RD->bases_end()) + return &Conversions; + // If visible conversion list is already evaluated, return it. + if (VisibleConversions.function_begin() + != VisibleConversions.function_end()) + return &VisibleConversions; + } + QualType ClassType = Context.getTypeDeclType(this); if (const RecordType *Record = ClassType->getAs<RecordType>()) { OverloadedFunctionDecl *Conversions |