[llvm-commits] [llvm-gcc-4.2] r45181 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Dale Johannesen dalej at apple.com
Wed Dec 19 10:31:55 PST 2007


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.





More information about the llvm-commits mailing list