[llvm-commits] [llvm-gcc-4.2] r45757 - in /llvm-gcc-4.2/trunk/gcc: llvm-types.cpp tree.c tree.h

Duncan Sands duncan.sands at math.u-psud.fr
Wed Jan 9 12:43:26 PST 2008


Hi Dale, thanks for fixing this.

> +/// FixBaseClassFields - alter the types referred to by Field nodes that

Do you really have to modify the fields of the record?  Instead, you could
have a map in ConvertRECORD (possibly in StructTypeConversionInfo) that gives
the type to use for each field [currently you use the record as the map, stashing
the new type there] or just calculate the type in ConvertRECORD and pass the type
as an extra parameter to all subroutines or somesuch.

Alternatively, couldn't you just convert the original field type to LLVM then drop
fields off the end of the LLVM type if they go over the DECL_SIZE, or something
along those lines?

> +        TREE_INT_CST_LOW(DECL_SIZE(Field)) < 
> +              TREE_INT_CST_LOW(TYPE_SIZE(TREE_TYPE(Field))))

This probably kills Ada (testing now), since the size doesn't have to be
a constant in general (likewise in RestoreBaseClassFields).

Ciao,

Duncan.



More information about the llvm-commits mailing list