mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Not just arrays are unsized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -95,6 +95,7 @@ TargetData::~TargetData() {
|
|||||||
|
|
||||||
static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
|
static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
|
||||||
unsigned &Size, unsigned char &Alignment) {
|
unsigned &Size, unsigned char &Alignment) {
|
||||||
|
assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
|
||||||
switch (Ty->getPrimitiveID()) {
|
switch (Ty->getPrimitiveID()) {
|
||||||
case Type::VoidTyID:
|
case Type::VoidTyID:
|
||||||
case Type::BoolTyID:
|
case Type::BoolTyID:
|
||||||
@@ -114,7 +115,6 @@ static inline void getTypeInfo(const Type *Ty, const TargetData *TD,
|
|||||||
return;
|
return;
|
||||||
case Type::ArrayTyID: {
|
case Type::ArrayTyID: {
|
||||||
const ArrayType *ATy = (const ArrayType *)Ty;
|
const ArrayType *ATy = (const ArrayType *)Ty;
|
||||||
assert(ATy->isSized() && "Can't get TypeInfo of an unsized array!");
|
|
||||||
getTypeInfo(ATy->getElementType(), TD, Size, Alignment);
|
getTypeInfo(ATy->getElementType(), TD, Size, Alignment);
|
||||||
Size *= ATy->getNumElements();
|
Size *= ATy->getNumElements();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user