[cfe-commits] r83552 - /cfe/trunk/lib/AST/DeclCXX.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Oct 8 09:33:37 PDT 2009
Author: fjahanian
Date: Thu Oct 8 11:33:37 2009
New Revision: 83552
URL: http://llvm.org/viewvc/llvm-project?rev=83552&view=rev
Log:
Refactoring to further simplify collection of visible conversion
functions.
Modified:
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=83552&r1=83551&r2=83552&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Thu Oct 8 11:33:37 2009
@@ -357,21 +357,21 @@
}
}
+ if (getNumBases() == 0 && getNumVBases() == 0)
+ return;
+
+ llvm::SmallPtrSet<QualType, 8> ConversionFunctions;
+ if (!inTopClass)
+ collectConversionFunctions(ConversionFunctions);
+
for (CXXRecordDecl::base_class_iterator VBase = vbases_begin(),
E = vbases_end(); VBase != E; ++VBase) {
CXXRecordDecl *VBaseClassDecl
= cast<CXXRecordDecl>(VBase->getType()->getAs<RecordType>()->getDecl());
- if (inTopClass)
- VBaseClassDecl->getNestedVisibleConversionFunctions(RD,
- TopConversionsTypeSet,
- TopConversionsTypeSet);
- else {
- llvm::SmallPtrSet<QualType, 8> HiddenConversionTypes;
- collectConversionFunctions(HiddenConversionTypes);
- VBaseClassDecl->getNestedVisibleConversionFunctions(RD,
- TopConversionsTypeSet,
- HiddenConversionTypes);
- }
+ VBaseClassDecl->getNestedVisibleConversionFunctions(RD,
+ TopConversionsTypeSet,
+ (inTopClass ? TopConversionsTypeSet : ConversionFunctions));
+
}
for (CXXRecordDecl::base_class_iterator Base = bases_begin(),
E = bases_end(); Base != E; ++Base) {
@@ -379,17 +379,11 @@
continue;
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- if (inTopClass)
- BaseClassDecl->getNestedVisibleConversionFunctions(RD,
- TopConversionsTypeSet,
- TopConversionsTypeSet);
- else {
- llvm::SmallPtrSet<QualType, 8> HiddenConversionTypes;
- collectConversionFunctions(HiddenConversionTypes);
- BaseClassDecl->getNestedVisibleConversionFunctions(RD,
- TopConversionsTypeSet,
- HiddenConversionTypes);
- }
+
+ BaseClassDecl->getNestedVisibleConversionFunctions(RD,
+ TopConversionsTypeSet,
+ (inTopClass ? TopConversionsTypeSet : ConversionFunctions));
+
}
}
More information about the cfe-commits
mailing list