diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-26 23:50:42 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-26 23:50:42 +0000 |
commit | ab452ba8323d1985e08bade2bced588cddf2cc28 (patch) | |
tree | 5434985218412826cd26ffd2f8d87857109eb50b /lib/Sema/SemaDeclCXX.cpp | |
parent | 5bf17cd277db2a253f6012968471064c4f4537a3 (diff) |
Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".
This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index cb44cfc186..bb306e4a0f 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1159,9 +1159,13 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /// Method declaration as if we had just parsed the qualified method /// name. However, it should not bring the parameters into scope; /// that will be performed by ActOnDelayedCXXMethodParameter. -void Sema::ActOnStartDelayedCXXMethodDeclaration(Scope *S, DeclTy *Method) { +void Sema::ActOnStartDelayedCXXMethodDeclaration(Scope *S, DeclTy *MethodD) { CXXScopeSpec SS; - SS.setScopeRep(((FunctionDecl*)Method)->getDeclContext()); + FunctionDecl *Method = (FunctionDecl*)MethodD; + QualType ClassTy + = Context.getTypeDeclType(cast<RecordDecl>(Method->getDeclContext())); + SS.setScopeRep( + NestedNameSpecifier::Create(Context, 0, false, ClassTy.getTypePtr())); ActOnCXXEnterDeclaratorScope(S, SS); } @@ -1192,7 +1196,10 @@ void Sema::ActOnDelayedCXXMethodParameter(Scope *S, DeclTy *ParamD) { void Sema::ActOnFinishDelayedCXXMethodDeclaration(Scope *S, DeclTy *MethodD) { FunctionDecl *Method = (FunctionDecl*)MethodD; CXXScopeSpec SS; - SS.setScopeRep(Method->getDeclContext()); + QualType ClassTy + = Context.getTypeDeclType(cast<RecordDecl>(Method->getDeclContext())); + SS.setScopeRep( + NestedNameSpecifier::Create(Context, 0, false, ClassTy.getTypePtr())); ActOnCXXExitDeclaratorScope(S, SS); // Now that we have our default arguments, check the constructor |