File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -157,18 +157,25 @@ Type* llvm_type2alive(const llvm::Type *ty) {
157157 auto layout = DL->getStructLayout (const_cast <llvm::StructType *>(strty));
158158 for (unsigned i = 0 ; i < strty->getNumElements (); ++i) {
159159 auto e = strty->getElementType (i);
160- unsigned ofs = layout->getElementOffset (i);
161- unsigned sz = DL->getTypeStoreSize (e);
160+ auto ofs = layout->getElementOffset (i);
161+ auto sz = DL->getTypeStoreSize (e);
162+
163+ // TODO: support vscale
164+ if (ofs.isScalable () || sz.isScalable ())
165+ return nullptr ;
162166
163167 if (auto ty = llvm_type2alive (e)) {
164168 elems.push_back (ty);
165169 is_padding.push_back (false );
166170 } else
167171 return nullptr ;
168172
169- unsigned ofs_next = i + 1 == strty->getNumElements () ?
173+ auto ofs_next = i + 1 == strty->getNumElements () ?
170174 DL->getTypeAllocSize (const_cast <llvm::StructType *>(strty)) :
171175 layout->getElementOffset (i + 1 );
176+ // TODO: support vscale
177+ if (ofs_next.isScalable ())
178+ return nullptr ;
172179 assert (ofs + sz <= ofs_next);
173180
174181 if (ofs_next != ofs + sz) {
You can’t perform that action at this time.
0 commit comments