diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-10-05 05:43:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-10-05 05:43:11 +0000 |
commit | 5620b50f8f81854b2a6fea16c69ff1853f8f4d9b (patch) | |
tree | 6c9a2c85ce5934065056793fe7493ab67a4bed29 /lib/AST/Type.cpp | |
parent | ec04b2622ab31655a7e06033f2b05384bf43688f (diff) |
Make VectorType printing less broken.
- Print size as number of elements times "sizeof(elt type)", not
perfect but better than just printing the completely wrong type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index e35525df9c..74e52fef88 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -921,11 +921,11 @@ void VariableArrayType::getAsStringInternal(std::string &S) const { } void VectorType::getAsStringInternal(std::string &S) const { + // FIXME: We prefer to print the size directly here, but have no way + // to get the size of the type. S += " __attribute__((__vector_size__("; - // FIXME: should multiply by element size somehow. - S += llvm::utostr_32(NumElements*4); // convert back to bytes. - S += ")))"; - ElementType.getAsStringInternal(S); + S += llvm::utostr_32(NumElements); // convert back to bytes. + S += " * sizeof(" + ElementType.getAsString() + "))))"; } void ExtVectorType::getAsStringInternal(std::string &S) const { |