Author: johannes Date: Thu Dec 20 16:52:10 2007 New Revision: 45270 URL: http://llvm.org/viewvc/llvm-project?rev=45270&view=rev Log: Assume unsized types do not have the same size in gcc and llvm.
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=45270&r1=45269&r2=45270&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Thu Dec 20 16:52:10 2007 @@ -295,7 +295,7 @@ /// isSequentialCompatible - Return true if the specified gcc array or pointer /// type and the corresponding LLVM SequentialType lay out their components -/// identically in memory. +/// identically in memory. We assume that objects without a known size do not. bool isSequentialCompatible(tree_node *type) { assert((TREE_CODE(type) == ARRAY_TYPE || TREE_CODE(type) == POINTER_TYPE || @@ -303,7 +303,7 @@ // This relies on gcc types with constant size mapping to LLVM types with the // same size. It is possible for the component type not to have a size: // struct foo; extern foo bar[]; - return !TYPE_SIZE(TREE_TYPE(type)) || + return TYPE_SIZE(TREE_TYPE(type)) && isInt64(TYPE_SIZE(TREE_TYPE(type)), true); } _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits