No need to build the visible conversionfunction list for root class.

llvm-svn: 81583
This commit is contained in:
Fariborz Jahanian 2009-09-11 22:27:50 +00:00
parent bbaeca4fef
commit a31472def0
1 changed files with 10 additions and 5 deletions

View File

@ -288,10 +288,15 @@ void CXXRecordDecl::addedAssignmentOperator(ASTContext &Context,
OverloadedFunctionDecl *
CXXRecordDecl::getVisibleConversionFunctions(ASTContext &Context,
CXXRecordDecl *RD) {
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 (RD == this &&
VisibleConversions.function_begin() != VisibleConversions.function_end())
if (VisibleConversions.function_begin()
!= VisibleConversions.function_end())
return &VisibleConversions;
}
QualType ClassType = Context.getTypeDeclType(this);
if (const RecordType *Record = ClassType->getAs<RecordType>()) {