Author: johannes Date: Mon Jan 21 19:29:51 2008 New Revision: 46236 URL: http://llvm.org/viewvc/llvm-project?rev=46236&view=rev Log: Back out one of previous changes for Obj-C++; it handles the issue differently in the C++ FE code. Fix another type/initializer mismatch in INSTANCE_VARIABLES.
Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=46236&r1=46235&r2=46236&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Jan 21 19:29:51 2008 @@ -10456,6 +10456,8 @@ { tree initlist = NULL_TREE; int val; + /* LLVM LOCAL make sizes add up right */ + int skipped = 0; do { tree ivar = NULL_TREE; @@ -10463,8 +10465,12 @@ /* Unnamed bitfields are ignored. */ if (!DECL_NAME (field_decl)) { - do + /* LLVM LOCAL begin make sizes add up right */ + do { field_decl = TREE_CHAIN (field_decl); + skipped++; + } + /* LLVM LOCAL end */ while (field_decl && TREE_CODE (field_decl) != FIELD_DECL); continue; } @@ -10522,6 +10528,26 @@ } while (field_decl); +#ifndef OBJCPLUS + /* LLVM LOCAL begin make sizes add up right. The size in 'type' counted + any unnamed bitfields that we skipped above; add null nodes at the + end of the list to compensate. */ + while (skipped--) + { + tree ivar = NULL_TREE; + ivar = tree_cons (NULL_TREE, build_int_cst (ptr_type_node, 0), ivar); + ivar = tree_cons (NULL_TREE, build_int_cst (string_type_node, 0), ivar); + ivar = tree_cons (NULL_TREE, build_int_cst (string_type_node, 0), ivar); + ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), ivar); + ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), ivar); + + initlist = tree_cons (NULL_TREE, + objc_build_constructor (type, nreverse(ivar)), + initlist); + } + /* LLVM LOCAL end */ +#endif + return objc_build_constructor (build_array_type (type, 0), nreverse (initlist)); } @@ -10841,9 +10867,13 @@ /* LLVM LOCAL begin make initializer size match type size */ /* APPLE LOCAL ObjC new abi */ - initlist = build_tree_list (NULL_TREE, build_int_cst (newabi - ? NULL_TREE - : ptr_type_node, + initlist = build_tree_list (NULL_TREE, build_int_cst ( +#ifdef OBJCPLUS + NULL_TREE, +#else + newabi ? NULL_TREE : ptr_type_node, +#endif + init_val)); /* LLVM LOCAL end */ initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, size), initlist); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits