diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-17 21:51:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-17 21:51:59 +0000 |
commit | 9cdda0cf8528e3d595be9bfa002f0450074beb4d (patch) | |
tree | 5ffc959c4c5f38e164c9be332cd27388ee0a86b6 /lib/AST/Type.cpp | |
parent | 69e07a75ef2815961929f34675b7c806a9cc37da (diff) |
Support dependent extended vector types and template instantiation
thereof. Patch by Anders Johnsen!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 40a997cebc..55a0952223 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -50,6 +50,13 @@ void DependentSizedArrayType::Destroy(ASTContext& C) { C.Deallocate(this); } +void DependentSizedExtVectorType::Destroy(ASTContext& C) { + if (SizeExpr) + SizeExpr->Destroy(C); + this->~DependentSizedExtVectorType(); + C.Deallocate(this); +} + /// getArrayElementTypeNoTypeQual - If this is an array type, return the /// element type of the array, potentially with type qualifiers missing. /// This method should never be used when type qualifiers are meaningful. @@ -1356,6 +1363,19 @@ void DependentSizedArrayType::getAsStringInternal(std::string &S, const Printing getElementType().getAsStringInternal(S, Policy); } +void DependentSizedExtVectorType::getAsStringInternal(std::string &S, const PrintingPolicy &Policy) const { + getElementType().getAsStringInternal(S, Policy); + + S += " __attribute__((ext_vector_ type("; + if (getSizeExpr()) { + std::string SStr; + llvm::raw_string_ostream s(SStr); + getSizeExpr()->printPretty(s, 0, Policy); + S += s.str(); + } + S += ")))"; +} + void VectorType::getAsStringInternal(std::string &S, const PrintingPolicy &Policy) const { // FIXME: We prefer to print the size directly here, but have no way // to get the size of the type. |