[C++11] Removing the found_decls_begin() and found_decls_end() APIs and replacing with a range-only found_decls() API.

llvm-svn: 203975
This commit is contained in:
Aaron Ballman 2014-03-14 21:38:48 +00:00
parent 7e34fbdaa0
commit e6f465e51f
3 changed files with 7 additions and 12 deletions

View File

@ -190,8 +190,8 @@ public:
CXXBasePath& front() { return Paths.front(); }
const CXXBasePath& front() const { return Paths.front(); }
decl_iterator found_decls_begin();
decl_iterator found_decls_end();
typedef llvm::iterator_range<decl_iterator> decl_range;
decl_range found_decls();
/// \brief Determine whether the path from the most-derived type to the
/// given base type is ambiguous (i.e., it refers to multiple subobjects of

View File

@ -35,16 +35,12 @@ void CXXBasePaths::ComputeDeclsFound() {
std::copy(Decls.begin(), Decls.end(), DeclsFound);
}
CXXBasePaths::decl_iterator CXXBasePaths::found_decls_begin() {
CXXBasePaths::decl_range CXXBasePaths::found_decls() {
if (NumDeclsFound == 0)
ComputeDeclsFound();
return DeclsFound;
}
CXXBasePaths::decl_iterator CXXBasePaths::found_decls_end() {
if (NumDeclsFound == 0)
ComputeDeclsFound();
return DeclsFound + NumDeclsFound;
return decl_range(decl_iterator(DeclsFound),
decl_iterator(DeclsFound + NumDeclsFound));
}
/// isAmbiguous - Determines whether the set of paths provided is

View File

@ -5941,9 +5941,8 @@ bool Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) {
bool hasNonDeletedOverridenMethods = false;
bool AddedAny = false;
if (DC->lookupInBases(&FindOverriddenMethod, &Data, Paths)) {
for (CXXBasePaths::decl_iterator I = Paths.found_decls_begin(),
E = Paths.found_decls_end(); I != E; ++I) {
if (CXXMethodDecl *OldMD = dyn_cast<CXXMethodDecl>(*I)) {
for (auto *I : Paths.found_decls()) {
if (CXXMethodDecl *OldMD = dyn_cast<CXXMethodDecl>(I)) {
MD->addOverriddenMethod(OldMD->getCanonicalDecl());
if (!CheckOverridingFunctionReturnType(MD, OldMD) &&
!CheckOverridingFunctionAttributes(MD, OldMD) &&