diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-01 00:28:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-01 00:28:59 +0000 |
commit | dce2b62b70063f041bbfa179bb1e26e1fbc9a2dc (patch) | |
tree | d73c467e43256efc1376bf33c7189a2e5eb89e3c /clang/lib/AST/NestedNameSpecifier.cpp | |
parent | 5c9c118600667501aa7ae643a3f78c287c330004 (diff) | |
download | bcm5719-llvm-dce2b62b70063f041bbfa179bb1e26e1fbc9a2dc.tar.gz bcm5719-llvm-dce2b62b70063f041bbfa179bb1e26e1fbc9a2dc.zip |
Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,
typename MetaFun::template apply<T1, T2>
Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,
typename T::type::type
llvm-svn: 68166
Diffstat (limited to 'clang/lib/AST/NestedNameSpecifier.cpp')
-rw-r--r-- | clang/lib/AST/NestedNameSpecifier.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/clang/lib/AST/NestedNameSpecifier.cpp b/clang/lib/AST/NestedNameSpecifier.cpp index 2db8c763431..c94a4da7b61 100644 --- a/clang/lib/AST/NestedNameSpecifier.cpp +++ b/clang/lib/AST/NestedNameSpecifier.cpp @@ -30,7 +30,7 @@ NestedNameSpecifier::FindOrInsert(ASTContext &Context, NestedNameSpecifier *NNS = Context.NestedNameSpecifiers.FindNodeOrInsertPos(ID, InsertPos); if (!NNS) { - NNS = new (Context) NestedNameSpecifier(Mockup); + NNS = new (Context, 4) NestedNameSpecifier(Mockup); Context.NestedNameSpecifiers.InsertNode(NNS, InsertPos); } @@ -44,9 +44,9 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, assert(Prefix && Prefix->isDependent() && "Prefix must be dependent"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(II); - Mockup.Specifier.setInt(Identifier); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Identifier); + Mockup.Specifier = II; return FindOrInsert(Context, Mockup); } @@ -58,9 +58,9 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, (Prefix->getAsType() == 0 && Prefix->getAsIdentifier() == 0)) && "Broken nested name specifier"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(NS); - Mockup.Specifier.setInt(Namespace); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Namespace); + Mockup.Specifier = NS; return FindOrInsert(Context, Mockup); } @@ -69,15 +69,15 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, bool Template, Type *T) { assert(T && "Type cannot be NULL"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(T); - Mockup.Specifier.setInt(Template? TypeSpecWithTemplate : TypeSpec); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Template? TypeSpecWithTemplate : TypeSpec); + Mockup.Specifier = T; return FindOrInsert(Context, Mockup); } NestedNameSpecifier *NestedNameSpecifier::GlobalSpecifier(ASTContext &Context) { if (!Context.GlobalNestedNameSpecifier) - Context.GlobalNestedNameSpecifier = new (Context) NestedNameSpecifier(); + Context.GlobalNestedNameSpecifier = new (Context, 4) NestedNameSpecifier(); return Context.GlobalNestedNameSpecifier; } @@ -105,8 +105,8 @@ bool NestedNameSpecifier::isDependent() const { /// \brief Print this nested name specifier to the given output /// stream. void NestedNameSpecifier::print(llvm::raw_ostream &OS) const { - if (Prefix) - Prefix->print(OS); + if (getPrefix()) + getPrefix()->print(OS); switch (getKind()) { case Identifier: |