diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-05 23:32:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-05 23:32:09 +0000 |
commit | 898574e7496ba8fd76290079d3a9d06954992734 (patch) | |
tree | 04ec2f50ad0055a77697cb55574a4e675cf30ef8 /lib/AST/TypeSerialization.cpp | |
parent | 9482a4f0feca4bc9eb7c6ad36e21cbf7365f5359 (diff) |
Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.
This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypeSerialization.cpp')
-rw-r--r-- | lib/AST/TypeSerialization.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp index 3bdc946de7..8e35f187a3 100644 --- a/lib/AST/TypeSerialization.cpp +++ b/lib/AST/TypeSerialization.cpp @@ -315,6 +315,26 @@ Type* VariableArrayType::CreateImpl(ASTContext& Context, Deserializer& D) { } //===----------------------------------------------------------------------===// +// DependentSizedArrayType +//===----------------------------------------------------------------------===// + +void DependentSizedArrayType::EmitImpl(Serializer& S) const { + S.Emit(getElementType()); + S.EmitInt(getSizeModifier()); + S.EmitInt(getIndexTypeQualifier()); + S.EmitOwnedPtr(SizeExpr); +} + +Type* DependentSizedArrayType::CreateImpl(ASTContext& Context, Deserializer& D) { + QualType ElTy = QualType::ReadVal(D); + ArraySizeModifier am = static_cast<ArraySizeModifier>(D.ReadInt()); + unsigned ITQ = D.ReadInt(); + Expr* SizeExpr = D.ReadOwnedPtr<Expr>(Context); + + return Context.getDependentSizedArrayType(ElTy,SizeExpr,am,ITQ).getTypePtr(); +} + +//===----------------------------------------------------------------------===// // IncompleteArrayType //===----------------------------------------------------------------------===// |