aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TypeSerialization.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-09 23:48:35 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-09 23:48:35 +0000
commit40808ce6ac04b102c3b56244a635d6b98eed6d97 (patch)
tree92301d6219bc011b5ef02707aa8251e30d3f0db0 /lib/AST/TypeSerialization.cpp
parente15b486ada22517bd976768cabf80213cef44347 (diff)
Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this: - Extend TemplateArgument to allow arbitrary expressions (an Expr*), and switch ClassTemplateSpecializationType to store TemplateArguments rather than it's own type-or-expression representation. - ClassTemplateSpecializationType can now store dependent types. In that case, the canonical type is another ClassTemplateSpecializationType (with default template arguments expanded) rather than a declaration (we don't build Decls for dependent types). - Split ActOnClassTemplateId into ActOnClassTemplateId (called from the parser) and CheckClassTemplateId (called from ActOnClassTemplateId and InstantiateType). They're smart enough to handle dependent types, now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypeSerialization.cpp')
-rw-r--r--lib/AST/TypeSerialization.cpp25
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp
index b7a8f1a366..1b9fed4866 100644
--- a/lib/AST/TypeSerialization.cpp
+++ b/lib/AST/TypeSerialization.cpp
@@ -390,13 +390,7 @@ void ClassTemplateSpecializationType::EmitImpl(Serializer& S) const {
S.Emit(getCanonicalTypeInternal());
S.EmitPtr(Template);
S.EmitInt(NumArgs);
- for (unsigned Arg = 0; Arg < NumArgs; ++Arg) {
- S.EmitBool(isArgType(Arg));
- if (isArgType(Arg))
- S.Emit(getArgAsType(Arg));
- else
- S.EmitOwnedPtr(getArgAsExpr(Arg));
- }
+ // FIXME: Serialize class template specialization types
}
Type*
@@ -409,19 +403,10 @@ CreateImpl(ASTContext& Context, Deserializer& D) {
TemplateDecl *Template = cast<TemplateDecl>(D.ReadPtr<Decl>());
unsigned NumArgs = D.ReadInt();
- for (unsigned Arg = 0; Arg < NumArgs; ++Arg) {
- bool IsType = D.ReadBool();
- ArgIsType.push_back(IsType);
- if (IsType)
- Args.push_back(
- reinterpret_cast<uintptr_t>(QualType::ReadVal(D).getAsOpaquePtr()));
- else
- Args.push_back(reinterpret_cast<uintptr_t>(D.ReadOwnedPtr<Expr>(Context)));
- }
-
- return Context.getClassTemplateSpecializationType(Template, NumArgs,
- &Args[0], &ArgIsType[0],
- Canon).getTypePtr();
+ // FIXME: De-serialize class template specialization types
+ (void)Template;
+ (void)NumArgs;
+ return 0;
}
//===----------------------------------------------------------------------===//