diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-06 17:59:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-06 17:59:45 +0000 |
commit | a8f32e0965ee19ecc53cd796e34268377a20357c (patch) | |
tree | 5fcfab02b127c4a6f93721a0260612245f443f0c /lib/Sema/SemaAccess.cpp | |
parent | b299d3516d4722ef527b1070bb87133427e621a3 (diff) |
Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAccess.cpp')
-rw-r--r-- | lib/Sema/SemaAccess.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index e1a7378061..21f83a560d 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/lib/Sema/SemaAccess.cpp @@ -11,9 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "SemaInherit.h" #include "Sema.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/CXXInheritance.h" +#include "clang/AST/DeclCXX.h" using namespace clang; /// SetMemberAccessSpecifier - Set the access specifier of a member. @@ -47,7 +48,7 @@ bool Sema::SetMemberAccessSpecifier(NamedDecl *MemberDecl, /// inaccessible. If @p NoPrivileges is true, special access rights (members /// and friends) are not considered. const CXXBaseSpecifier *Sema::FindInaccessibleBase( - QualType Derived, QualType Base, BasePaths &Paths, bool NoPrivileges) { + QualType Derived, QualType Base, CXXBasePaths &Paths, bool NoPrivileges) { Base = Context.getCanonicalType(Base).getUnqualifiedType(); assert(!Paths.isAmbiguous(Base) && "Can't check base class access if set of paths is ambiguous"); @@ -61,12 +62,12 @@ const CXXBaseSpecifier *Sema::FindInaccessibleBase( if (CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(getCurFunctionDecl())) CurrentClassDecl = MD->getParent(); - for (BasePaths::paths_iterator Path = Paths.begin(), PathsEnd = Paths.end(); + for (CXXBasePaths::paths_iterator Path = Paths.begin(), PathsEnd = Paths.end(); Path != PathsEnd; ++Path) { bool FoundInaccessibleBase = false; - for (BasePath::const_iterator Element = Path->begin(), + for (CXXBasePath::const_iterator Element = Path->begin(), ElementEnd = Path->end(); Element != ElementEnd; ++Element) { const CXXBaseSpecifier *Base = Element->Base; @@ -106,7 +107,7 @@ const CXXBaseSpecifier *Sema::FindInaccessibleBase( /// and report an error if it can't. [class.access.base] bool Sema::CheckBaseClassAccess(QualType Derived, QualType Base, unsigned InaccessibleBaseID, - BasePaths &Paths, SourceLocation AccessLoc, + CXXBasePaths &Paths, SourceLocation AccessLoc, DeclarationName Name) { if (!getLangOptions().AccessControl) |