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/AST/Type.cpp | |
| parent | 5bf17cd277db2a253f6012968471064c4f4537a3 (diff) | |
| download | clang-ab452ba8323d1985e08bade2bced588cddf2cc28.tar.gz clang-ab452ba8323d1985e08bade2bced588cddf2cc28.tar.bz2 clang-ab452ba8323d1985e08bade2bced588cddf2cc28.tar.xz | |
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/AST/Type.cpp')
| -rw-r--r-- | lib/AST/Type.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 19a3f14423..103c0a9134 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1047,28 +1047,6 @@ ClassTemplateSpecializationType::Profile(llvm::FoldingSetNodeID &ID, Args[Idx].Profile(ID); } -QualifiedNameType::QualifiedNameType(const NestedNameSpecifier *Components, - unsigned NumComponents, - QualType NamedType, - QualType CanonType) - : Type(QualifiedName, CanonType, NamedType->isDependentType()), - NumComponents(NumComponents), NamedType(NamedType) { - NestedNameSpecifier *InitComponents - = reinterpret_cast<NestedNameSpecifier *>(this + 1); - for (unsigned I = 0; I < NumComponents; ++I) - new (InitComponents + I) NestedNameSpecifier(Components[I]); -} - -void QualifiedNameType::Profile(llvm::FoldingSetNodeID &ID, - const NestedNameSpecifier *Components, - unsigned NumComponents, - QualType NamedType) { - ID.AddInteger(NumComponents); - for (unsigned I = 0; I < NumComponents; ++I) - ID.AddPointer(Components[I].getAsOpaquePtr()); - NamedType.Profile(ID); -} - //===----------------------------------------------------------------------===// // Type Printing //===----------------------------------------------------------------------===// @@ -1440,7 +1418,7 @@ void QualifiedNameType::getAsStringInternal(std::string &InnerString) const { { llvm::raw_string_ostream OS(MyString); - NestedNameSpecifier::Print(OS, begin(), end()); + NNS->Print(OS); } std::string TypeStr; |
