On Dec 18, 2007, at 11:12 PM, Duncan Sands wrote:

> PS:
>
>>           TREE_CODE(type) == POINTER_TYPE ||
>>           TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential  
>> type!");
>>   // This relies on gcc types with constant size mapping to LLVM  
>> types with the
>> -  // same size.
>> -  return !VOID_TYPE_P(TREE_TYPE(type)) &&  
>> isInt64(TYPE_SIZE(TREE_TYPE(type)), true);
>> +  // same size.  It is possible for the component type not to have  
>> a size:
>> +  // struct foo;  extern foo bar[];
>> +  return !VOID_TYPE_P(TREE_TYPE(type)) &&
>> +         (!TYPE_SIZE(TREE_TYPE(type)) ||
>> +            isInt64(TYPE_SIZE(TREE_TYPE(type)), true));
>> }
>
> does the !TYPE_SIZE test also catch !VOID_TYPE_P case?

Yes, it seems TYPE_SIZE(void) is currently null.  It would be equally  
logical to represent it as size 0,
but I guess the code would still work in that case.


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to