diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-30 22:58:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-30 22:58:21 +0000 |
commit | 7532dc66648cfe7432c9fe66dec5225f0ab301c6 (patch) | |
tree | daa4d64ecc29357f90c6a51341fecdf79eae2025 /lib/AST/TypeSerialization.cpp | |
parent | e31c0d206b872b056dc42c3af21b11d5de4edfd9 (diff) |
Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").
One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as
std::(vector<int>)
we represent it as
(std::vector)<int>
which more closely follows the C++ grammar.
Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypeSerialization.cpp')
-rw-r--r-- | lib/AST/TypeSerialization.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp index 4f0334f47a..0562416da0 100644 --- a/lib/AST/TypeSerialization.cpp +++ b/lib/AST/TypeSerialization.cpp @@ -391,29 +391,17 @@ Type* TemplateTypeParmType::CreateImpl(ASTContext& Context, Deserializer& D) { } //===----------------------------------------------------------------------===// -// ClassTemplateSpecializationType +// TemplateSpecializationType //===----------------------------------------------------------------------===// -void ClassTemplateSpecializationType::EmitImpl(Serializer& S) const { - S.Emit(getCanonicalTypeInternal()); - S.EmitPtr(Template); - S.EmitInt(NumArgs); - // FIXME: Serialize class template specialization types +void TemplateSpecializationType::EmitImpl(Serializer& S) const { + // FIXME: Serialization support } Type* -ClassTemplateSpecializationType:: +TemplateSpecializationType:: CreateImpl(ASTContext& Context, Deserializer& D) { - llvm::SmallVector<uintptr_t, 16> Args; - llvm::SmallVector<bool, 16> ArgIsType; - - QualType Canon = QualType::ReadVal(D); - TemplateDecl *Template = cast<TemplateDecl>(D.ReadPtr<Decl>()); - unsigned NumArgs = D.ReadInt(); - - // FIXME: De-serialize class template specialization types - (void)Template; - (void)NumArgs; + // FIXME: Deserialization support return 0; } |