summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-26 23:50:42 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-26 23:50:42 +0000
commitf21eb49a0404949c481c671965149e9cbdbc376d (patch)
tree23fbe9fba1983929ee3ba4883042a907a695e3d5 /clang/lib/Sema/SemaDeclCXX.cpp
parentfe7c0492a066a2bb5e91ef1a6b2ed413678abbcd (diff)
downloadbcm5719-llvm-f21eb49a0404949c481c671965149e9cbdbc376d.tar.gz
bcm5719-llvm-f21eb49a0404949c481c671965149e9cbdbc376d.zip
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. llvm-svn: 67799
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index cb44cfc186a..bb306e4a0f1 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud