diff options
| author | Omair Javaid <omair.javaid@linaro.org> | 2016-02-24 12:17:43 +0000 |
|---|---|---|
| committer | Omair Javaid <omair.javaid@linaro.org> | 2016-02-24 12:17:43 +0000 |
| commit | 92a8dedaaa5d8948a1313db22c50a189b0fbe967 (patch) | |
| tree | 0adf9474c7981bc3f1a53d909288f0384c0f929d /lldb/source/Symbol/ClangASTContext.cpp | |
| parent | e1bb13d67aef637c180ef15193e59d653debad54 (diff) | |
| download | bcm5719-llvm-92a8dedaaa5d8948a1313db22c50a189b0fbe967.tar.gz bcm5719-llvm-92a8dedaaa5d8948a1313db22c50a189b0fbe967.zip | |
Fix test for homogeneity in case of aggregate consisting of containerized vector types
Details can be found here:
Differential revision: http://reviews.llvm.org/D17501
llvm-svn: 261734
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index f7c65b2379f..d59b39c3280 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -3100,9 +3100,11 @@ ClangASTContext::IsHomogeneousAggregate (lldb::opaque_compiler_type_t type, Comp bool is_hva = false; bool is_hfa = false; clang::QualType base_qual_type; + uint64_t base_bitwidth = 0; for (field_pos = record_decl->field_begin(); field_pos != field_end; ++field_pos) { clang::QualType field_qual_type = field_pos->getType(); + uint64_t field_bitwidth = getASTContext()->getTypeSize (qual_type); if (field_qual_type->isFloatingType()) { if (field_qual_type->isComplexType()) @@ -3123,22 +3125,21 @@ ClangASTContext::IsHomogeneousAggregate (lldb::opaque_compiler_type_t type, Comp } else if (field_qual_type->isVectorType() || field_qual_type->isExtVectorType()) { - const clang::VectorType *array = field_qual_type.getTypePtr()->getAs<clang::VectorType>(); - if (array && array->getNumElements() <= 4) + if (num_fields == 0) { - if (num_fields == 0) - base_qual_type = array->getElementType(); - else - { - if (is_hfa) - return 0; - is_hva = true; - if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr()) - return 0; - } + base_qual_type = field_qual_type; + base_bitwidth = field_bitwidth; } else - return 0; + { + if (is_hfa) + return 0; + is_hva = true; + if (base_bitwidth != field_bitwidth) + return 0; + if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr()) + return 0; + } } else return 0; |

