aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.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
commitab452ba8323d1985e08bade2bced588cddf2cc28 (patch)
tree5434985218412826cd26ffd2f8d87857109eb50b /lib/Sema/SemaType.cpp
parent5bf17cd277db2a253f6012968471064c4f4537a3 (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/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 4b2565795a..0780ad8f4a 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1101,9 +1101,7 @@ QualType Sema::getQualifiedNameType(const CXXScopeSpec &SS, QualType T) {
if (!SS.isSet() || SS.isInvalid() || T.isNull())
return T;
- llvm::SmallVector<NestedNameSpecifier, 4> Specs;
- for (CXXScopeSpec::iterator Spec = SS.begin(), SpecEnd = SS.end();
- Spec != SpecEnd; ++Spec)
- Specs.push_back(NestedNameSpecifier::getFromOpaquePtr(*Spec));
- return Context.getQualifiedNameType(&Specs[0], Specs.size(), T);
+ NestedNameSpecifier *NNS
+ = static_cast<NestedNameSpecifier *>(SS.getCurrentScopeRep());
+ return Context.getQualifiedNameType(NNS, T);
}