diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2010-11-16 00:32:26 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2010-11-16 00:32:26 +0000 |
| commit | 77ad2c4164f55a0ad24d203a8a8dbf4db2406ef5 (patch) | |
| tree | eeca166eade7c686f5491f51e48f782daa95cd69 /clang/lib | |
| parent | 118baf76115b3ab677e1fb374ce70fdf87a8a8b4 (diff) | |
| download | bcm5719-llvm-77ad2c4164f55a0ad24d203a8a8dbf4db2406ef5.tar.gz bcm5719-llvm-77ad2c4164f55a0ad24d203a8a8dbf4db2406ef5.zip | |
Update TypePrinter::PrintVector to handle new Neon vector types.
llvm-svn: 119302
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index b405db4bced..5dfad6c9005 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -251,15 +251,29 @@ void TypePrinter::PrintDependentSizedExtVector( } void TypePrinter::PrintVector(const VectorType *T, std::string &S) { - if (T->getVectorKind() != VectorType::GenericVector) { - if (T->getVectorKind() == VectorType::AltiVecPixel) - S = "__vector __pixel " + S; - else { - Print(T->getElementType(), S); - S = ((T->getVectorKind() == VectorType::AltiVecBool) - ? "__vector __bool " : "__vector ") + S; - } - } else { + switch (T->getVectorKind()) { + case VectorType::AltiVecPixel: + S = "__vector __pixel " + S; + break; + case VectorType::AltiVecBool: + Print(T->getElementType(), S); + S = "__vector __bool " + S; + break; + case VectorType::AltiVecVector: + Print(T->getElementType(), S); + S = "__vector " + S; + break; + case VectorType::NeonVector: + Print(T->getElementType(), S); + S = ("__attribute__((neon_vector_type(" + + llvm::utostr_32(T->getNumElements()) + "))) " + S); + break; + case VectorType::NeonPolyVector: + Print(T->getElementType(), S); + S = ("__attribute__((neon_polyvector_type(" + + llvm::utostr_32(T->getNumElements()) + "))) " + S); + break; + case VectorType::GenericVector: { // FIXME: We prefer to print the size directly here, but have no way // to get the size of the type. Print(T->getElementType(), S); @@ -269,6 +283,8 @@ void TypePrinter::PrintVector(const VectorType *T, std::string &S) { Print(T->getElementType(), ET); V += " * sizeof(" + ET + ")))) "; S = V + S; + break; + } } } |

