From evan.cheng at apple.com Mon Nov 3 01:14:02 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 03 Nov 2008 07:14:02 -0000 Subject: [llvm-commits] [llvm] r58598 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200811030714.mA37E2Ke007716@zion.cs.uiuc.edu> Author: evancheng Date: Mon Nov 3 01:14:02 2008 New Revision: 58598 URL: http://llvm.org/viewvc/llvm-project?rev=58598&view=rev Log: Silence a compiler warning. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=58598&r1=58597&r2=58598&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Nov 3 01:14:02 2008 @@ -875,7 +875,7 @@ // Resolve the relocations to concrete pointers. for (unsigned i = 0, e = Relocations.size(); i != e; ++i) { MachineRelocation &MR = Relocations[i]; - void *ResultPtr; + void *ResultPtr = 0; if (!MR.letTargetResolve()) { if (MR.isString()) { ResultPtr = TheJIT->getPointerToNamedFunction(MR.getString()); From isanbard at gmail.com Mon Nov 3 01:33:16 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 03 Nov 2008 07:33:16 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58599 - in /llvm-gcc-4.2/trunk/gcc: attribs.c c-common.c c-common.h c-decl.c c-parser.c c-typeck.c config/darwin-c.c config/darwin-sections.def config/darwin.c config/darwin.h config/i386/i386.c coverage.c cp/call.c cp/decl.c cp/name-lookup.c cp/parser.c cp/tree.c cp/typeck.c dwarf2out.c function.c gimplify.c ipa-type-escape.c objc/objc-act.c stub-objc.c tree-inline.c tree.c tree.h varasm.c version.c Message-ID: <200811030733.mA37XH0c008494@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 01:33:15 2008 New Revision: 58599 URL: http://llvm.org/viewvc/llvm-project?rev=58599&view=rev Log: Many, many blocks updates. Sync with Apple GCC mainline. Modified: llvm-gcc-4.2/trunk/gcc/attribs.c llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/c-common.h llvm-gcc-4.2/trunk/gcc/c-decl.c llvm-gcc-4.2/trunk/gcc/c-parser.c llvm-gcc-4.2/trunk/gcc/c-typeck.c llvm-gcc-4.2/trunk/gcc/config/darwin-c.c llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def llvm-gcc-4.2/trunk/gcc/config/darwin.c llvm-gcc-4.2/trunk/gcc/config/darwin.h llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/coverage.c llvm-gcc-4.2/trunk/gcc/cp/call.c llvm-gcc-4.2/trunk/gcc/cp/decl.c llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c llvm-gcc-4.2/trunk/gcc/cp/parser.c llvm-gcc-4.2/trunk/gcc/cp/tree.c llvm-gcc-4.2/trunk/gcc/cp/typeck.c llvm-gcc-4.2/trunk/gcc/dwarf2out.c llvm-gcc-4.2/trunk/gcc/function.c llvm-gcc-4.2/trunk/gcc/gimplify.c llvm-gcc-4.2/trunk/gcc/ipa-type-escape.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/stub-objc.c llvm-gcc-4.2/trunk/gcc/tree-inline.c llvm-gcc-4.2/trunk/gcc/tree.c llvm-gcc-4.2/trunk/gcc/tree.h llvm-gcc-4.2/trunk/gcc/varasm.c llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/attribs.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/attribs.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/attribs.c (original) +++ llvm-gcc-4.2/trunk/gcc/attribs.c Mon Nov 3 01:33:15 2008 @@ -216,7 +216,8 @@ if (spec->function_type_required && TREE_CODE (*anode) != FUNCTION_TYPE && TREE_CODE (*anode) != METHOD_TYPE) { - if (TREE_CODE (*anode) == POINTER_TYPE + /* APPLE LOCAL radar 6246527 */ + if ((TREE_CODE (*anode) == POINTER_TYPE || TREE_CODE (*anode) == BLOCK_POINTER_TYPE) && (TREE_CODE (TREE_TYPE (*anode)) == FUNCTION_TYPE || TREE_CODE (TREE_TYPE (*anode)) == METHOD_TYPE)) { @@ -323,6 +324,14 @@ if (fn_ptr_tmp) { + /* APPLE LOCAL begin radar 6246527 */ + if (DECL_P (*node) && TREE_TYPE (*node) && + TREE_CODE (TREE_TYPE (*node)) == BLOCK_POINTER_TYPE) + /* Rebuild the block pointer type and put it in the + appropriate place. */ + fn_ptr_tmp = build_block_pointer_type (fn_ptr_tmp); + else + /* APPLE LOCAL end radar 6246527 */ /* Rebuild the function pointer type and put it in the appropriate place. */ fn_ptr_tmp = build_pointer_type (fn_ptr_tmp); Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Mon Nov 3 01:33:15 2008 @@ -201,11 +201,8 @@ tree saved_function_name_decls; */ - -/* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ -/* Move declaration of invoke_impl_ptr_type from c-typeck.c */ -tree invoke_impl_ptr_type; -/* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ +/* APPLE LOCAL radar 6300081 */ +tree generic_block_literal_struct_type = NULL; tree c_global_trees[CTI_MAX]; @@ -302,7 +299,8 @@ /* Warn about format/argument anomalies in calls to formatted I/O functions (*printf, *scanf, strftime, strfmon, etc.). */ -int warn_format; +/* APPLE LOCAL default to Wformat-security 5764921 */ +int warn_format = 1; /* Warn about using __null (as NULL in C++) as sentinel. For code compiled with GCC this doesn't matter as __null is guaranteed to have the right @@ -6130,7 +6128,7 @@ *no_add_attrs = true; if (!(*node) || TREE_CODE (*node) != VAR_DECL) { - warning (OPT_Wattributes, "byref attribute can be specified on variables only - ignored"); + warning (OPT_Wattributes, "__block attribute can be specified on variables only - ignored"); return NULL_TREE; } arg_ident = TREE_VALUE (args); @@ -6242,7 +6240,7 @@ } /* This routine builds call to: - _Block_byref_release(VAR_DECL.forwarding); + _Block_byref_release(VAR_DECL.__forwarding); and adds it to the statement list. */ tree @@ -6250,9 +6248,9 @@ { tree exp = var_decl, call_exp, func_params; tree type = TREE_TYPE (var_decl); - /* __byref variables imported into Blocks are not _Block_byref_released() + /* __block variables imported into Blocks are not _Block_byref_released() from within the Block statement itself; otherwise, each envokation of - the block causes a release. Make sure to release __byref variables declared + the block causes a release. Make sure to release __block variables declared and used locally in the block though. */ if (cur_block && (BLOCK_DECL_COPIED (var_decl) || BLOCK_DECL_BYREF (var_decl))) @@ -6266,7 +6264,7 @@ TREE_USED (var_decl) = 1; /* Declare: _Block_byref_release(void*) if not done already. */ - exp = build_component_ref (exp, get_identifier ("forwarding")); + exp = build_component_ref (exp, get_identifier ("__forwarding")); func_params = tree_cons (NULL_TREE, exp, NULL_TREE); call_exp = build_function_call (build_block_byref_release_decl (), func_params); return call_exp; @@ -9141,5 +9139,55 @@ warning (OPT_Wchar_subscripts, "array subscript has type %"); } +/* APPLE LOCAL begin radar 6246527 */ +/* This routine is called for a "format" attribute. It adds the number of + hidden argument ('1') to the format's 2nd and 3rd argument to compensate + for these two arguments. This is to make rest of the "format" attribute + processing done in the middle-end to work seemlessly. */ + +static void +block_delta_format_args (tree format) +{ + tree format_num_expr, first_arg_num_expr; + int val; + tree args = TREE_VALUE (format); + gcc_assert (TREE_CHAIN (args) && TREE_CHAIN (TREE_CHAIN (args))); + format_num_expr = TREE_VALUE (TREE_CHAIN (args)); + first_arg_num_expr = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))); + if (format_num_expr && TREE_CODE (format_num_expr) == INTEGER_CST) + { + val = TREE_INT_CST_LOW (format_num_expr); + TREE_VALUE (TREE_CHAIN (args)) = build_int_cst (NULL_TREE, val+1); + } + if (first_arg_num_expr && TREE_CODE (first_arg_num_expr) == INTEGER_CST) + { + val = TREE_INT_CST_LOW (first_arg_num_expr); + if (val != 0) + TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))) = + build_int_cst (NULL_TREE, val+1); + } +} + +/* This routine recognizes legal block attributes. In case of block's "format" + attribute, it calls block_delta_format_args to compensate for hidden + argument _self getting passed to block's helper function. */ +bool +any_recognized_block_attribute (tree attributes) +{ + tree chain; + bool res = false; + for (chain = attributes; chain; chain = TREE_CHAIN (chain)) + { + if (is_attribute_p ("format", TREE_PURPOSE (chain))) + { + block_delta_format_args (chain); + res = true; + } + else if (is_attribute_p ("sentinel", TREE_PURPOSE (chain))) + res = true; + } + return res; +} +/* APPLE LOCAL end radar 6246527 */ #include "gt-c-common.h" Modified: llvm-gcc-4.2/trunk/gcc/c-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.h Mon Nov 3 01:33:15 2008 @@ -978,9 +978,10 @@ extern tree objc_non_volatilized_type (tree); /* APPLE LOCAL radar 4697411 */ extern void objc_volatilize_component_ref (tree, tree); -extern bool objc_compare_types (tree, tree, int, tree); -/* APPLE LOCAL radar 4229905 */ -extern bool objc_have_common_type (tree, tree, int, tree); +/* APPLE LOCAL radar 6231433 */ +extern bool objc_compare_types (tree, tree, int, tree, const char *); +/* APPLE LOCAL radar 4229905 - radar 6231433 */ +extern bool objc_have_common_type (tree, tree, int, tree, const char *); /* APPLE LOCAL radar 4133425 */ extern bool objc_diagnose_private_ivar (tree); /* APPLE LOCAL radar 4507230 */ @@ -1127,7 +1128,9 @@ BLOCK_HAS_CXX_OBJ = (1 << 26), BLOCK_IS_GC = (1 << 27), /* APPLE LOCAL radar 5822844 */ - BLOCK_IS_GLOBAL = (1 << 28) + BLOCK_IS_GLOBAL = (1 << 28), + /* APPLE LOCAL radar 5847213 */ + BLOCK_HAS_DESCRIPTOR = (1 << 29) }; struct block_sema_info { @@ -1142,7 +1145,7 @@ /* APPLE LOCAL radar 5803600 */ tree block_byref_global_decl_list; tree block_original_ref_decl_list; - tree block_original_byref_decl_list; + /* APPLE LOCAL radar 5847213 - tree block_original_byref_decl_list is removed. */ tree block_body; bool hasPrototype; bool isVariadic; @@ -1169,17 +1172,12 @@ extern struct block_sema_info *cur_block; extern tree build_helper_func_decl (tree, tree); -extern bool building_block_byref_decl; -/* APPLE LOCAL - begin radar 6113240 */ -/* Move invoke_impl_ptr_type to tree.h */ -/* APPLE LOCAL - end radar 6113240 */ extern tree build_block_byref_decl (tree, tree, tree); extern tree build_block_ref_decl (tree, tree); extern tree begin_block (void); extern struct block_sema_info *finish_block (tree); extern bool in_imm_block (void); extern bool lookup_name_in_block (tree, tree*); -extern void build_block_internal_types (void); extern void push_to_top_level (void); extern void pop_from_top_level (void); extern void start_block_helper_function (tree func_decl); @@ -1199,17 +1197,17 @@ extern tree do_digest_init (tree, tree); extern tree cast_to_pointer_to_id (tree); /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ - +/* APPLE LOCAL begin radar 6237713 */ +extern bool any_recognized_block_attribute (tree); +/* APPLE LOCAL end radar 6237713 */ + +/* APPLE LOCAL begin radar 5847213 */ +extern tree build_block_descriptor_type (bool); +/* APPLE LOCAL end radar 5847213 */ /* APPLE LOCAL begin radar 6083129 - byref escapes */ -extern void gen_block_byref_release_exp (tree); extern tree build_block_byref_release_exp (tree); extern tree build_block_byref_release_decl (void); extern tree build_block_byref_assign_copy_decl (void); -extern void release_all_local_byrefs_at_return (void); -void diagnose_byref_var_in_current_scope (void); -extern void release_local_byrefs_at_break (void); -extern void in_bc_stmt_block (void); -extern void outof_bc_stmt_block (void); /* APPLE LOCAL end radar 6083129 - byref escapes */ /* APPLE LOCAL radar 6040305 - blocks */ Modified: llvm-gcc-4.2/trunk/gcc/c-decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-decl.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-decl.c Mon Nov 3 01:33:15 2008 @@ -326,14 +326,6 @@ tree blocks; tree blocks_last; - /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ - /* Non-zero if outermost block of a statement which can have a - break/continue stmt; such as while, switch, etc. This cannot be - a boolen field because the same scope can be used for a nested - while/for statement; as in, while(...) while (...). */ - unsigned int bc_stmt_body; - /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ - /* The depth of this scope. Used to keep the ->shadowed chain of bindings sorted innermost to outermost. */ unsigned int depth : 28; @@ -359,12 +351,6 @@ /* True means make a BLOCK for this scope no matter what. */ BOOL_BITFIELD keep : 1; - - /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ - /* When true, current scope has at least one local __byref variable - in its scope. This flag is used for compile-time performance. */ - BOOL_BITFIELD byref_in_current_scope : 1; - /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ }; /* The scope currently in effect. */ @@ -688,10 +674,6 @@ scope->keep = keep_next_level_flag; scope->outer = current_scope; scope->depth = current_scope ? (current_scope->depth + 1) : 0; - /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ - scope->byref_in_current_scope = - current_scope ? current_scope->byref_in_current_scope : false; - /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* Check for scope depth overflow. Unlikely (2^28 == 268,435,456) but possible. */ @@ -716,111 +698,6 @@ TYPE_CONTEXT (type) = context; } -/* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ -/* This routine is called at the begining of parsing of a while/for, etc. - statement and sets bc_stmt_body in current scope to say that outer scope - is for such a statement. */ -void -in_bc_stmt_block (void) -{ - gcc_assert (current_scope); - ++current_scope->bc_stmt_body; -} - -/* This routine resets the bc_stmt_body flag before exiting the top-most - block of while/for, etc. statement. */ -void -outof_bc_stmt_block (void) -{ - gcc_assert (current_scope && current_scope->bc_stmt_body > 0); - --current_scope->bc_stmt_body; -} - -/* This routine generates calls of _Block_byref_release(VAR_DECL.forwarding); - for all byref variables seen in the scope of the return statement. -*/ -void -release_all_local_byrefs_at_return (void) -{ - struct c_scope *scope; - struct c_binding *b; - - gcc_assert (current_scope); - if (flag_objc_gc_only || !current_scope->byref_in_current_scope) - return; - - scope = current_scope; - while (scope && scope != file_scope) - { - for (b = scope->bindings; b; b = b->prev) - { - tree p = b->decl; - if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); - } - /* Release up to scope of the block. */ - if (cur_block && cur_block->the_scope == scope) - break; - scope = scope->outer; - } -} - -/* This routine issues a diagnostic if a __byref variable is seen in - current scope. This is for now called from a goto statement. */ -void -diagnose_byref_var_in_current_scope (void) -{ - struct c_scope *scope; - struct c_binding *b; - - gcc_assert (current_scope); - if (flag_objc_gc_only || !current_scope->byref_in_current_scope) - return; - - scope = current_scope; - while (scope && scope != file_scope) - { - for (b = scope->bindings; b; b = b->prev) - { - tree p = b->decl; - if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) { - error ("local byref variable %s is in the scope of this goto", - IDENTIFIER_POINTER (DECL_NAME (p))); - return; - } - } - scope = scope->outer; - } -} - -/* This routine generates call to - _Block_byref_release(VAR_DECL.forwarding); for all __byref - variables which go out of scope when 'break' is executed. */ -void -release_local_byrefs_at_break (void) -{ - struct c_scope *scope; - struct c_binding *b; - - gcc_assert (current_scope); - if (flag_objc_gc_only || !current_scope->byref_in_current_scope) - return; - - scope = current_scope; - while (scope && !scope->bc_stmt_body) - { - for (b = scope->bindings; b; b = b->prev) - { - tree p = b->decl; - if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); - } - scope = scope->outer; - } -} - -/* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ - /* Exit a scope. Restore the state of the identifier-decl mappings that were in effect when this scope was entered. Return a BLOCK node containing all the DECLs in this scope that are of interest @@ -951,11 +828,6 @@ goto common_symbol; case VAR_DECL: - /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ - if (!flag_objc_gc_only && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); - /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ - /* Warnings for unused variables. */ if (!TREE_USED (p) && !TREE_NO_WARNING (p) @@ -3836,12 +3708,12 @@ struct __Block_byref_x { // APPLE LOCAL radar 6244520 - void *isa; // NULL for everything except __weak pointers - struct Block_byref_x *forwarding; - int32_t flags; - int32_t size; - void *ByrefKeepFuncPtr; // Only if variable is __byref ObjC object - void *ByrefDestroyFuncPtr; // Only if variable is __byref ObjC object + void *__isa; // NULL for everything except __weak pointers + struct Block_byref_x *__forwarding; + int32_t __flags; + int32_t __size; + void *__ByrefKeepFuncPtr; // Only if variable is __block ObjC object + void *__ByrefDestroyFuncPtr; // Only if variable is __block ObjC object typex x; } x; */ @@ -3863,36 +3735,36 @@ Block_byref_type = start_struct (RECORD_TYPE, get_identifier (string)); /* APPLE LOCAL begin radar 6244520 */ - /* void *isa; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); + /* void *__isa; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); field_decl_chain = field_decl; /* APPLE LOCAL end radar 6244520 */ - /* struct Block_byref_x *forwarding; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("forwarding"), + /* struct Block_byref_x *__forwarding; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__forwarding"), build_pointer_type (Block_byref_type)); /* APPLE LOCAL radar 6244520 */ chainon (field_decl_chain, field_decl); - /* int32_t flags; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("flags"), + /* int32_t __flags; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__flags"), unsigned_type_node); chainon (field_decl_chain, field_decl); - /* int32_t size; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("size"), + /* int32_t __size; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__size"), unsigned_type_node); chainon (field_decl_chain, field_decl); if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) { - /* void *ByrefKeepFuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("ByrefKeepFuncPtr"), + /* void *__ByrefKeepFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__ByrefKeepFuncPtr"), ptr_type_node); chainon (field_decl_chain, field_decl); - /* void *ByrefDestroyFuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("ByrefDestroyFuncPtr"), + /* void *__ByrefDestroyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__ByrefDestroyFuncPtr"), ptr_type_node); chainon (field_decl_chain, field_decl); } @@ -3919,7 +3791,7 @@ { NULL, &x, 0, sizeof(struct __Block_byref_x)}; when INIT is NULL_TREE - For __byref ObjC objects, it also adds "byref_keep" and "byref_destroy" + For __block ObjC objects, it also adds "byref_keep" and "byref_destroy" Funtion pointers. So the most general initializers would be: { NULL, &x, 0, sizeof(struct __Block_byref_x), &byref_keep, &byref_destroy, @@ -4034,23 +3906,28 @@ if (TREE_CODE (decl) == PARM_DECL) init = 0; /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ cq) */ - /* We build a new type for each local variable declared as __byref + /* We build a new type for each local variable declared as __block and initialize it to a list of initializers. */ else if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) { if (DECL_EXTERNAL (decl) || TREE_STATIC (decl)) { warning (0, - "__byref attribute is only allowed on local variables - ignored"); + "__block attribute is only allowed on local variables - ignored"); COPYABLE_BYREF_LOCAL_VAR (decl) = 0; COPYABLE_BYREF_LOCAL_NONPOD (decl) = 0; } else { decl = new_block_byref_decl (decl); + /* APPLE LOCAL begin radar 6289031 */ + if (! flag_objc_gc_only) + { + push_cleanup (decl, build_block_byref_release_exp (decl), false); + } + /* APPLE LOCAL end radar 6289031 */ + init = init_byref_decl (decl, init); - /* Mark that current scope has a __byref local variable. */ - current_scope->byref_in_current_scope = true; } } /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ cq) */ @@ -7717,6 +7594,13 @@ error ("% declared in % loop initial declaration", id); break; + /* APPLE LOCAL begin radar 6268817 */ + case FUNCTION_DECL: + /* Block helper function can be declared in the statement block + for the for-loop declarations. */ + if (BLOCK_SYNTHESIZED_FUNC (decl)) + break; + /* APPLE LOCAL end radar 6268817 */ default: error ("declaration of non-variable %q+D in % loop " "initial declaration", decl); @@ -7949,12 +7833,12 @@ /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ /* build_byref_local_var_access - converts EXPR to: - EXPR.forwarding->. + EXPR.__forwarding->. */ tree build_byref_local_var_access (tree expr, tree decl_name) { - tree exp = build_component_ref (expr, get_identifier ("forwarding")); + tree exp = build_component_ref (expr, get_identifier ("__forwarding")); exp = build_indirect_ref (exp, "unary *"); exp = build_component_ref (exp, decl_name); return exp; @@ -7969,13 +7853,49 @@ build_block_byref_decl (tree name, tree decl, tree exp) { struct c_scope *scope = current_scope; + tree ptr_type, byref_decl; + /* APPLE LOCAL begin radar 6225809 */ + if (cur_block->prev_block_info) { + /* Traverse enclosing blocks. Insert a __block variable in + each enclosing block which has no declaration of this + variable. This is to ensure that the current (inner) block + gets the __block version of the variable; */ + struct block_sema_info *cb = cur_block->prev_block_info; + while (cb) { + struct c_binding *b = I_SYMBOL_BINDING (name); + /* Find the first declaration not in current block. */ + while (b && b->decl + && (TREE_CODE (b->decl) == VAR_DECL + || TREE_CODE (b->decl) == PARM_DECL) + && b->depth >= cur_block->the_scope->depth) + b = b->shadowed; + + /* Is the next declaration not in enclosing block? */ + if (b && b->decl + && (TREE_CODE (b->decl) == VAR_DECL + || TREE_CODE (b->decl) == PARM_DECL) + && b->depth < cb->the_scope->depth) { + /* No declaration of variable seen in the block. Must insert one. */ + struct c_scope *save_scope = current_scope; + struct block_sema_info *save_current_block = cur_block; + current_scope = cb->the_scope; + cur_block = cb; + decl = build_block_byref_decl (name, decl, exp); + cur_block = save_current_block; + current_scope = save_scope; + } + cb = cb->prev_block_info; + } + } + /* APPLE LOCAL end radar 6225809 */ + /* If it is already a byref declaration, do not add the pointer type because such declarations already have the pointer type added. This happens when we have two nested byref declarations in nested blocks. */ - tree ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) - ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); - tree byref_decl = build_decl (VAR_DECL, name, ptr_type); + ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) + ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); + byref_decl = build_decl (VAR_DECL, name, ptr_type); /* APPLE LOCAL begin radars 6144664 & 6145471 */ DECL_SOURCE_LOCATION (byref_decl) = DECL_SOURCE_LOCATION (cur_block->helper_func_decl); @@ -8001,8 +7921,12 @@ scope, /*invisible=*/false, /*nested=*/false); cur_block->block_byref_decl_list = tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); - cur_block->block_original_byref_decl_list = - tree_cons (NULL_TREE, exp, cur_block->block_original_byref_decl_list); + /* APPLE LOCAL radar 5847213 - building block_original_byref_decl_list list removed. */ + /* APPLE LOCAL begin radar 6289031 */ + if (! flag_objc_gc_only) + push_cleanup (byref_decl, build_block_byref_release_exp (byref_decl), false); + /* APPLE LOCAL end radar 6289031 */ + return byref_decl; } @@ -8020,7 +7944,7 @@ /* APPLE LOCAL radar 6212722 */ tree type, exp; /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ - /* 'decl' was previously declared as __byref. Simply, copy the value + /* 'decl' was previously declared as __block. Simply, copy the value embedded in the above variable. */ if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) decl = build_byref_local_var_access (decl, DECL_NAME (decl)); @@ -8106,62 +8030,68 @@ return ref_decl; } -/* APPLE LOCAL begin radar 5939894 (C++ ch) */ -/** build_block_internal_types - This routine builds the block type: - struct __invoke_impl { - void *isa; - int32_t Flags; - int32_t Size; - void *FuncPtr; - } *invoke_impl_ptr_type; - */ -void -build_block_internal_types (void) +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ +static GTY (()) tree descriptor_ptr_type; +static GTY (()) tree descriptor_ptr_type_with_copydispose; +/** build_block_descriptor_type - This routine builds following internal type: + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct Block_literal_1) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE is set (withCopyDispose true) + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE is set (withCopyDispose true) +} *descriptor_ptr_type; + +Objects of this type will always be static. This is one main component of abi change. +*/ +tree +build_block_descriptor_type (bool withCopyDispose) { tree field_decl_chain, field_decl; - tree invoke_impl_type; - - /* APPLE LOCAL begin radar 5939894 (C++ ch) */ - /* If a user-declaration of "struct __invoke_impl" is seen, use it. */ - invoke_impl_type = lookup_tag (RECORD_TYPE, get_identifier ("__invoke_impl"), 0); - if (invoke_impl_type) - { - invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); - return; - } - /* APPLE LOCAL end radar 5939894 (C++ ch) */ - - push_to_top_level (); - invoke_impl_type = start_struct (RECORD_TYPE, get_identifier ("__invoke_impl")); - - /* APPLE LOCAL begin radar 5811599 (C++ ch) */ - /* void *isa; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); - /* APPLE LOCAL end radar 5811599 (C++ ch) */ + tree main_type; + + if (withCopyDispose && descriptor_ptr_type_with_copydispose) + return descriptor_ptr_type_with_copydispose; + if (!withCopyDispose && descriptor_ptr_type) + return descriptor_ptr_type; + + main_type = + withCopyDispose ? + start_struct (RECORD_TYPE, get_identifier ("__block_descriptor_withcopydispose")) + : start_struct (RECORD_TYPE, get_identifier ("__block_descriptor")); + + /* unsigned long int reserved; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("reserved"), long_unsigned_type_node); field_decl_chain = field_decl; - - /* int32_t Flags; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("Flags"), unsigned_type_node); - chainon (field_decl_chain, field_decl); - - /* int32_t Size */ - field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), unsigned_type_node); - chainon (field_decl_chain, field_decl); - - /* void *FuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("FuncPtr"), ptr_type_node); + + /* unsigned long int Size; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), long_unsigned_type_node); chainon (field_decl_chain, field_decl); - - /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks (C++ ch) */ - /* Mark this struct as being a block struct rather than a 'normal' - struct. */ - TYPE_BLOCK_IMPL_STRUCT (invoke_impl_type) = 1; - /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks (C++ ch) */ - finish_struct (invoke_impl_type, field_decl_chain, NULL_TREE); - pop_from_top_level (); - invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); + + if (withCopyDispose) + { + /* void *CopyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), ptr_type_node); + chainon (field_decl_chain, field_decl); + /* void *DestroyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), ptr_type_node); + chainon (field_decl_chain, field_decl); + } + + /* Mark this struct as being a block struct rather than a 'normal' + struct. */ + TYPE_BLOCK_IMPL_STRUCT (main_type) = 1; + finish_struct (main_type, field_decl_chain, NULL_TREE); + + main_type = build_pointer_type (main_type); + if (withCopyDispose) + descriptor_ptr_type_with_copydispose = main_type; + else + descriptor_ptr_type = main_type; + return main_type; } -/* APPLE LOCAL end radar 5939894 (C++ ch) */ +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ /* APPLE LOCAL begin radar 5814025 (C++ ch) */ struct c_declarator * @@ -8172,12 +8102,6 @@ struct c_declarator *itarget = target; struct c_declarator *ret = XOBNEW (&parser_obstack, struct c_declarator); - /* APPLE LOCAL begin radar 5732232 - blocks (C++ ch) */ - /* Closure contructs seen -- generate supporting types. */ - if (!invoke_impl_ptr_type) - build_block_internal_types (); - /* APPLE LOCAL end radar 5732232 - blocks (C++ ch) */ - if (type_quals_attrs) { tree attrs = type_quals_attrs->attrs; @@ -8401,6 +8325,11 @@ decl_stmt = build_stmt (DECL_EXPR, decl); /* APPLE LOCAL Radar 5811961, Fix location of block prologue vars (C++ ch) */ SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl)); + /* APPLE LOCAL begin radar 6163705, Blocks prologues */ + /* Give the prologue statements a line number of one before the beginning of + the function, to make them easily identifiable later. */ + EXPR_LINENO (decl_stmt) = DECL_SOURCE_LINE (decl) - 1; + /* APPLE LOCAL end radar 6163705, Blocks prologues */ tsi_link_before (&i, decl_stmt, TSI_SAME_STMT); } Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-parser.c Mon Nov 3 01:33:15 2008 @@ -1136,7 +1136,6 @@ static tree c_parser_asm_statement (c_parser *); /* APPLE LOCAL begin radar 5732232 - blocks (C++ ca) */ static tree c_parser_block_literal_expr (c_parser *); -static bool c_parser_block_byref_declarations (c_parser *); /* APPLE LOCAL end radar 5732232 - blocks (C++ ca) */ static tree c_parser_asm_operands (c_parser *, bool); static tree c_parser_asm_clobbers (c_parser *); @@ -3765,14 +3764,6 @@ else goto statement; } - /* APPLE LOCAL begin radar 5732232 - blocks (not in C++) */ - else if (flag_blocks && first_stmt && - c_parser_next_token_is (parser, CPP_OR) && - c_parser_block_byref_declarations (parser)) - { - ; - } - /* APPLE LOCAL end radar 5732232 - blocks (not in C++) */ else if (c_parser_next_token_is (parser, CPP_PRAGMA)) { /* External pragmas, and some omp pragmas, are not associated @@ -4241,8 +4232,6 @@ tree block, expr, body, save_break; gcc_assert (c_parser_next_token_is_keyword (parser, RID_SWITCH)); c_parser_consume_token (parser); - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) { @@ -4260,8 +4249,6 @@ add_stmt (build1 (LABEL_EXPR, void_type_node, c_break_label)); c_break_label = save_break; add_stmt (c_end_compound_stmt (block, flag_isoc99)); - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - outof_bc_stmt_block (); } /* Parse a while statement (C90 6.6.5, C99 6.8.5). @@ -4286,8 +4273,6 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; cond = c_parser_paren_condition (parser); @@ -4301,8 +4286,6 @@ true); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - outof_bc_stmt_block (); c_break_label = save_break; c_cont_label = save_cont; } @@ -4329,8 +4312,6 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - in_bc_stmt_block (); block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; save_break = c_break_label; @@ -4350,8 +4331,6 @@ c_finish_loop (loc, cond, NULL, body, new_break, new_cont, attrs, false); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - outof_bc_stmt_block (); } /* Parse a for statement (C90 6.6.5, C99 6.8.5). @@ -4391,8 +4370,6 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ attrs = c_parser_attributes (parser); /* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - in_bc_stmt_block (); /* APPLE LOCAL radar 4472881 (in 4.2 ah) */ block = c_begin_compound_stmt (flag_isoc99 || c_dialect_objc ()); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) @@ -4518,8 +4495,6 @@ /* APPLE LOCAL end radar 4708210 (for_objc_collection in 4.2) */ /* APPLE LOCAL radar 4472881 (in 4.2 ai) */ add_stmt (c_end_compound_stmt (block, flag_isoc99 || c_dialect_objc ())); - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - outof_bc_stmt_block (); c_break_label = save_break; c_cont_label = save_cont; } @@ -5598,8 +5573,7 @@ variable holds address of the outside variable referenced in. */ /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ cd) */ - if (TREE_CODE (expr.value) == VAR_DECL - && !building_block_byref_decl) + if (TREE_CODE (expr.value) == VAR_DECL) { if (BLOCK_DECL_BYREF (expr.value)) { @@ -5609,7 +5583,7 @@ /* What we have is an expression which is of type struct __Block_byref_X. Must get to the value of the variable embedded in this structure. It is at: - __Block_byref_X.forwarding->x */ + __Block_byref_X.__forwarding->x */ expr.value = build_byref_local_var_access (expr.value, DECL_NAME (orig_decl)); } @@ -6498,6 +6472,12 @@ && c_parser_next_token_is_not (parser, CPP_EOF)) { c_parser_objc_property_attribute (parser); + /* APPLE LOCAL begin radar 6302949 */ + if (c_parser_next_token_is_not (parser, CPP_COMMA) + && c_parser_next_token_is_not (parser, CPP_CLOSE_PAREN) + && c_parser_next_token_is_not (parser, CPP_EOF)) + warning (0, "property attributes must be separated by a comma"); + /* APPLE LOCAL end radar 6302949 */ if (c_parser_next_token_is (parser, CPP_COMMA) || c_parser_next_token_is (parser, CPP_NAME) /* error */) c_parser_consume_token (parser); @@ -9386,61 +9366,103 @@ } /* APPLE LOCAL end CW asm blocks */ /* APPLE LOCAL begin radar 5732232 - blocks (C++ ce) */ -static tree block_copy_assign_decl; -static tree block_destroy_decl; +/* APPLE LOCAL begin radar 6175959 */ +static GTY(()) tree block_copy_assign_decl; +static GTY(()) tree block_object_assign_decl; +static GTY(()) tree block_destroy_decl; +static GTY(()) tree block_object_dispose_func_decl; +/* APPLE LOCAL end radar 6175959 */ + +/* APPLE LOCAL begin radar 6300081 */ + +/* This function builds a "generic" block struct type, to be passed + into the debug information for blocks pointers, to allow gdb to + find the actual function pointer for the block. Any time the Blocks + structure layout changes, this may also need to change. + + Currently a block pointer is a pointer to a __block_literal_n struct, + the third field of which is a pointer to a __block_descriptor struct, + whose third field is the function pointer. There are other fields as + well, but these are the ones gdb needs to know about to find the + function pointer. Therefore a generic block struct currently looks + like this: + + struct __block_literal_generic + { + void * __isa; + int __flags; + int __reserved; + void (*__FuncPtr)(void *); + struct __block_descriptor + { + unsigned long int reserved; + unsigned long int Size; + } *__descriptor; + }; -void -gen_block_byref_release_exp (tree var_decl) -{ - tree cleanup = build_block_byref_release_exp (var_decl); - if (cleanup) - add_stmt (cleanup); -} + IF AT ANY TIME THE STRUCTURE OF A __BLOCK_LITERAL_N CHANGES, THIS + MUST BE CHANGED ALSO!! -bool building_block_byref_decl = false; -static bool -c_parser_block_byref_declarations (c_parser* parser) +*/ + +tree +build_generic_block_struct_type (void) { - if (!in_imm_block ()) - return false; - warning (0, "| x | has been deprecated in blocks"); - do { - struct c_expr byref_decl_expr; - c_parser_consume_token (parser); /* consume '|' or ',' */ - if (!c_parser_next_token_is (parser, CPP_NAME)) - { - error ("expected identifier in block by-reference variable list"); - return false; - } - building_block_byref_decl = true; - byref_decl_expr = c_parser_cast_expression (parser, NULL); - building_block_byref_decl = false; - if (byref_decl_expr.value != error_mark_node && - !(TREE_CODE (byref_decl_expr.value) == VAR_DECL && - (BLOCK_DECL_BYREF (byref_decl_expr.value) || - in_block_global_byref_list (byref_decl_expr.value)))) - error ( - "only a visible variable may be used in a block byref declaration"); - } while (c_parser_next_token_is (parser, CPP_COMMA)); + tree field_decl_chain; + tree field_decl; + tree block_struct_type; - if (!c_parser_next_token_is (parser, CPP_OR)) - { - error ("expected identifier or '|' at end of block by-reference variable list"); - return false; - } - c_parser_consume_token (parser); /* consume '|' */ - return true; + push_to_top_level (); + block_struct_type = start_struct (RECORD_TYPE, + get_identifier ("__block_literal_generic")); + + field_decl = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); + field_decl_chain = field_decl; + + field_decl = build_decl (FIELD_DECL, get_identifier ("__flags"), + integer_type_node); + chainon (field_decl_chain, field_decl); + + field_decl = build_decl (FIELD_DECL, get_identifier ("__reserved"), + integer_type_node); + chainon (field_decl_chain, field_decl); + + /* void *__FuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__FuncPtr"), ptr_type_node); + chainon (field_decl_chain, field_decl); + + field_decl = build_decl (FIELD_DECL, get_identifier ("__descriptor"), + build_block_descriptor_type (false)); + chainon (field_decl_chain, field_decl); + + TYPE_BLOCK_IMPL_STRUCT (block_struct_type) = 1; + finish_struct (block_struct_type, field_decl_chain, NULL_TREE); + pop_from_top_level (); + return block_struct_type; } +/* APPLE LOCAL end radar 6300081 */ +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ /** build_block_struct_type - - struct block_1 { - struct invok_impl impl; - void *CopyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set - void *DestroyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + struct __block_literal_n { + void *__isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int __flags; + int __reserved; + void *__FuncPtr; + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct __block_literal_n) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + } *__descriptor; + + // imported variables int x; // ref variable list ... int *y; // byref variable list }; - */ +*/ static tree build_block_struct_type (struct block_sema_info * block_impl) { @@ -9448,9 +9470,6 @@ char buffer[32]; static int unique_count; tree block_struct_type; - /* build struct invok_impl */ - if (!invoke_impl_ptr_type) - build_block_internal_types (); /* Check and see if this block is required to have a Copy/Dispose helper function. If yes, set BlockHasCopyDispose to TRUE. */ @@ -9462,7 +9481,7 @@ break; } - /* Further check to see that we have __byref variables which require + /* Further check to see that we have __block variables which require Copy/Dispose helpers. */ for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) @@ -9472,23 +9491,35 @@ break; } - sprintf(buffer, "__block_%d", ++unique_count); + sprintf(buffer, "__block_literal_%d", ++unique_count); push_to_top_level (); block_struct_type = start_struct (RECORD_TYPE, get_identifier (buffer)); - /* struct invok_impl impl; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("impl"), - TREE_TYPE (invoke_impl_ptr_type)); + + /* void *__isa; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); field_decl_chain = field_decl; + + /* int __flags */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__flags"), + integer_type_node); + chainon (field_decl_chain, field_decl); + + /* int __reserved */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__reserved"), + integer_type_node); + chainon (field_decl_chain, field_decl); + + /* void *__FuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__FuncPtr"), ptr_type_node); + chainon (field_decl_chain, field_decl); + + /* struct __block_descriptor *__descriptor */ + field_decl = build_decl (FIELD_DECL, get_identifier ("__descriptor"), + build_block_descriptor_type (block_impl->BlockHasCopyDispose)); + chainon (field_decl_chain, field_decl); + if (block_impl->BlockHasCopyDispose) { - /* void *CopyFuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), - ptr_type_node); - chainon (field_decl_chain, field_decl); - /* void *DestroyFuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), - ptr_type_node); - chainon (field_decl_chain, field_decl); /* If inner block of a nested block has BlockHasCopyDispose, so does its outer block. */ if (block_impl->prev_block_info) @@ -9521,28 +9552,98 @@ return block_struct_type; } +/** build_descriptor_block_decl - + This routine builds a static block_descriptior variable of type: + struct __block_descriptor; and initializes it to: + {0, sizeof(struct literal_block_n), + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + } +*/ +static tree +build_descriptor_block_decl (tree block_struct_type, struct block_sema_info *block_impl) +{ + extern tree create_tmp_var_raw (tree, const char *); + static int desc_unique_count; + int size; + tree helper_addr, fields; + tree decl, constructor, initlist; + tree exp, bind; + char name [32]; + tree descriptor_type = + TREE_TYPE (build_block_descriptor_type (block_impl->BlockHasCopyDispose)); + + sprintf (name, "__block_descriptor_tmp_%d", ++desc_unique_count); + decl = create_tmp_var_raw (descriptor_type, name); + DECL_CONTEXT (decl) = NULL_TREE; + DECL_ARTIFICIAL (decl) = 1; + + /* Initialize "reserved" field to 0 for now. */ + fields = TYPE_FIELDS (descriptor_type); + initlist = build_tree_list (fields, build_int_cst (long_unsigned_type_node, 0)); + fields = TREE_CHAIN (fields); + + /* Initialize "Size" field. */ + size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); + initlist = tree_cons (fields, + build_int_cst (long_unsigned_type_node, size), + initlist); + + if (block_impl->BlockHasCopyDispose) + { + /* Initialize "CopyFuncPtr" and "DestroyFuncPtr" fields. */ + /* Helpers were previously generated completeley as a nested + function (and context was required for code gen.) But they are not, + so context must be set to NULL so initialization logic does not complain. */ + DECL_CONTEXT (block_impl->copy_helper_func_decl) = NULL_TREE; + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + DECL_CONTEXT (block_impl->destroy_helper_func_decl) = NULL_TREE; + fields = TREE_CHAIN (fields); + helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + initlist = tree_cons (fields, helper_addr, initlist); + } + constructor = build_constructor_from_list (descriptor_type, + nreverse (initlist)); + TREE_CONSTANT (constructor) = 1; + TREE_STATIC (constructor) = 1; + TREE_READONLY (constructor) = 1; + DECL_INITIAL (decl) = constructor; + exp = build_stmt (DECL_EXPR, decl); + bind = build3 (BIND_EXPR, void_type_node, decl, exp, NULL); + TREE_SIDE_EFFECTS (bind) = 1; + add_stmt (bind); + TREE_PUBLIC (decl) = 0; + TREE_STATIC (decl) = 1; + finish_decl (decl, constructor, NULL_TREE); + return decl; +} + /** build_block_struct_initlist - builds the initializer list: - { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, - BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, - sizeof(struct block_1), - helper_1 }, - copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - x, - &y + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // __isa, + BLOCK_HAS_DESCRIPTOR | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags, + 0, // __reserved + &helper_1, // __FuncPtr, + &static_descriptor_variable // __descriptor, + x, // user variables. + &y + ... } */ static tree build_block_struct_initlist (tree block_struct_type, struct block_sema_info *block_impl) { - tree initlist; - int size; - tree helper_addr, chain, fields; - unsigned flags = 0; + tree initlist, helper_addr; + tree chain, fields; + unsigned int flags = BLOCK_HAS_DESCRIPTOR; static tree NSConcreteStackBlock_decl = NULL_TREE; static tree NSConcreteGlobalBlock_decl = NULL_TREE; + tree descriptor_block_decl = build_descriptor_block_decl (block_struct_type, block_impl); if (block_impl->BlockHasCopyDispose) /* Note! setting of this flag merely indicates to the runtime that @@ -9550,9 +9651,12 @@ routines. */ flags |= BLOCK_HAS_COPY_DISPOSE; - fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type)); - - if (!current_function_decl) + fields = TYPE_FIELDS (block_struct_type); + /* APPLE LOCAL begin radar 6230297 */ + if (!current_function_decl || + (block_impl->block_ref_decl_list == NULL_TREE && + block_impl->block_byref_decl_list == NULL_TREE)) + /* APPLE LOCAL end radar 6230297 */ { /* This is a global block. */ /* Find an existing declaration for _NSConcreteGlobalBlock or declare @@ -9596,34 +9700,28 @@ } fields = TREE_CHAIN (fields); + /* __flags */ initlist = tree_cons (fields, - build_int_cst (unsigned_type_node, flags), + build_int_cst (integer_type_node, flags), initlist); fields = TREE_CHAIN (fields); - size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); + + /* __reserved */ initlist = tree_cons (fields, - build_int_cst (unsigned_type_node, size), + build_int_cst (integer_type_node, 0), initlist); fields = TREE_CHAIN (fields); + + /* __FuncPtr */ helper_addr = build_fold_addr_expr (block_impl->helper_func_decl); helper_addr = convert (ptr_type_node, helper_addr); initlist = tree_cons (fields, helper_addr, initlist); - gcc_assert (invoke_impl_ptr_type); - initlist = build_constructor_from_list (TREE_TYPE (invoke_impl_ptr_type), - nreverse (initlist)); - fields = TYPE_FIELDS (block_struct_type); - initlist = build_tree_list (fields, initlist); - if (block_impl->BlockHasCopyDispose) - { - fields = TREE_CHAIN (fields); - helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); - helper_addr = convert (ptr_type_node, helper_addr); - initlist = tree_cons (fields, helper_addr, initlist); - fields = TREE_CHAIN (fields); - helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); - helper_addr = convert (ptr_type_node, helper_addr); - initlist = tree_cons (fields, helper_addr, initlist); - } + fields = TREE_CHAIN (fields); + + /* __descriptor */ + initlist = tree_cons (fields, + convert (ptr_type_node, build_fold_addr_expr (descriptor_block_decl)), + initlist); for (chain = block_impl->block_original_ref_decl_list; chain; chain = TREE_CHAIN (chain)) { @@ -9632,14 +9730,30 @@ fields = TREE_CHAIN (fields); initlist = tree_cons (fields, copy_in_object (y), initlist); } - for (chain = block_impl->block_original_byref_decl_list; chain; + for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) { - tree y = TREE_VALUE (chain); + tree y = lookup_name (DECL_NAME (TREE_VALUE (chain))); + tree forwarding_expr; + gcc_assert (y); TREE_USED (y) = 1; + if (COPYABLE_BYREF_LOCAL_VAR (y)) + { + /* For variables declared __block, either the original one + at the point of declaration or the imported version (which is + initialized in the helper function's prologue) is used to + initilize the byref variable field in the temporary. */ + if (TREE_CODE (TREE_TYPE (y)) != RECORD_TYPE) + y = build_indirect_ref (y, "unary *"); + /* We will be using the __block_struct_variable.__forwarding as the + initializer. */ + forwarding_expr = build_component_ref (y, get_identifier ("__forwarding")); + } + else + /* Global variable is always assumed passed by its address. */ + forwarding_expr = build_fold_addr_expr (y); fields = TREE_CHAIN (fields); - y = build_fold_addr_expr (y); - initlist = tree_cons (fields, y, initlist); + initlist = tree_cons (fields, forwarding_expr, initlist); } return initlist; } @@ -9648,29 +9762,39 @@ build_block_literal_tmp - This routine: 1) builds block type: - struct block_1 { - struct invok_impl impl; - void *CopyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE - void *DestroyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + struct __block_literal_n { + void *__isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int __flags; + int __reserved; + void *__FuncPtr + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct Block_literal_1) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + } *__descriptor; + + // imported variables int x; // ref variable list ... int *y; // byref variable list }; 2) build function prototype: - double helper_1(struct block_1 *ii, int z); + double helper_1(struct __block_literal_n *ii, int z); 3) build the temporary initialization: - struct block_1 I = { - { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, - BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, - sizeof(struct block_1), - helper_1 }, - copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - x, - &y -}; - + struct __block_literal_n I = { + &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // __isa, + BLOCK_HAS_DESCRIPTOR | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags, + 0, // __reserved + &helper_1, // __FuncPtr + &static_descriptor_variable // __descriptor, + x, // user variables. + &y + ... + }; It return the temporary. */ @@ -9683,12 +9807,22 @@ tree constructor, initlist; tree exp, bind; tree block_struct_type = TREE_TYPE (block_impl->block_arg_ptr_type); + /* APPLE LOCAL begin radar 6230297 */ + bool staticBlockTmp = (block_impl->block_ref_decl_list == NULL_TREE && + block_impl->block_byref_decl_list == NULL_TREE); block_holder_tmp_decl = create_tmp_var_raw (block_struct_type, name); /* Context will not be known until when the literal is synthesized. This is more so in the case of nested block literal blocks. */ - DECL_CONTEXT (block_holder_tmp_decl) = current_function_decl; + DECL_CONTEXT (block_holder_tmp_decl) = staticBlockTmp ? NULL_TREE + : current_function_decl; + /* In the new ABI, helper function decl. is the initializer for the + descriptor variable which is always declared static. So, it must + have no context; otherwise, gcc thinks that it requires trampoline! when + address of this function is used as initializer. */ + DECL_CONTEXT (block_impl->helper_func_decl) = NULL_TREE; + /* APPLE LOCAL end radar 6230297 */ DECL_ARTIFICIAL (block_holder_tmp_decl) = 1; initlist = build_block_struct_initlist (block_struct_type, @@ -9705,13 +9839,15 @@ TREE_SIDE_EFFECTS (bind) = 1; add_stmt (bind); /* Temporary representing a global block is made global static. */ - if (global_bindings_p ()) { + /* APPLE LOCAL radar 6230297 */ + if (staticBlockTmp || global_bindings_p ()) { TREE_PUBLIC (block_holder_tmp_decl) = 0; TREE_STATIC (block_holder_tmp_decl) = 1; finish_decl (block_holder_tmp_decl, constructor, NULL_TREE); } return block_holder_tmp_decl; } +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ static tree clean_and_exit (tree block) @@ -9739,7 +9875,8 @@ DECL_ARG_TYPE (dst_arg) = block_impl->block_arg_ptr_type; src_arg = build_decl (PARM_DECL, get_identifier ("_src"), block_impl->block_arg_ptr_type); - DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + /* APPLE LOCAL radar 5847213 */ + DECL_CONTEXT (src_arg) = cur_block->copy_helper_func_decl; TREE_USED (src_arg) = 1; DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; arg_info = xcalloc (1, sizeof (struct c_arg_info)); @@ -9760,6 +9897,9 @@ chain = TREE_CHAIN (chain)) if (block_requires_copying (TREE_VALUE (chain))) { + /* APPLE LOCAL begin radar 6175959 */ + tree which_function_decl; + tree func_params, call_exp; tree p = TREE_VALUE (chain); tree dst_block_component, src_block_component; dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), @@ -9769,40 +9909,58 @@ if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) { - tree func_params, call_exp; - /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure) */ - /* Build a: void _Block_copy_assign (void *, void *) if not done + /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure, 0) */ + /* Build a: void _Block_copy_assign (void *, void *, int) if not done already. */ - if (!block_copy_assign_decl) + /* APPLE LOCAL begin radar 6310599 */ + if (!block_copy_assign_decl && + !(block_copy_assign_decl = lookup_name (get_identifier ("_Block_copy_assign")))) + /* APPLE LOCAL end radar 6310599 */ { tree func_type = build_function_type (void_type_node, tree_cons (NULL_TREE, ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node)))); block_copy_assign_decl = builtin_function ("_Block_copy_assign", func_type, 0, NOT_BUILT_IN, 0, NULL_TREE); TREE_NOTHROW (block_copy_assign_decl) = 0; } - dst_block_component = build_fold_addr_expr (dst_block_component); - func_params = tree_cons (NULL_TREE, dst_block_component, - tree_cons (NULL_TREE, src_block_component, - NULL_TREE)); - call_exp = build_function_call (block_copy_assign_decl, func_params); - add_stmt (call_exp); + which_function_decl = block_copy_assign_decl; } else { - /* _dest-> imported_object_x = [_src->imported_object_x retain] */ - tree rhs, store; - /* [_src->imported_object_x retain] */ - rhs = retain_block_component (src_block_component); - store = build_modify_expr (dst_block_component, NOP_EXPR, rhs); - add_stmt (store); + /* _Block_object_assign(&_dest->myImportedBlock, _src->myImportedClosure, 0) */ + /* Build a: void _Block_object_assign (void *, void *, int) if not done + already. */ + if (!block_object_assign_decl && + !(block_object_assign_decl = lookup_name (get_identifier ("_Block_object_assign")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node)))); + + block_object_assign_decl = builtin_function ("_Block_object_assign", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_object_assign_decl) = 0; + } + which_function_decl = block_object_assign_decl; } + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), + NULL_TREE))); + call_exp = build_function_call (which_function_decl, func_params); + add_stmt (call_exp); + /* APPLE LOCAL end radar 6175959 */ } - /* For each __byref declared variable used in |...| Must generate call to: + /* For each __block declared variable must generate call to: _Block_byref_assign_copy(&_dest->myImportedBlock, _src->myImportedBlock) */ for (chain = block_impl->block_byref_decl_list; chain; @@ -9833,6 +9991,30 @@ free (arg_info); } +/* APPLE LOCAL begin radar 6175959 */ +static tree +block_object_dispose (tree src_block_component) +{ + tree func_params; + if (!block_object_dispose_func_decl && + !(block_object_dispose_func_decl = lookup_name (get_identifier ("_Block_object_dispose")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node))); + + block_object_dispose_func_decl = builtin_function ("_Block_object_dispose", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_object_dispose_func_decl) = 0; + } + func_params = tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), NULL_TREE)); + return build_function_call (block_object_dispose_func_decl, func_params); +} +/* APPLE LOCAL end radar 6175959 */ + static void synth_destroy_helper_block_func (struct block_sema_info * block_impl) { @@ -9860,6 +10042,7 @@ chain = TREE_CHAIN (chain)) if (block_requires_copying (TREE_VALUE (chain))) { + /* APPLE LOCAL begin radar 6175959 */ tree p = TREE_VALUE (chain); tree src_block_component; src_block_component = build_component_ref (build_indirect_ref (src_arg, "->"), @@ -9876,26 +10059,30 @@ { tree func_type = build_function_type (void_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node))); block_destroy_decl = builtin_function ("_Block_destroy", func_type, 0, NOT_BUILT_IN, 0, NULL_TREE); TREE_NOTHROW (block_destroy_decl) = 0; } - func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + func_params = tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), NULL_TREE)); call_exp = build_function_call (block_destroy_decl, func_params); add_stmt (call_exp); } else { tree rel_exp; - /* [_src->imported_object_0 release]; */ - rel_exp = release_block_component (src_block_component); + /* _Block_object_dispose(_src->imported_object_0, 0); */ + rel_exp = block_object_dispose (src_block_component); add_stmt (rel_exp); } + /* APPLE LOCAL end radar 6175959 */ } - /* For each __byref declared variable used in |...| Must generate call to: + /* For each __block declared variable must generate call to: _Block_byref_release(_src->myImportedClosure) */ for (chain = block_impl->block_byref_decl_list; chain; @@ -10078,6 +10265,8 @@ /* APPLE LOCAL begin radar 6237713 */ if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) attributes = c_parser_attributes (parser); + /* APPLE LOCAL radar 6246527 */ + any_recognized_block_attribute (attributes); decl_attributes (&cur_block->helper_func_decl, attributes, 0); /* APPLE LOCAL end radar 6237713 */ Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Mon Nov 3 01:33:15 2008 @@ -76,9 +76,6 @@ static int require_constant_elements; /* APPLE LOCAL begin radar 5732232 - blocks (C++ cm) */ -/* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ -/* Move declaration of invoke_impl_ptr_type to c-common.c */ -/* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ static bool types_are_block_compatible (tree lhptee, tree rhptee); static tree build_block_call (tree, tree, tree); /* APPLE LOCAL end radar 5732232 - blocks (C++ cm) */ @@ -2195,9 +2192,7 @@ (DECL_EXTERNAL (decl) || TREE_STATIC (decl))); /* Treat all 'global' variables as 'byref' by default. */ /* APPLE LOCAL begin radar 6014138 (C++ ci) */ - if (building_block_byref_decl || gdecl - || (TREE_CODE (decl) == VAR_DECL - && COPYABLE_BYREF_LOCAL_VAR (decl))) + if (gdecl || (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl))) /* APPLE LOCAL end radar 6014138 (C++ ci) */ { /* APPLE LOCAL begin radar 5803600 (C++ ci) */ @@ -3692,8 +3687,8 @@ } /* APPLE LOCAL begin 4154928 */ /* Objective-C pointer comparisons are a bit more lenient. */ - /* APPLE LOCAL radar 4229905 */ - else if (objc_have_common_type (type1, type2, -3, NULL_TREE)) + /* APPLE LOCAL radar 4229905 - radar 6231433 */ + else if (objc_have_common_type (type1, type2, -3, NULL_TREE, "conditional expression")) result_type = objc_common_type (type1, type2); /* APPLE LOCAL end 4154928 */ else @@ -4076,39 +4071,40 @@ return false; } +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ /** build_block_call - Routine to build a block call; as in: - ((double(*)(struct invok_impl *, int))(BLOCK_PTR_VAR->FuncPtr))(I, 42); + ((double(*)(void *, int))(BLOCK_PTR_EXP->__FuncPtr))(I, 42); FNTYPE is the original function type derived from the syntax. - FUNCTION is the4 block pointer variable. + BLOCK_PTR_EXP is the block pointer variable. PARAMS is the parameter list. */ static tree -build_block_call (tree fntype, tree function, tree params) +build_block_call (tree fntype, tree block_ptr_exp, tree params) { - tree block_ptr_exp; tree function_ptr_exp; tree typelist; - /* (struct invok_impl *)BLOCK_PTR_VAR */ - /* First convert it to 'void *'. */ - block_ptr_exp = convert (ptr_type_node, function); - gcc_assert (invoke_impl_ptr_type); - block_ptr_exp = convert (invoke_impl_ptr_type, block_ptr_exp); - params = tree_cons (NULL_TREE, block_ptr_exp, params); - /* BLOCK_PTR_VAR->FuncPtr */ - function_ptr_exp = - build_component_ref (build_indirect_ref (block_ptr_exp, "->"), - get_identifier ("FuncPtr")); + /* First convert BLOCK_PTR_EXP to 'void *'. */ + block_ptr_exp = convert (ptr_type_node, block_ptr_exp); + gcc_assert (generic_block_literal_struct_type); + block_ptr_exp = convert (build_pointer_type (generic_block_literal_struct_type), + block_ptr_exp); + /* BLOCK_PTR_VAR->__FuncPtr */ + function_ptr_exp = build_component_ref (build_indirect_ref (block_ptr_exp, "->"), + get_identifier ("__FuncPtr")); + gcc_assert (function_ptr_exp); - /* Build: result_type(*)(struct invok_impl *, function-arg-type-list) */ + /* Build: result_type(*)(void *, function-arg-type-list) */ typelist = TYPE_ARG_TYPES (fntype); - typelist = tree_cons (NULL_TREE, invoke_impl_ptr_type, typelist); + typelist = tree_cons (NULL_TREE, ptr_type_node, typelist); fntype = build_function_type (TREE_TYPE (fntype), typelist); function_ptr_exp = convert (build_pointer_type (fntype), function_ptr_exp); + params = tree_cons (NULL_TREE, block_ptr_exp, params); return fold_build3 (CALL_EXPR, TREE_TYPE (fntype), function_ptr_exp, params, NULL_TREE); } +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ /* APPLE LOCAL end radar 5732232 - blocks (C++ cm) */ /* Interpret a cast of expression EXPR to type TYPE. */ @@ -4350,7 +4346,8 @@ break; } - objc_ok = objc_compare_types (type, rhstype, parmno, rname); + /* APPLE LOCAL radar 6231433 */ + objc_ok = objc_compare_types (type, rhstype, parmno, rname, "comparison"); } if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype)) @@ -5260,7 +5257,8 @@ /* APPLE LOCAL begin radar 4293709 */ if (c_dialect_objc ()) (void)objc_compare_types (type, TREE_TYPE (inside_init), - -2/* init */, NULL_TREE); + /* APPLE LOCAL radar 6231433 */ + -2/* init */, NULL_TREE, NULL); /* APPLE LOCAL end radar 4293709 */ } @@ -7543,8 +7541,7 @@ nlist->label = decl; label_context_stack_vm->labels_used = nlist; } - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - diagnose_byref_var_in_current_scope (); + TREE_USED (decl) = 1; return add_stmt (build1 (GOTO_EXPR, void_type_node, decl)); } @@ -7875,8 +7872,7 @@ retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t); } - /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ - release_all_local_byrefs_at_return (); + ret_stmt = build_stmt (RETURN_EXPR, retval); TREE_NO_WARNING (ret_stmt) |= no_warning; return add_stmt (ret_stmt); @@ -8222,11 +8218,6 @@ if (skip) return NULL_TREE; - /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ - /* Before breaking out or on continue, release all local __byref - variables which go out of scope. */ - release_local_byrefs_at_break (); - /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ return add_stmt (build1 (GOTO_EXPR, void_type_node, label)); } @@ -8688,7 +8679,8 @@ return error_mark_node; } - objc_ok = objc_compare_types (type0, type1, -3, NULL_TREE); + /* APPLE LOCAL radar 6231433 */ + objc_ok = objc_compare_types (type0, type1, -3, NULL_TREE, "comparison"); switch (code) { Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Mon Nov 3 01:33:15 2008 @@ -1086,8 +1086,6 @@ /* APPLE LOCAL end ObjC GC */ /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ if (flag_blocks) { - /* APPLE LOCAL radar 6096219 */ - builtin_define ("__byref=__attribute__((__blocks__(byref)))"); builtin_define ("__block=__attribute__((__blocks__(byref)))"); } /* APPLE LOCAL radar 6230656 */ Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def Mon Nov 3 01:33:15 2008 @@ -89,7 +89,8 @@ ".section __TEXT,__picsymbolstub4,symbol_stubs,none,16", 0) /* APPLE LOCAL end ARM pic support */ DEF_SECTION (darwin_exception_section, 0, - ".section __DATA,__gcc_except_tab", 0) + /* APPLE LOCAL EH __TEXT __gcc_except_tab 5819051 */ + ".section __TEXT,__gcc_except_tab", 0) DEF_SECTION (darwin_eh_frame_section, 0, ".section " EH_FRAME_SECTION_NAME ",__eh_frame" EH_FRAME_SECTION_ATTR, 0) @@ -98,6 +99,12 @@ DEF_SECTION (objc_v2_message_refs_section, 0, ".section __DATA, __objc_msgrefs, coalesced", 0) /* APPLE LOCAL end radar 5575115 */ +/* APPLE LOCAL begin radar 6255595 */ +DEF_SECTION (objc_v2_classdefs_section, 0, + ".section __DATA, __objc_data", 0) +DEF_SECTION (objc_v2_metadata_section, 0, + ".section __DATA, __objc_const", 0) +/* APPLE LOCAL end radar 6255595 */ DEF_SECTION (objc_v2_classrefs_section, 0, ".section __DATA, __objc_classrefs, regular, no_dead_strip", 1) DEF_SECTION (objc_v2_classlist_section, 0, Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Mon Nov 3 01:33:15 2008 @@ -148,6 +148,10 @@ static const enum darwin_section_enum tomarkv2[] = { objc_v2_message_refs_section, + /* APPLE LOCAL begin radar 6255595 */ + objc_v2_classdefs_section, + objc_v2_metadata_section, + /* APPLE LOCAL end radar 6255595 */ objc_v2_classrefs_section, objc_v2_classlist_section, objc_v2_categorylist_section, @@ -1325,6 +1329,30 @@ return MACHOPIC_INDIRECT ? 3 : 0; } +/* APPLE LOCAL begin radar 5575115, 6255595 */ +/* This routine returns TRUE if EXP is a variable representing + on objective C meta data. */ +static inline bool +objc_internal_variable_name (tree exp) +{ + if (TREE_CODE (exp) == VAR_DECL) + { + tree decl_name = DECL_NAME (exp); + if (decl_name && TREE_CODE (decl_name) == IDENTIFIER_NODE + && IDENTIFIER_POINTER (decl_name)) + { + const char* name = IDENTIFIER_POINTER (decl_name); + return + (!strncmp (name, "_OBJC_", 6) + || !strncmp (name, "OBJC_", 5) + || !strncmp (name, "l_OBJC_", 7) + || !strncmp (name, "l_objc_", 7)); + } + } + return false; +} +/* APPLE LOCAL end radar 5575115, 6255595 */ + section * machopic_select_section (tree exp, int reloc, unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED) @@ -1423,14 +1451,9 @@ else return base_section; } - else if (TREE_CODE (exp) == VAR_DECL && - DECL_NAME (exp) && - TREE_CODE (DECL_NAME (exp)) == IDENTIFIER_NODE && - IDENTIFIER_POINTER (DECL_NAME (exp)) && - /* APPLE LOCAL begin radar 5575115 */ - (!strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6) - || !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "l_objc_", 7))) - /* APPLE LOCAL end radar 5575115 */ + /* APPLE LOCAL begin radar 5575115, 6255595 */ + else if (objc_internal_variable_name (exp)) + /* APPLE LOCAL end radar 5575115, 6255595 */ { const char *name = IDENTIFIER_POINTER (DECL_NAME (exp)); /* APPLE LOCAL begin radar 4792158 */ @@ -1505,8 +1528,8 @@ return darwin_sections[objc_v2_classrefs_section]; else if (!strncmp (name, "_OBJC_CLASSLIST_SUP_REFS_", 25)) return darwin_sections[objc_v2_super_classrefs_section]; - /* APPLE LOCAL radar 5575115 */ - else if (!strncmp (name, "l_objc_msgSend_", 15)) + /* APPLE LOCAL radar 5575115 - radar 6252174 */ + else if (!strncmp (name, "l_objc_msgSend", 14)) return darwin_sections[objc_v2_message_refs_section]; else if (!strncmp (name, "_OBJC_LABEL_CLASS_", 18)) return darwin_sections[objc_v2_classlist_section]; @@ -1524,8 +1547,14 @@ return darwin_sections[objc_v2_selector_refs_section]; else if (!strncmp (name, "_OBJC_IMAGE_INFO", 16)) return darwin_sections[objc_v2_image_info_section]; + /* APPLE LOCAL begin radar 6255595 */ + else if (!strncmp (name, "OBJC_CLASS_$_", 13) + || !strncmp (name, "OBJC_METACLASS_$_", 17)) + return darwin_sections[objc_v2_classdefs_section]; else - return base_section; + return (base_section == data_section) ? + darwin_sections[objc_v2_metadata_section] : base_section; + /* APPLE LOCAL end radar 6255595 */ } /* APPLE LOCAL end radar 4792158 */ } @@ -2158,6 +2187,8 @@ /* APPLE LOCAL begin pubtypes, approved for 4.3 4535968 */ DEBUG_PUBTYPES_SECTION, /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ + /* APPLE LOCAL radar 6275985 debug inlined section */ + DEBUG_INLINED_SECTION, DEBUG_STR_SECTION, DEBUG_RANGES_SECTION }; Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Mon Nov 3 01:33:15 2008 @@ -156,7 +156,8 @@ { "-seg_addr_table_filename", "-Zfn_seg_addr_table_filename" }, \ /* APPLE LOCAL mainline */ \ { "-umbrella", "-Zumbrella" }, \ - { "-fapple-kext", "-fapple-kext -static -Wa,-static" }, \ + /* APPLE LOCAL kext weak_import 5935650 */ \ + { "-fapple-kext", "-fapple-kext -static" }, \ { "-filelist", "-Xlinker -filelist -Xlinker" }, \ { "-findirect-virtual-calls", "-fapple-kext" }, \ { "-flat_namespace", "-Zflat_namespace" }, \ @@ -169,17 +170,20 @@ { "-install_name", "-Zinstall_name" }, \ /* LLVM LOCAL */ \ LLVM_FLAG \ - { "-mkernel", "-mkernel -static -Wa,-static" }, \ + /* APPLE LOCAL kext weak_import 5935650 */ \ + { "-mkernel", "-mkernel -static" }, \ { "-multiply_defined_unused", "-Zmultiplydefinedunused" }, \ { "-multiply_defined", "-Zmultiply_defined" }, \ { "-multi_module", "-Zmulti_module" }, \ - { "-static", "-static -Wa,-static" }, \ + /* APPLE LOCAL begin kext weak_import 5935650 */ \ + /* Removed -static */ \ + /* APPLE LOCAL end kext weak_import 5935650 */ \ /* APPLE LOCAL mainline */ \ { "-shared", "-Zdynamiclib" }, \ { "-single_module", "-Zsingle_module" }, \ { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \ - /* APPLE LOCAL ObjC GC */ \ - { "-fobjc-gc", "-fobjc-gc -Wno-non-lvalue-assign" }, \ + /* APPLE LOCAL radar 6269491 */ \ + /* code removed. */ \ /* APPLE LOCAL begin constant cfstrings */ \ { "-fconstant-cfstrings", "-mconstant-cfstrings" }, \ { "-fno-constant-cfstrings", "-mno-constant-cfstrings" }, \ @@ -576,11 +580,14 @@ /* APPLE LOCAL end ARM 5683689 */ /* Default Darwin ASM_SPEC, very simple. */ +/* APPLE LOCAL begin kext weak_import 5935650 */ /* APPLE LOCAL begin radar 4161346 */ #define ASM_SPEC "-arch %(darwin_arch) \ %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \ - %{!Zforce_cpusubtype_ALL:%{faltivec:-force_cpusubtype_ALL}}" + %{!Zforce_cpusubtype_ALL:%{faltivec:-force_cpusubtype_ALL}} \ + %{mkernel|static|fapple-kext:%{!Zdynamic:-static}}" /* APPLE LOCAL end radar 4161346 */ +/* APPLE LOCAL end kext weak_import 5935650 */ /* APPLE LOCAL begin mainline 4.3 2006-10-31 4370143 */ /* We still allow output of STABS. */ @@ -614,6 +621,8 @@ /* APPLE LOCAL begin pubtypes, approved for 4.3 4535968 */ #define DEBUG_PUBTYPES_SECTION "__DWARF,__debug_pubtypes,regular,debug" /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ +/* APPLE LOCAL radar 6275985 debug inlined section */ +#define DEBUG_INLINED_SECTION "__DWARF,__debug_inlined,regular,debug" #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" @@ -858,6 +867,13 @@ } while (0) /* APPLE LOCAL end radar 4531086 */ +/* APPLE LOCAL begin radar 6307941 */ +#undef OBJC2_ABI_DISPATCH +#define OBJC2_ABI_DISPATCH \ +(darwin_macosx_version_min \ + && strverscmp (darwin_macosx_version_min, "10.6") < 0) +/* APPLE LOCAL end radar 6307941 */ + /* The RTTI data (e.g., __ti4name) is common and public (and static), but it does need to be referenced via indirect PIC data pointers. The machopic_define_symbol calls are telling the machopic subsystem @@ -1238,7 +1254,8 @@ #undef ASM_PREFERRED_EH_DATA_FORMAT #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ - (((CODE) == 2 && (GLOBAL) == 1) \ + /* APPLE LOCAL EH __TEXT __gcc_except_tab 5819051 */ \ + ((((CODE) == 2 || (CODE) == 0) && (GLOBAL) == 1) \ ? (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) : \ ((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr) Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Mon Nov 3 01:33:15 2008 @@ -6880,6 +6880,20 @@ /* TLS references should always be enclosed in UNSPEC. */ if (SYMBOL_REF_TLS_MODEL (op0)) return false; + /* APPLE LOCAL begin 6227434 */ +#if TARGET_MACHO + /* ObjC machinery always has a legitimate PIC + address. */ + if (objc_anonymous_local_objc_name (XSTR (op0, 0)) + || SYMBOL_REF_LOCAL_P (op0)) + return true; + /* Under -mfix-and-continue, even local storage is + addressed via the GOT, so that the value of local + statics is preserved when a function is "fixed." */ + if (TARGET_FIX_AND_CONTINUE) + return false; +#endif + /* APPLE LOCAL end 6227434 */ if (!SYMBOL_REF_FAR_ADDR_P (op0) && SYMBOL_REF_LOCAL_P (op0)) return true; break; @@ -9615,10 +9629,7 @@ { int strict = (reload_in_progress || reload_completed); /* APPLE LOCAL dynamic-no-pic */ -#if TARGET_MACHO - rtx insn; -#endif - rtx op0, op1; + rtx insn, op0, op1; enum tls_model model; op0 = operands[0]; @@ -15923,14 +15934,14 @@ /* SSE4.1 */ { MASK_SSE4_1, CODE_FOR_sse4_1_packusdw, "__builtin_ia32_packusdw128", IX86_BUILTIN_PACKUSDW128, UNKNOWN, 0 }, { MASK_SSE4_1, CODE_FOR_sse4_1_eqv2di3, "__builtin_ia32_pcmpeqq", IX86_BUILTIN_PCMPEQQ, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_smaxv16qi3, "__builtin_ia32_pmaxsb128", IX86_BUILTIN_PMAXSB128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_smaxv4si3, "__builtin_ia32_pmaxsd128", IX86_BUILTIN_PMAXSD128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_umaxv4si3, "__builtin_ia32_pmaxud128", IX86_BUILTIN_PMAXUD128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_umaxv8hi3, "__builtin_ia32_pmaxuw128", IX86_BUILTIN_PMAXUW128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_sminv16qi3, "__builtin_ia32_pminsb128", IX86_BUILTIN_PMINSB128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_sminv4si3, "__builtin_ia32_pminsd128", IX86_BUILTIN_PMINSD128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_uminv4si3, "__builtin_ia32_pminud128", IX86_BUILTIN_PMINUD128, UNKNOWN, 0 }, - { MASK_SSE4_1, CODE_FOR_uminv8hi3, "__builtin_ia32_pminuw128", IX86_BUILTIN_PMINUW128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_smaxv16qi3, "__builtin_ia32_pmaxsb128", IX86_BUILTIN_PMAXSB128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_smaxv4si3, "__builtin_ia32_pmaxsd128", IX86_BUILTIN_PMAXSD128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_umaxv4si3, "__builtin_ia32_pmaxud128", IX86_BUILTIN_PMAXUD128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_umaxv8hi3, "__builtin_ia32_pmaxuw128", IX86_BUILTIN_PMAXUW128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_sminv16qi3, "__builtin_ia32_pminsb128", IX86_BUILTIN_PMINSB128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_sminv4si3, "__builtin_ia32_pminsd128", IX86_BUILTIN_PMINSD128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_uminv4si3, "__builtin_ia32_pminud128", IX86_BUILTIN_PMINUD128, UNKNOWN, 0 }, + { MASK_SSE4_1, CODE_FOR_sse4_1_uminv8hi3, "__builtin_ia32_pminuw128", IX86_BUILTIN_PMINUW128, UNKNOWN, 0 }, { MASK_SSE4_1, CODE_FOR_sse4_1_mulv2siv2di3, 0, IX86_BUILTIN_PMULDQ128, UNKNOWN, 0 }, { MASK_SSE4_1, CODE_FOR_mulv4si3, "__builtin_ia32_pmulld128", IX86_BUILTIN_PMULLD128, UNKNOWN, 0 }, Modified: llvm-gcc-4.2/trunk/gcc/coverage.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/coverage.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/coverage.c (original) +++ llvm-gcc-4.2/trunk/gcc/coverage.c Mon Nov 3 01:33:15 2008 @@ -77,13 +77,15 @@ static unsigned no_coverage = 0; /* Cumulative counter information for whole program. */ -static unsigned prg_ctr_mask; /* Mask of counter types generated. */ -static unsigned prg_n_ctrs[GCOV_COUNTERS]; /* Total counters allocated. */ +/* APPLE LOCAL begin 5834718 */ +static GTY (()) unsigned prg_ctr_mask; /* Mask of counter types generated. */ +static GTY (()) unsigned prg_n_ctrs[GCOV_COUNTERS]; /* Total counters allocated. */ /* Counter information for current function. */ -static unsigned fn_ctr_mask; /* Mask of counters used. */ -static unsigned fn_n_ctrs[GCOV_COUNTERS]; /* Counters allocated. */ -static unsigned fn_b_ctrs[GCOV_COUNTERS]; /* Allocation base. */ +static GTY (()) unsigned fn_ctr_mask; /* Mask of counters used. */ +static GTY (()) unsigned fn_n_ctrs[GCOV_COUNTERS]; /* Counters allocated. */ +static GTY (()) unsigned fn_b_ctrs[GCOV_COUNTERS]; /* Allocation base. */ +/* APPLE LOCAL end 5834718 */ /* Name of the output file for coverage output file. */ static char *bbg_file_name; Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/call.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/call.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/call.c Mon Nov 3 01:33:15 2008 @@ -797,7 +797,8 @@ /* Allow conversions among compatible ObjC pointer types (base conversions have been already handled above). */ else if (c_dialect_objc () - && objc_compare_types (to, from, -4, NULL_TREE)) + /* APPLE LOCAL radar 6231433 */ + && objc_compare_types (to, from, -4, NULL_TREE, NULL)) conv = build_conv (ck_ptr, to, conv); /* APPLE LOCAL end 4154928 */ else if (ptr_reasonably_similar (to_pointee, from_pointee)) Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Mon Nov 3 01:33:15 2008 @@ -2465,39 +2465,6 @@ return check_previous_goto_1 (NULL_TREE, level, level->names, false, NULL); } -/* APPLE LOCAL begin blocks 6040305 (cp) */ -/* This routine issues a diagnostic if a __block variable is seen in - the current scope. This is for now called from a goto statement. */ -void -diagnose_byref_var_in_current_scope (void) -{ -#if 0 - /* FIXME finish this off. */ - struct c_scope *scope; - struct c_binding *b; - - gcc_assert (current_scope); - if (flag_objc_gc_only || !current_scope->byref_in_current_scope) - return; - - scope = current_scope; - while (scope && scope != file_scope) - { - for (b = scope->bindings; b; b = b->prev) - { - tree p = b->decl; - if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) { - error ("local byref variable %s is in the scope of this goto", - IDENTIFIER_POINTER (DECL_NAME (p))); - return; - } - } - scope = scope->outer; - } -#endif -} -/* APPLE LOCAL end blocks 6040305 (cp) */ - /* Check that a new jump to a label DECL is OK. Called by finish_goto_stmt. */ @@ -2508,10 +2475,6 @@ bool saw_catch = false, identified = false; tree bad; - /* APPLE LOCAL begin 6040305 */ - diagnose_byref_var_in_current_scope (); - /* APPLE LOCAL end 6040305 */ - /* We can't know where a computed goto is jumping. So we assume that it's OK. */ if (TREE_CODE (decl) != LABEL_DECL) @@ -5494,12 +5457,12 @@ struct __Block_byref_x { // APPLE LOCAL radar 6244520 - void *isa; // NULL for everything except __weak pointers - struct Block_byref_x *forwarding; - int32_t flags; - int32_t size; - void *ByrefKeepFuncPtr; // Only if variable is __byref ObjC object - void *ByrefDestroyFuncPtr; // Only if variable is __byref ObjC object + void *__isa; // NULL for everything except __weak pointers + struct Block_byref_x *__forwarding; + int32_t __flags; + int32_t __size; + void *__ByrefKeepFuncPtr; // Only if variable is __block ObjC object + void *__ByrefDestroyFuncPtr; // Only if variable is __block ObjC object typex x; } x; */ @@ -5523,36 +5486,36 @@ Block_byref_type = block_start_struct (get_identifier (string)); /* APPLE LOCAL begin radar 6244520 */ - /* void *isa; */ - field = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); + /* void *__isa; */ + field = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); fields = field; /* APPLE LOCAL end radar 6244520 */ - /* struct Block_byref_x *forwarding; */ - field = build_decl (FIELD_DECL, get_identifier ("forwarding"), + /* struct Block_byref_x *__forwarding; */ + field = build_decl (FIELD_DECL, get_identifier ("__forwarding"), build_pointer_type (Block_byref_type)); /* APPLE LOCAL radar 6244520 */ chainon (fields, field); - /* int32_t flags; */ - field = build_decl (FIELD_DECL, get_identifier ("flags"), + /* int32_t __flags; */ + field = build_decl (FIELD_DECL, get_identifier ("__flags"), unsigned_type_node); chainon (fields, field); - /* int32_t size; */ - field = build_decl (FIELD_DECL, get_identifier ("size"), + /* int32_t __size; */ + field = build_decl (FIELD_DECL, get_identifier ("__size"), unsigned_type_node); chainon (fields, field); if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) { - /* void *ByrefKeepFuncPtr; */ - field = build_decl (FIELD_DECL, get_identifier ("ByrefKeepFuncPtr"), + /* void *__ByrefKeepFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("__ByrefKeepFuncPtr"), ptr_type_node); chainon (fields, field); - /* void *ByrefDestroyFuncPtr; */ - field = build_decl (FIELD_DECL, get_identifier ("ByrefDestroyFuncPtr"), + /* void *__ByrefDestroyFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("__ByrefDestroyFuncPtr"), ptr_type_node); chainon (fields, field); } @@ -5580,7 +5543,7 @@ { NULL, &x, 0, sizeof(struct __Block_byref_x)}; when INIT is NULL_TREE - For __byref ObjC objects, it also adds "byref_keep" and "byref_destroy" + For __block ObjC objects, it also adds "byref_keep" and "byref_destroy" Funtion pointers. So the most general initializers would be: { NULL, &x, 0, sizeof(struct __Block_byref_x), &byref_keep, &byref_destroy, @@ -5817,7 +5780,7 @@ if (DECL_EXTERNAL (decl) || TREE_STATIC (decl)) { warning (0, - "__byref attribute is only allowed on local variables - ignored"); + "__block attribute is only allowed on local variables - ignored"); COPYABLE_BYREF_LOCAL_VAR (decl) = 0; COPYABLE_BYREF_LOCAL_NONPOD (decl) = 0; } @@ -11554,6 +11517,82 @@ } +/* APPLE LOCAL begin warn missing prototype 6261539 */ +static bool +fn_previously_found (tree decl, tree olddecl) +{ + int types_match; + + if (olddecl == 0) + return false; + + if (TREE_CODE (olddecl) == OVERLOAD) + { + if (OVL_CHAIN (olddecl) == NULL_TREE) + olddecl = OVL_CURRENT (olddecl); + else + { + tree match; + for (match = olddecl; match; match = OVL_NEXT (match)) + { + if (fn_previously_found (decl, OVL_CURRENT (match))) + return true; + } + return false; + } + } + + /* Don't warn about previously erroneous things that have the same + name. */ + if (TREE_TYPE (olddecl) == error_mark_node) + return true; + + /* Internally defined things still need a prototype to escape the + warning. */ + if (DECL_ARTIFICIAL (olddecl)) + return false; + + if (TREE_CODE (olddecl) != FUNCTION_DECL) + return false; + + /* These will match or error, don't also spew prototype warnings. */ + if (DECL_EXTERN_C_P (olddecl) + && DECL_EXTERN_C_P (decl)) + return true; + + /* These will match or error, don't also spew prototype warnings. */ + if (compparms (TYPE_ARG_TYPES (TREE_TYPE (decl)), + TYPE_ARG_TYPES (TREE_TYPE (olddecl)))) + return true; + + types_match = decls_match (decl, olddecl); + + if (types_match) + return true; + + return false; +} + +inline static void +check_missing_prototype (tree decl) +{ + if (warn_missing_prototypes + && namespace_bindings_p () + && TREE_PUBLIC (decl) + && !DECL_MAIN_P (decl) + && DECL_NON_THUNK_FUNCTION_P (decl) + && ! DECL_FUNCTION_MEMBER_P (decl) + && DECL_NAMESPACE_SCOPE_P (decl) + && ! decl_anon_ns_mem_p (decl) + && ! DECL_DECLARED_INLINE_P (decl)) + { + tree olddecl = namespace_binding (DECL_NAME (decl), DECL_CONTEXT (decl)); + if (!fn_previously_found (decl, olddecl)) + warning (OPT_Wmissing_prototypes, "no previous prototype for %q+D", decl); + } +} +/* APPLE LOCAL end warn missing prototype 6261539 */ + /* Like start_preparsed_function, except that instead of a FUNCTION_DECL, this function takes DECLSPECS and DECLARATOR. @@ -11586,6 +11625,10 @@ gcc_assert (same_type_p (TREE_TYPE (TREE_TYPE (decl1)), integer_type_node)); + /* APPLE LOCAL begin warn missing prototype 6261539 */ + check_missing_prototype (decl1); + /* APPLE LOCAL end warn missing prototype 6261539 */ + start_preparsed_function (decl1, attrs, /*flags=*/SF_DEFAULT); return 1; Modified: llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/name-lookup.c Mon Nov 3 01:33:15 2008 @@ -4039,12 +4039,12 @@ if (binding) { - /* APPLE LOCAL begin 6322334 */ - /* Ick, we don't want to find a hidden friend inside a - local class! */ - if (hidden_name_p (binding)) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); - /* APPLE LOCAL end 6322334 */ + /* APPLE LOCAL begin 6322334 */ + /* Ick, we don't want to find a hidden friend inside a + local class! */ + if (hidden_name_p (binding)) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); + /* APPLE LOCAL end 6322334 */ val = binding; break; Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Mon Nov 3 01:33:15 2008 @@ -2794,6 +2794,12 @@ error ("unknown property attribute"); break; } + /* APPLE LOCAL begin radar 6302949 */ + if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA) + && cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN) + && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF)) + warning (0, "property attributes must be separated by a comma"); + /* APPLE LOCAL end radar 6302949 */ if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) cp_lexer_consume_token (parser->lexer); token = cp_lexer_peek_token (parser->lexer); @@ -19451,6 +19457,15 @@ if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)) cp_type = cp_parser_type_id (parser); + /* APPLE LOCAL begin radar 6261630 */ + if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ATTRIBUTE)) + { + /* Chain on the trailing attribute. */ + tree attrs = chainon (NULL_TREE, + cp_parser_attributes_opt (parser)); + cplus_decl_attributes (&cp_type, attrs, 0); + } + /* APPLE LOCAL end radar 6261630 */ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); typename = build_tree_list (proto_quals, cp_type); } @@ -19753,8 +19768,8 @@ /* APPLE LOCAL begin radar 4290840 */ /* Check for all possibilities of illegal lookahead tokens. */ ptk = cp_lexer_peek_token (parser->lexer); - if (!(ptk->type == CPP_PLUS || ptk->type == CPP_MINUS - || ptk->type == CPP_EOF || ptk->keyword == RID_AT_END)) + /* APPLE LOCAL radar 6271728 */ + if (ptk->type == CPP_OPEN_BRACE) { perform_deferred_access_checks (); stop_deferring_access_checks (); @@ -19763,6 +19778,10 @@ pop_deferring_access_checks (); objc_finish_method_definition (meth); } + /* APPLE LOCAL begin radar 6271728 */ + else + cp_parser_require (parser, CPP_OPEN_BRACE, "`{'"); + /* APPLE LOCAL end radar 6271728 */ /* APPLE LOCAL end radar 4290840 */ } /* APPLE LOCAL begin C* interface */ @@ -20519,18 +20538,175 @@ } /* APPLE LOCAL end radar 6214617 */ -static tree block_copy_assign_decl; -static tree block_destroy_decl; +/* APPLE LOCAL begin radar 6175959 */ +static GTY(()) tree block_copy_assign_decl; +static GTY(()) tree block_object_assign_decl; +static GTY(()) tree block_destroy_decl; +static GTY(()) tree block_object_dispose_func_decl; +/* APPLE LOCAL end radar 6175959 */ + +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ +/** build_descriptor_block_decl - + This routine builds a static block_descriptior variable of type: + struct __block_descriptor; and initializes it to: + {0, sizeof(struct literal_block_n), + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + } +*/ +static tree +build_descriptor_block_decl (tree block_struct_type, struct block_sema_info *block_impl) +{ + extern tree create_tmp_var_raw (tree, const char *); + static int desc_unique_count; + int size; + tree helper_addr; + tree decl, constructor; + char name [32]; + VEC(constructor_elt,gc) *impl_v = NULL; + tree descriptor_type = + TREE_TYPE (build_block_descriptor_type (block_impl->BlockHasCopyDispose)); + + sprintf (name, "__block_descriptor_tmp_%d", ++desc_unique_count); + decl = create_tmp_var_raw (descriptor_type, name); + DECL_CONTEXT (decl) = NULL_TREE; + + /* Initialize "reserved" field to 0 for now. */ + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (long_unsigned_type_node, 0)); + + /* Initialize "Size" field. */ + size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (long_unsigned_type_node, size)); + + if (block_impl->BlockHasCopyDispose) + { + /* Initialize "CopyFuncPtr" and "DestroyFuncPtr" fields. */ + /* Helpers were previously generated completeley as a nested + function (and context was required for code gen.) But they are not, + so context must be set to NULL so initialization logic does not complain. */ + DECL_CONTEXT (block_impl->copy_helper_func_decl) = NULL_TREE; + helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, helper_addr); + + DECL_CONTEXT (block_impl->destroy_helper_func_decl) = NULL_TREE; + helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); + helper_addr = convert (ptr_type_node, helper_addr); + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, helper_addr); + } + /* Create a CONSTRUCTOR to represent the braced-initializer. */ + constructor = make_node (CONSTRUCTOR); + CONSTRUCTOR_ELTS (constructor) = impl_v; + TREE_PUBLIC (decl) = 0; + TREE_STATIC (decl) = 1; + cp_finish_decl (decl, constructor, 0, 0, LOOKUP_ONLYCONVERTING); + return decl; +} + +/* APPLE LOCAL begin radar 6300081 */ +/* This function builds a "generic" block struct type, to be passed + into the debug information for blocks pointers, to allow gdb to + find the actual function pointer for the block. Any time the Blocks + structure layout changes, this may also need to change. + + Currently a block pointer is a pointer to a __block_literal_n struct, + the third field of which is a pointer to a __block_descriptor struct, + whose third field is the function pointer. There are other fields as + well, but these are the ones gdb needs to know about to find the + function pointer. Therefore a generic block struct currently looks + like this: + + struct __block_literal_generic + { + void * __isa; + int __flags; + int __reserved; + void *__FuncPtr; + struct __block_descriptor + { + unsigned long int reserved; + unsigned long int Size; + } *__descriptor; + }; + + IF AT ANY TIME THE STRUCTURE OF A __BLOCK_LITERAL_N CHANGES, THIS + MUST BE CHANGED ALSO!! + +*/ + +tree +build_generic_block_struct_type (void) +{ + tree fields = NULL_TREE; + tree field; + tree block_struct_type; + + push_to_top_level (); + block_struct_type = xref_tag (record_type, + get_identifier ("__block_literal_generic"), + ts_current, false); + xref_basetypes (block_struct_type, NULL_TREE); + CLASSTYPE_DECLARED_CLASS (block_struct_type) = 0; + pushclass (block_struct_type); + + field = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + field = build_decl (FIELD_DECL, get_identifier ("__flags"), + integer_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + field = build_decl (FIELD_DECL, get_identifier ("__reserved"), + integer_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + field = build_decl (FIELD_DECL, get_identifier ("__FuncPtr"), + ptr_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + field = build_decl (FIELD_DECL, get_identifier ("__descriptor"), + build_block_descriptor_type (false)); + TREE_CHAIN (field) = fields; + fields = field; + + TYPE_FIELDS (block_struct_type) = fields; + TYPE_NAME (block_struct_type) = build_decl (TYPE_DECL, + get_identifier ("__block_literal_generic"), + block_struct_type); + TYPE_STUB_DECL (block_struct_type) = TYPE_NAME (block_struct_type); + TYPE_BLOCK_IMPL_STRUCT (block_struct_type) = 1; + finish_struct (block_struct_type, NULL_TREE); + pop_from_top_level (); + + return block_struct_type; +} +/* APPLE LOCAL end radar 6300081 */ /** build_block_struct_type - - struct block_1 { - struct invok_impl impl; - void *CopyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set - void *DestroyFuncPtr; // only if BLOCK_HAS_COPY_DISPOSE is set + struct __block_literal_n { + void *__isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int __flags; + int __reserved; + void *__FuncPtr; + + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct __block_literal_n) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + } *__descriptor; + + // imported variables int x; // ref variable list ... int *y; // byref variable list }; - */ +*/ static tree build_block_struct_type (struct block_sema_info * block_impl) { @@ -20538,9 +20714,6 @@ char buffer[32]; static int unique_count; tree block_struct_type; - /* build struct invok_impl */ - if (!invoke_impl_ptr_type) - build_block_internal_types (); /* Check and see if this block is required to have a Copy/Dispose helper function. If yes, set BlockHasCopyDispose to TRUE. */ @@ -20559,7 +20732,7 @@ /* APPLE LOCAL end radar 6214617 */ } - /* Further check to see that we have __byref variables which require + /* Further check to see that we have __block variables which require Copy/Dispose helpers. */ for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) @@ -20569,29 +20742,43 @@ break; } - sprintf(buffer, "__block_%d", ++unique_count); + sprintf(buffer, "__block_literal_%d", ++unique_count); push_to_top_level (); - /* block_struct_type = start_struct (RECORD_TYPE, get_identifier (buffer)); */ - block_struct_type = make_aggr_type (RECORD_TYPE); + /* APPLE LOCAL begin radar 6243400 */ + block_struct_type = xref_tag (record_type, get_identifier (buffer), ts_current, false); xref_basetypes (block_struct_type, NULL_TREE); + CLASSTYPE_DECLARED_CLASS (block_struct_type) = 0; + pushclass (block_struct_type); + /* APPLE LOCAL end radar 6243400 */ + /* void * __isa; */ + field = build_decl (FIELD_DECL, get_identifier ("__isa"), ptr_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + /* int __flags. */ + field = build_decl (FIELD_DECL, get_identifier ("__flags"), integer_type_node); + TREE_CHAIN (field) = fields; + fields = field; + + /* int __reserved. */ + field = build_decl (FIELD_DECL, get_identifier ("__reserved"), integer_type_node); + TREE_CHAIN (field) = fields; + fields = field; - /* struct invok_impl impl; */ - field = build_decl (FIELD_DECL, get_identifier ("impl"), - TREE_TYPE (invoke_impl_ptr_type)); + /* void *__FuncPtr. */ + field = build_decl (FIELD_DECL, get_identifier ("__FuncPtr"), + ptr_type_node); TREE_CHAIN (field) = fields; fields = field; + + /* struct __block_descriptor *__descriptor */ + field = build_decl (FIELD_DECL, get_identifier ("__descriptor"), + build_block_descriptor_type (block_impl->BlockHasCopyDispose)); + TREE_CHAIN (field) = fields; + fields = field; + if (block_impl->BlockHasCopyDispose) { - /* void *CopyFuncPtr; */ - field = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), - ptr_type_node); - TREE_CHAIN (field) = fields; - fields = field; - /* void *DestroyFuncPtr; */ - field = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), - ptr_type_node); - TREE_CHAIN (field) = fields; - fields = field; /* If inner block of a nested block has BlockHasCopyDispose, so does its outer block. */ if (block_impl->prev_block_info) @@ -20622,33 +20809,27 @@ fields = field; } + /* APPLE LOCAL begin radar 6243400 */ + TYPE_FIELDS (block_struct_type) = fields; + TYPE_NAME (block_struct_type) = + build_decl (TYPE_DECL, get_identifier (buffer), block_struct_type); + TYPE_STUB_DECL (block_struct_type) = TYPE_NAME (block_struct_type); + finish_struct (block_struct_type, NULL_TREE); pop_from_top_level (); - /* finish_struct (block_struct_type, field_decl_chain, NULL_TREE); */ - finish_builtin_struct (block_struct_type, buffer, - fields, NULL_TREE); - /* APPLE LOCAL begin radar 6169527 */ - /* This type is now a full-blown c++ struct and as such, this field must - be set. */ - CLASSTYPE_AS_BASE (block_struct_type) = block_struct_type; - /* APPLE LOCAL end radar 6169527 */ - /* Zap out the name so that the back-end will give us the debugging - information for this anonymous RECORD_TYPE. */ - TYPE_NAME (block_struct_type) = NULL_TREE; - + /* APPLE LOCAL end radar 6243400 */ return block_struct_type; } /** build_block_struct_initlist - builds the initializer list: - { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, - BLOCK_HAS_CXX_OBJ | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, - sizeof(struct block_1), - helper_1 - }, - copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - x, - &y + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // __isa, + BLOCK_HAS_DESCRIPTOR | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags, + 0, // __reserved, + &helper_1, // __FuncPtr, + &static_descriptor_variable // __descriptor, + x, // user variables. + &y + ... } */ /* APPLE LOCAL begin radar 6169527 */ @@ -20658,14 +20839,12 @@ build_block_struct_initlist (tree block_struct_type, struct block_sema_info *block_impl) { - int size; - tree helper_addr, chain; - unsigned flags = 0; + tree expr, chain, helper_addr; + unsigned flags = BLOCK_HAS_DESCRIPTOR; static tree NSConcreteStackBlock_decl = NULL_TREE; static tree NSConcreteGlobalBlock_decl = NULL_TREE; - tree impl_constructor; VEC(constructor_elt,gc) *impl_v = NULL; - VEC(constructor_elt,gc) *v = NULL; + tree descriptor_block_decl = build_descriptor_block_decl (block_struct_type, block_impl); if (block_impl->BlockHasCopyDispose) /* Note! setting of this flag merely indicates to the runtime that @@ -20677,8 +20856,11 @@ if (block_impl->BlockImportsCxxObjects) flags |= BLOCK_HAS_CXX_OBJ; /* APPLE LOCAL end radar 6214617 */ - - if (!current_function_decl) + /* APPLE LOCAL begin radar 6230297 */ + if (!current_function_decl || + (block_impl->block_ref_decl_list == NULL_TREE && + block_impl->block_byref_decl_list == NULL_TREE)) + /* APPLE LOCAL end radar 6230297 */ { /* This is a global block. */ /* Find an existing declaration for _NSConcreteGlobalBlock or declare @@ -20719,56 +20901,76 @@ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_fold_addr_expr (NSConcreteStackBlock_decl)); } - CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (unsigned_type_node, flags)); - - size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type)); - CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (unsigned_type_node, size)); - + /* __flags */ + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (integer_type_node, flags)); + /* __reserved */ + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (integer_type_node, 0)); + /* __FuncPtr */ helper_addr = build_fold_addr_expr (block_impl->helper_func_decl); - /* mark_used (block_impl->helper_func_decl); */ helper_addr = convert (ptr_type_node, helper_addr); CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, helper_addr); - - impl_constructor = make_node (CONSTRUCTOR); - CONSTRUCTOR_ELTS (impl_constructor) = impl_v; - CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, impl_constructor); - if (block_impl->BlockHasCopyDispose) - { - helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl); - helper_addr = convert (ptr_type_node, helper_addr); - CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, helper_addr); - helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl); - helper_addr = convert (ptr_type_node, helper_addr); - CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, helper_addr); - } + /* &static_descriptor_variable initializer */ + expr = build_fold_addr_expr (descriptor_block_decl); + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, expr); + for (chain = block_impl->block_original_ref_decl_list; chain; chain = TREE_CHAIN (chain)) { tree y = TREE_VALUE (chain); TREE_USED (y) = 1; - CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, copy_in_object (y)); + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, copy_in_object (y)); } - for (chain = block_impl->block_original_byref_decl_list; chain; + for (chain = block_impl->block_byref_decl_list; chain; chain = TREE_CHAIN (chain)) { - tree y = TREE_VALUE (chain); + tree y = lookup_name (DECL_NAME (TREE_VALUE (chain))); + tree forwarding_expr; + gcc_assert (y); TREE_USED (y) = 1; - y = build_fold_addr_expr (y); - CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, y); + if (COPYABLE_BYREF_LOCAL_VAR (y)) + { + /* For variables declared __block, either the original one + at the point of declaration or the imported version (which is + initialized in the helper function's prologue) is used to + initilize the byref variable field in the temporary. */ + if (TREE_CODE (TREE_TYPE (y)) != RECORD_TYPE) + y = build_indirect_ref (y, "unary *"); + /* We will be using the __block_struct_variable.__forwarding as the + initializer. */ + forwarding_expr = build_component_ref (y, get_identifier ("__forwarding")); + } + else + /* Global variable is always assumed passed by its address. */ + forwarding_expr = build_fold_addr_expr (y); + + CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, forwarding_expr); } - return v; + return impl_v; } /* APPLE LOCAL end radar 6169527 */ +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ /** build_block_literal_tmp - This routine: 1) builds block type: - struct block_1 { - struct invok_impl impl; - void *CopyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE - void *DestroyFuncPtr; // only if block BLOCK_HAS_COPY_DISPOSE + struct __block_literal_n { + void *__isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int __flags; + int __reserved; + void *__FuncPtr; + + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct Block_literal_1) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE + } *__descriptor; + + // imported variables int x; // ref variable list ... int *y; // byref variable list }; @@ -20780,10 +20982,14 @@ struct block_1 I = { { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, BLOCK_HAS_CXX_OBJ | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, - sizeof(struct block_1), - helper_1 }, - copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE - destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + 0, // reserved, + &helper_1, + &{ + NULL, + sizeof(struct block_1), + copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE + }, x, &y }; @@ -20799,13 +21005,19 @@ tree block_holder_tmp_decl; tree constructor; tree block_struct_type = TREE_TYPE (block_impl->block_arg_ptr_type); - + /* APPLE LOCAL begin radar 6230297 */ + bool staticBlockTmp = (block_impl->block_ref_decl_list == NULL_TREE && + block_impl->block_byref_decl_list == NULL_TREE); block_holder_tmp_decl = create_tmp_var_raw (block_struct_type, name); /* Context will not be known until when the literal is synthesized. This is more so in the case of nested block literal blocks. */ maybe_push_decl (block_holder_tmp_decl); - DECL_CONTEXT (block_holder_tmp_decl) = current_function_decl; + DECL_CONTEXT (block_holder_tmp_decl) = staticBlockTmp ? NULL_TREE + : current_function_decl; + if (staticBlockTmp) + DECL_CONTEXT (block_impl->helper_func_decl) = NULL_TREE; + /* APPLE LOCAL end radar 6230297 */ DECL_ARTIFICIAL (block_holder_tmp_decl) = 1; /* Create a CONSTRUCTOR to represent the braced-initializer. */ @@ -20814,7 +21026,8 @@ CONSTRUCTOR_ELTS (constructor) = build_block_struct_initlist (block_struct_type, block_impl); /* Temporary representing a global block is made global static. */ - if (global_bindings_p ()) { + /* APPLE LOCAL radar 6230297 */ + if (staticBlockTmp || global_bindings_p ()) { TREE_PUBLIC (block_holder_tmp_decl) = 0; TREE_STATIC (block_holder_tmp_decl) = 1; } @@ -20851,7 +21064,7 @@ DECL_ARG_TYPE (dst_arg) = block_impl->block_arg_ptr_type; src_arg = build_decl (PARM_DECL, get_identifier ("_src"), block_impl->block_arg_ptr_type); - DECL_CONTEXT (dst_arg) = cur_block->copy_helper_func_decl; + DECL_CONTEXT (src_arg) = cur_block->copy_helper_func_decl; TREE_USED (src_arg) = 1; DECL_ARG_TYPE (src_arg) = block_impl->block_arg_ptr_type; /* arg_info = xcalloc (1, sizeof (struct c_arg_info)); */ @@ -20879,6 +21092,8 @@ /* APPLE LOCAL radar 6214617 */ if (cp_block_requires_copying (TREE_VALUE (chain))) { + /* APPLE LOCAL begin radar 6175959 */ + tree which_function_decl = NULL_TREE; tree p = TREE_VALUE (chain); tree dst_block_component, src_block_component; dst_block_component = build_component_ref (build_indirect_ref (dst_arg, "->"), @@ -20888,27 +21103,25 @@ if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) { - tree func_params, call_exp; - /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure) */ - /* Build a: void _Block_copy_assign (void *, void *) if not done + /* _Block_copy_assign(&_dest->myImportedBlock, _src->myImportedClosure, 0) */ + /* Build a: void _Block_copy_assign (void *, void *, int) if not done already. */ - if (!block_copy_assign_decl) + /* APPLE LOCAL begin radar 6310599 */ + if (!block_copy_assign_decl && + !(block_copy_assign_decl = lookup_name (get_identifier ("_Block_copy_assign")))) + /* APPLE LOCAL end radar 6310599 */ { tree func_type = build_function_type (void_type_node, tree_cons (NULL_TREE, ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node)))); block_copy_assign_decl = builtin_function ("_Block_copy_assign", func_type, - 0, NOT_BUILT_IN, 0, NULL_TREE); + 0, NOT_BUILT_IN, 0, NULL_TREE); TREE_NOTHROW (block_copy_assign_decl) = 0; } - dst_block_component = build_fold_addr_expr (dst_block_component); - func_params = tree_cons (NULL_TREE, dst_block_component, - tree_cons (NULL_TREE, src_block_component, - NULL_TREE)); - call_exp = build_function_call (block_copy_assign_decl, func_params); - add_stmt (call_exp); + which_function_decl = block_copy_assign_decl; } /* APPLE LOCAL begin radar 6214617 */ else if (TYPE_HAS_CONSTRUCTOR (TREE_TYPE (p)) @@ -20921,14 +21134,38 @@ /* APPLE LOCAL end radar 6214617 */ else { - /* _dest-> imported_object_x = [_src->imported_object_x retain] */ - tree rhs, store; - /* [_src->imported_object_x retain] */ - rhs = retain_block_component (src_block_component); - store = build_modify_expr (dst_block_component, NOP_EXPR, rhs); - add_stmt (store); + /* _Block_object_assign(&_dest->myImportedBlock, _src->myImportedClosure, 0) */ + /* Build a: void _Block_object_assign (void *, void *, int) if not done + already. */ + if (!block_object_assign_decl && + !(block_object_assign_decl = lookup_name (get_identifier ("_Block_object_assign")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node)))); + + block_object_assign_decl = builtin_function ("_Block_object_assign", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_object_assign_decl) = 0; } + which_function_decl = block_object_assign_decl; + } + if (which_function_decl) + { + tree func_params, call_exp; + dst_block_component = build_fold_addr_expr (dst_block_component); + func_params = tree_cons (NULL_TREE, dst_block_component, + tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), + NULL_TREE))); + call_exp = build_function_call (which_function_decl, func_params); + add_stmt (call_exp); } + /* APPLE LOCAL end radar 6175959 */ + } /* For each __block declared variable used in |...| Must generate call to: _Block_byref_assign_copy(&_dest->myImportedBlock, _src->myImportedBlock) @@ -20964,6 +21201,30 @@ /* free (arg_info); */ } +/* APPLE LOCAL begin radar 6175959 */ +static tree +block_object_dispose (tree src_block_component) +{ + tree func_params; + if (!block_object_dispose_func_decl && + !(block_object_dispose_func_decl = lookup_name (get_identifier ("_Block_object_dispose")))) + { + tree func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node))); + + block_object_dispose_func_decl = builtin_function ("_Block_object_dispose", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_object_dispose_func_decl) = 0; + } + func_params = tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), NULL_TREE)); + return build_function_call (block_object_dispose_func_decl, func_params); +} +/* APPLE LOCAL end radar 6175959 */ + static void synth_destroy_helper_block_func (struct block_sema_info * block_impl) { @@ -21010,22 +21271,27 @@ if (TREE_CODE (TREE_TYPE (p)) == BLOCK_POINTER_TYPE) { tree func_params, call_exp; + /* APPLE LOCAL begin radar 6175959 */ /* _Block_destroy(_src->myImportedClosure); */ /* _Block_destroy (void *); */ /* Build a: void _Block_destroy (void *) if not done already. */ if (!block_destroy_decl && - !(block_destroy_decl = lookup_name (get_identifier ("_Block_destroy")))) + !(block_destroy_decl = lookup_name (get_identifier ("_Block_destroy")))) { tree func_type = build_function_type (void_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, integer_type_node, void_list_node))); block_destroy_decl = builtin_function ("_Block_destroy", func_type, - 0, NOT_BUILT_IN, 0, NULL_TREE); + 0, NOT_BUILT_IN, 0, NULL_TREE); TREE_NOTHROW (block_destroy_decl) = 0; } - func_params = tree_cons (NULL_TREE, src_block_component, NULL_TREE); + func_params = tree_cons (NULL_TREE, src_block_component, + tree_cons (NULL_TREE, + build_int_cst (integer_type_node, 0), NULL_TREE)); call_exp = build_function_call (block_destroy_decl, func_params); + /* APPLE LOCAL end radar 6175959 */ add_stmt (call_exp); } /* APPLE LOCAL begin radar 6214617 */ @@ -21040,13 +21306,15 @@ else { tree rel_exp; - /* [_src->imported_object_0 release]; */ - rel_exp = release_block_component (src_block_component); + /* APPLE LOCAL begin radar 6175959 */ + /* _Block_object_dispose(_src->imported_object_0, 0); */ + rel_exp = block_object_dispose (src_block_component); + /* APPLE LOCAL end radar 6175959 */ add_stmt (rel_exp); } } - /* For each __byref declared variable used in |...| Must generate call to: + /* For each __block declared variable used in |...| Must generate call to: _Block_byref_release(_src->myImportedClosure) */ for (chain = block_impl->block_byref_decl_list; chain; @@ -21239,6 +21507,8 @@ /* APPLE LOCAL begin radar 6237713 */ if (cp_lexer_peek_token (parser->lexer)->keyword == RID_ATTRIBUTE) attributes = cp_parser_attributes_opt (parser); + /* APPLE LOCAL radar 6246527 */ + any_recognized_block_attribute (attributes); decl_attributes (&cur_block->helper_func_decl, attributes, 0); /* APPLE LOCAL end radar 6237713 */ @@ -21355,17 +21625,19 @@ /* APPLE LOCAL begin blocks 6040305 (ch) */ /* build_byref_local_var_access - converts EXPR to: - EXPR.forwarding->. + EXPR.__forwarding->. */ tree build_byref_local_var_access (tree expr, tree decl_name) { - tree exp = build_component_ref (expr, get_identifier ("forwarding")); + tree exp = build_component_ref (expr, get_identifier ("__forwarding")); exp = build_indirect_ref (exp, "unary *"); exp = build_component_ref (exp, decl_name); return exp; } +#define BINDING_VALUE(b) ((b)->value) + /** build_block_byref_decl - This routine inserts a variable declared as a 'byref' variable using the |...| syntax in helper function's outer-most scope. @@ -21373,13 +21645,67 @@ tree build_block_byref_decl (tree name, tree decl, tree exp) { + tree ptr_type, byref_decl; + /* APPLE LOCAL begin radar 6225809 */ + if (cur_block->prev_block_info) { + /* Traverse enclosing blocks. Insert a __block variable in + each enclosing block which has no declaration of this + variable. This is to ensure that the current (inner) block + gets the __block version of the variable; */ + struct block_sema_info *cb = cur_block->prev_block_info; + while (cb) { + struct cxx_binding *b = I_SYMBOL_BINDING (name); + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + /* Find the first declaration not in current block. */ + while (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) == cur_block->helper_func_decl) + { + /* FIXME: This can't happen?! */ + abort (); + /* b = b->previous; */ + } + + gcc_assert (b); + gcc_assert (BINDING_VALUE (b)); + gcc_assert (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL); + + /* Is the next declaration not in the enclosing block? */ + if (b && BINDING_VALUE (b) + && (TREE_CODE (BINDING_VALUE (b)) == VAR_DECL + || TREE_CODE (BINDING_VALUE (b)) == PARM_DECL) + && DECL_CONTEXT (BINDING_VALUE (b)) != cb->helper_func_decl) + { + /* No declaration of variable seen in the block. Must insert one. */ + /* FIXME: does this push enough? scope? */ + struct cp_binding_level *save_scope = current_binding_level; + struct block_sema_info *save_current_block = cur_block; + tree save_current_function_decl = current_function_decl; + current_binding_level = cb->cp_the_scope; + cur_block = cb; + current_function_decl = cb->helper_func_decl; + decl = build_block_byref_decl (name, decl, exp); + cur_block = save_current_block; + current_binding_level = save_scope; + current_function_decl = save_current_function_decl; + } + cb = cb->prev_block_info; + } + } + /* APPLE LOCAL end radar 6225809 */ + /* If it is already a byref declaration, do not add the pointer type because such declarations already have the pointer type added. This happens when we have two nested byref declarations in nested blocks. */ - tree ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) - ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); - tree byref_decl = build_decl (VAR_DECL, name, ptr_type); + ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) + ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); + byref_decl = build_decl (VAR_DECL, name, ptr_type); DECL_CONTEXT (byref_decl) = current_function_decl; BLOCK_DECL_BYREF (byref_decl) = 1; @@ -21401,8 +21727,8 @@ /* APPLE LOCAL end radar 6083129 - byref escapes (cp) */ cur_block->block_byref_decl_list = tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); - cur_block->block_original_byref_decl_list = - tree_cons (NULL_TREE, exp, cur_block->block_original_byref_decl_list); + /* APPLE LOCAL radar 5847213 */ + /* build of block_original_byref_decl_list us removed. */ /* APPLE LOCAL begin radar 6144664 */ DECL_SOURCE_LOCATION (byref_decl) = DECL_SOURCE_LOCATION (cur_block->helper_func_decl); @@ -21410,8 +21736,6 @@ return byref_decl; } -#define BINDING_VALUE(b) ((b)->value) - /** build_block_ref_decl - This routine inserts a copied-in variable (a variable referenced in the block but whose scope is outside the block) in helper @@ -21525,64 +21849,74 @@ return ref_decl; } -/** build_block_internal_types - This routine builds the block type: - struct __invoke_impl { - void *isa; - int32_t Flags; - int32_t Size; - void *FuncPtr; - } *invoke_impl_ptr_type; - */ -void -build_block_internal_types (void) +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ +static GTY (()) tree descriptor_ptr_type; +static GTY (()) tree descriptor_ptr_type_with_copydispose; +/** build_block_descriptor_type - This routine builds following internal type: + struct __block_descriptor { + unsigned long int reserved; // NULL + unsigned long int Size; // sizeof(struct Block_literal_1) + + // optional helper functions + void *CopyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE is set (withCopyDispose true) + void *DestroyFuncPtr; // When BLOCK_HAS_COPY_DISPOSE is set (withCopyDispose true) +} *descriptor_ptr_type; + +Objects of this type will always be static. This is one main component of abi change. +*/ +tree +build_block_descriptor_type (bool withCopyDispose) { - tree fields = NULL_TREE, field_decl; - tree invoke_impl_type; + tree field_decl_chain = NULL_TREE, field_decl; + tree main_type; + + if (withCopyDispose && descriptor_ptr_type_with_copydispose) + return descriptor_ptr_type_with_copydispose; + if (!withCopyDispose && descriptor_ptr_type) + return descriptor_ptr_type; + + main_type = make_aggr_type (RECORD_TYPE); + xref_basetypes (main_type, NULL_TREE); + + /* unsigned long int reserved; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("reserved"), long_unsigned_type_node); + TREE_CHAIN (field_decl) = field_decl_chain; + field_decl_chain = field_decl; + + /* unsigned long int Size; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), long_unsigned_type_node); + TREE_CHAIN (field_decl) = field_decl_chain; + field_decl_chain = field_decl; - /* If a user-declaration of "struct __invoke_impl" is seen, use it. */ - invoke_impl_type = lookup_name_prefer_type (get_identifier ("__invoke_impl"), 2); - if (invoke_impl_type) + if (withCopyDispose) { - invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); - return; + /* void *CopyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("CopyFuncPtr"), ptr_type_node); + TREE_CHAIN (field_decl) = field_decl_chain; + field_decl_chain = field_decl; + /* void *DestroyFuncPtr; */ + field_decl = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), ptr_type_node); + TREE_CHAIN (field_decl) = field_decl_chain; + field_decl_chain = field_decl; } - push_to_top_level (); - - /* invoke_impl_type = start_struct (RECORD_TYPE, get_identifier ("__invoke_impl")); */ - invoke_impl_type = make_aggr_type (RECORD_TYPE); - xref_basetypes (invoke_impl_type, NULL_TREE); - - /* void *isa; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("isa"), ptr_type_node); - TREE_CHAIN (field_decl) = fields; - fields = field_decl; - - /* int32_t Flags; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("Flags"), unsigned_type_node); - TREE_CHAIN (field_decl) = fields; - fields = field_decl; - - /* int32_t Size */ - field_decl = build_decl (FIELD_DECL, get_identifier ("Size"), unsigned_type_node); - TREE_CHAIN (field_decl) = fields; - fields = field_decl; - - /* void *FuncPtr; */ - field_decl = build_decl (FIELD_DECL, get_identifier ("FuncPtr"), ptr_type_node); - TREE_CHAIN (field_decl) = fields; - fields = field_decl; - - /* Mark this struct as being a block struct rather than a 'normal' - struct. */ - TYPE_BLOCK_IMPL_STRUCT (invoke_impl_type) = 1; - /* finish_struct (invoke_impl_type, field_decl_chain, NULL_TREE); */ - finish_builtin_struct (invoke_impl_type, "__invoke_impl", fields, NULL_TREE); - /* APPLE LOCAL radar 6169527 */ - CLASSTYPE_AS_BASE (invoke_impl_type) = invoke_impl_type; - pop_from_top_level (); - invoke_impl_ptr_type = build_pointer_type (invoke_impl_type); + /* Mark this struct as being a block struct rather than a 'normal' + struct. */ + TYPE_BLOCK_IMPL_STRUCT (main_type) = 1; + if (withCopyDispose) + finish_builtin_struct (main_type, "__block_descriptor_withcopydispose", field_decl_chain, NULL_TREE); + else + finish_builtin_struct (main_type, "__block_descriptor", field_decl_chain, NULL_TREE); + CLASSTYPE_AS_BASE (main_type) = main_type; + + main_type = build_pointer_type (main_type); + if (withCopyDispose) + descriptor_ptr_type_with_copydispose = main_type; + else + descriptor_ptr_type = main_type; + return main_type; } +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ cp_declarator * make_block_pointer_declarator (tree attributes, @@ -21592,9 +21926,9 @@ struct cp_declarator *itarget = target; struct cp_declarator *ret = make_declarator (cdk_block_pointer); - /* Closure contructs seen -- generate supporting types. */ - if (!invoke_impl_ptr_type) - build_block_internal_types (); + /* APPLE LOCAL radar 5847213 */ + /* code removed */ + ret->attributes = attributes; ret->declarator = itarget; @@ -21666,11 +22000,15 @@ tree decl, block_component; tree_stmt_iterator i; tree initialization_stmt; + /* APPLE LOCAL radar 6163705 */ + int save_line = LOCATION_LINE (input_location); decl = component; block_component = build_component_ref (build_indirect_ref (self_parm, "->"), DECL_NAME (component)); gcc_assert (block_component); + /* APPLE LOCAL radar 6163705 */ + LOCATION_LINE (input_location) = DECL_SOURCE_LINE (decl) - 1; DECL_EXTERNAL (decl) = 0; TREE_STATIC (decl) = 0; TREE_USED (decl) = 1; @@ -21679,7 +22017,9 @@ initialization_stmt = push_stmt_list(); cp_finish_decl (decl, block_component, 0, 0, LOOKUP_ONLYCONVERTING); initialization_stmt = pop_stmt_list (initialization_stmt); - /* Prepend a initialization_stmt statement to the statement list. */ + /* APPLE LOCAL radar 6163705 */ + LOCATION_LINE (input_location) = save_line; + /* Prepend a initialization_stmt statement to the statement list. */ i = tsi_start (stmt); tsi_link_before (&i, initialization_stmt, TSI_SAME_STMT); } @@ -21710,6 +22050,11 @@ i = tsi_start (stmt); decl_stmt = build_stmt (DECL_EXPR, decl); SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl)); + /* APPLE LOCAL begin radar 6163705, Blocks prologues */ + /* Give the prologue statements a line number of one before the beginning of + the function, to make them easily identifiable later. */ + EXPR_LINENO (decl_stmt) = DECL_SOURCE_LINE (decl) - 1; + /* APPLE LOCAL end radar 6163705, Blocks prologues */ decl_stmt = build3 (BIND_EXPR, void_type_node, decl, decl_stmt, NULL); TREE_SIDE_EFFECTS (decl_stmt) = 1; Modified: llvm-gcc-4.2/trunk/gcc/cp/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/tree.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/tree.c Mon Nov 3 01:33:15 2008 @@ -1717,6 +1717,15 @@ && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref)), current_class_type)) decl = current_class_ref; + /* APPLE LOCAL begin radar 6154598 */ + else if (cur_block) + { + tree this_copiedin_var = lookup_name (this_identifier); + gcc_assert (!current_class_ref); + gcc_assert (this_copiedin_var); + decl = build_x_arrow (this_copiedin_var); + } + /* APPLE LOCAL end radar 6154598 */ else decl = build_dummy_object (context); Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Mon Nov 3 01:33:15 2008 @@ -531,8 +531,8 @@ if (c_dialect_objc () && TREE_CODE (t1) == POINTER_TYPE && TREE_CODE (t2) == POINTER_TYPE) { - /* APPLE LOCAL radar 4229905 */ - if (objc_have_common_type (t1, t2, -3, NULL_TREE)) + /* APPLE LOCAL radar 4229905 - radar 6231433 */ + if (objc_have_common_type (t1, t2, -3, NULL_TREE, location)) /* APPLE LOCAL 4154928 */ return objc_common_type (t1, t2); } @@ -2762,43 +2762,46 @@ } /* APPLE LOCAL begin blocks 6040305 (cm) */ +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ /** build_block_call - Routine to build a block call; as in: - ((double(*)(struct invok_impl *, int))(BLOCK_PTR_VAR->FuncPtr))(I, 42); + ((double(*)(void *, int))(BLOCK_PTR_EXP->__FuncPtr))(I, 42); FNTYPE is the original function type derived from the syntax. - FUNCTION is the4 block pointer variable. + BLOCK_PTR_EXP is the block pointer variable. PARAMS is the parameter list. - */ +*/ static tree -build_block_call (tree fntype, tree function, tree params) +build_block_call (tree fntype, tree block_ptr_exp, tree params) { - tree block_ptr_exp; tree function_ptr_exp; tree typelist; tree result; - /* (struct invok_impl *)BLOCK_PTR_VAR */ /* First convert it to 'void *'. */ - block_ptr_exp = convert (ptr_type_node, function); - gcc_assert (invoke_impl_ptr_type); - block_ptr_exp = convert (invoke_impl_ptr_type, block_ptr_exp); - params = tree_cons (NULL_TREE, block_ptr_exp, params); - /* BLOCK_PTR_VAR->FuncPtr */ + block_ptr_exp = convert (ptr_type_node, block_ptr_exp); + gcc_assert (generic_block_literal_struct_type); + block_ptr_exp = convert (build_pointer_type (generic_block_literal_struct_type), + block_ptr_exp); + + /* BLOCK_PTR_VAR->__FuncPtr */ function_ptr_exp = - finish_class_member_access_expr (build_indirect_ref (block_ptr_exp, "->"), - get_identifier ("FuncPtr"), false); + finish_class_member_access_expr (build_indirect_ref (block_ptr_exp, "->"), + get_identifier ("__FuncPtr"), false); + gcc_assert (function_ptr_exp); - /* Build: result_type(*)(struct invok_impl *, function-arg-type-list) */ + /* Build: result_type(*)(void *, function-arg-type-list) */ typelist = TYPE_ARG_TYPES (fntype); - typelist = tree_cons (NULL_TREE, invoke_impl_ptr_type, typelist); + typelist = tree_cons (NULL_TREE, ptr_type_node, typelist); fntype = build_function_type (TREE_TYPE (fntype), typelist); function_ptr_exp = convert (build_pointer_type (fntype), function_ptr_exp); + params = tree_cons (NULL_TREE, block_ptr_exp, params); result = build3 (CALL_EXPR, TREE_TYPE (fntype), function_ptr_exp, params, NULL_TREE); /* FIXME: should do more from build_cxx_call */ result = convert_from_reference (result); return result; } +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ /* APPLE LOCAL end blocks 6040305 (cm) */ tree @@ -6717,7 +6720,8 @@ } } - if (objc_compare_types (type, rhstype, parmno, rname)) + /* APPLE LOCAL file radar 6231433 */ + if (objc_compare_types (type, rhstype, parmno, rname, "comparison")) /* APPLE LOCAL radar 4874632 */ new_rhs = convert (type, rhs); } Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Mon Nov 3 01:33:15 2008 @@ -163,6 +163,8 @@ static GTY(()) section *debug_str_section; static GTY(()) section *debug_ranges_section; static GTY(()) section *debug_frame_section; +/* APPLE LOCAL radar 6275985 debug inlined section */ +static GTY(()) section *debug_inlined_section; /* How to start an assembler comment. */ #ifndef ASM_COMMENT_START @@ -330,6 +332,8 @@ const char *str; unsigned int refcount; unsigned int form; + /* APPLE LOCAL radar 6275985 debug inlined section */ + bool is_fn_name; char *label; }; @@ -3706,6 +3710,8 @@ typedef struct dw_separate_line_info_struct *dw_separate_line_info_ref; typedef struct pubname_struct *pubname_ref; typedef struct dw_ranges_struct *dw_ranges_ref; +/* APPLE LOCAL radar 6275985 debug inlined section */ +typedef struct inlined_entry_struct *inlined_ref; /* Each entry in the line_info_table maintains the file and line number associated with the label generated for that @@ -3787,6 +3793,20 @@ DEF_VEC_O(pubname_entry); DEF_VEC_ALLOC_O(pubname_entry, gc); /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ +/* APPLE LOCAL begin radar 6275985 debug inlined section */ +DEF_VEC_O(dw_die_ref); +DEF_VEC_ALLOC_O(dw_die_ref, gc); + +typedef struct inlined_entry_struct GTY (()) +{ + dw_die_ref origin_die; + VEC(dw_die_ref,gc) *inlined_instances; +} +inlined_entry; + +DEF_VEC_O(inlined_entry); +DEF_VEC_ALLOC_O(inlined_entry, gc); +/* APPLE LOCAL end radar 6275985 debug inlined section */ struct dw_ranges_struct GTY(()) { @@ -3838,6 +3858,11 @@ /* Fixed size portion of public names info. */ #define DWARF_PUBNAMES_HEADER_SIZE (2 * DWARF_OFFSET_SIZE + 2) +/* APPLE LOCAL begin radar 6275985 debug inlined section */ +/* Fixed size portion of inlined section info. */ +#define DWARF_INLINED_HEADER_SIZE (3) +/* APPLE LOCAL end radar 6275985 debug inlined section */ + /* Fixed size portion of the address range info. */ #define DWARF_ARANGES_HEADER_SIZE \ (DWARF_ROUND (DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE + 4, \ @@ -3978,6 +4003,9 @@ static GTY (()) VEC (pubname_entry, gc) * pubtype_table; /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ +/* APPLE LOCAL radar 6275985 debug inlined section */ +static GTY (()) VEC (inlined_entry, gc) * debug_inlined_table; + /* Array of dies for which we should generate .debug_arange info. */ static GTY((length ("arange_table_allocated"))) dw_die_ref *arange_table; @@ -4152,6 +4180,8 @@ static void unmark_all_dies (dw_die_ref); /* APPLE LOCAL pubtypes, approved for 4.3 4535968 */ static unsigned long size_of_pubnames (VEC (pubname_entry,gc) *); +/* APPLE LOCAL radar 6275985 debug inlined section */ +static unsigned long size_of_inlined (VEC (inlined_entry,gc) *); static unsigned long size_of_aranges (void); static enum dwarf_form value_format (dw_attr_ref); static void output_value_format (dw_attr_ref); @@ -4166,6 +4196,10 @@ static void add_pubtype (tree, dw_die_ref); static void output_pubnames (VEC (pubname_entry,gc) *); /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ +/* APPLE LOCAL begin radar 6275985 debug inlined section */ +static void add_inlined_section_entry (dw_die_ref); +static void output_debug_inlined_section (VEC (inlined_entry,gc) *); +/* APPLE LOCAL end radar 6275985 debug inlined section */ static void add_arange (tree, dw_die_ref); static void output_aranges (void); static unsigned int add_ranges (tree); @@ -5099,6 +5133,18 @@ node->str = ggc_strdup (str); node->refcount++; + /* APPLE LOCAL begin radar 6275985 debug inlined section */ +#ifdef DEBUG_INLINED_SECTION + /* Force the names of functions (which may be inlined) to be in the + debug string section (i.e. string pointers). */ + if (die + && die->die_tag == DW_TAG_subprogram + && ((attr_kind == DW_AT_name) + || (attr_kind == DW_AT_MIPS_linkage_name))) + node->is_fn_name = true; +#endif + /* APPLE LOCAL end radar 6275985 debug inlined section */ + attr.dw_attr = attr_kind; attr.dw_attr_val.val_class = dw_val_class_str; attr.dw_attr_val.v.val_str = node; @@ -5130,17 +5176,23 @@ len = strlen (node->str) + 1; + /* APPLE LOCAL begin radar 6275985 debug inlined section */ + /* Ths sentence below is false. If the string is a function name we + always want it to go into the debug_str section. */ /* If the string is shorter or equal to the size of the reference, it is always better to put it inline. */ - if (len <= DWARF_OFFSET_SIZE || node->refcount == 0) + if ((len <= DWARF_OFFSET_SIZE || node->refcount == 0) + && !node->is_fn_name) return node->form = DW_FORM_string; /* If we cannot expect the linker to merge strings in .debug_str section, only put it into .debug_str if it is worth even in this single module. */ if ((debug_str_section->common.flags & SECTION_MERGE) == 0 - && (len - DWARF_OFFSET_SIZE) * node->refcount <= len) + && (len - DWARF_OFFSET_SIZE) * node->refcount <= len + && !node->is_fn_name) return node->form = DW_FORM_string; + /* APPLE LOCAL end radar 6275985 debug inlined section */ ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter); ++dw2_string_counter; @@ -5374,6 +5426,29 @@ return a->dw_attr_val.v.val_lbl_id; } +/* APPLE LOCAL begin radar 6275985 debug inlined section */ + +/* Get the attribute of type attr_kind, if the die has it. + This differs from get_AT in that it does NOT search any + abstract origin or specification dies; it ONLY looks directly + at the die that was passed in. */ + +static dw_attr_ref +has_AT (dw_die_ref die, enum dwarf_attribute attr_kind) +{ + dw_attr_ref a; + unsigned ix; + + if (! die) + return NULL; + + for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) + if (a->dw_attr == attr_kind) + return a; + + return NULL; +} +/* APPLE LOCAL end radar 6275985 debug inlined section */ /* Get the attribute of type attr_kind. */ static dw_attr_ref @@ -6636,7 +6711,7 @@ if appropriate. */ if (! die->die_child) return; - /* APPLE LOCAL end radar 6066486 */ + /* APPLE LOCAL end radar 6066486 - Code moved from above. */ if (die->die_parent && die != die->die_parent->die_child) add_AT_die_ref (die, DW_AT_sibling, die->die_sib); @@ -6908,6 +6983,27 @@ unmark_all_dies (AT_ref (a)); } +/* APPLE LOCAL begin radar 6275985 debug inlined section */ +static unsigned long +size_of_inlined (VEC (inlined_entry, gc) * inlined_dies) +{ + unsigned long size; + unsigned i; + unsigned num_entries; + inlined_ref iptr; + + size = DWARF_INLINED_HEADER_SIZE; + + for (i = 0; VEC_iterate (inlined_entry, inlined_dies, i, iptr); i++) + { + num_entries = VEC_length (dw_die_ref, iptr->inlined_instances); + size += (2 * DWARF_OFFSET_SIZE) + (num_entries * DWARF2_ADDR_SIZE) + + (num_entries * DWARF_OFFSET_SIZE) + size_of_uleb128 (num_entries); + } + + return size; +} +/* APPLE LOCAL end radar 6275985 debug inlined section */ /* APPLE LOCAL begin pubtypes, approved for 4.3 4535968 */ /* Return the size of the .debug_pubnames or .debug_pubtypes table generated for the compilation unit. */ @@ -7547,6 +7643,121 @@ } } +/* APPLE LOCAL begin radar 6275985 debug inlined section */ +static void +add_inlined_section_entry (dw_die_ref die) +{ + unsigned i; + bool found = false; + inlined_ref iptr; + dw_die_ref current_origin_die = get_AT_ref (die, DW_AT_abstract_origin); + + /* APPLE LOCAL begin radar 6292557 */ + if (!current_origin_die) + return; + /* APPLE LOCAL end radar 6292557 */ + + if (!has_AT (die, DW_AT_low_pc)) + return; + + for (i = 0; VEC_iterate (inlined_entry, debug_inlined_table, i, iptr); i++) + { + if (iptr->origin_die == current_origin_die) + { + VEC_safe_push (dw_die_ref, gc, iptr->inlined_instances, &die); + found = true; + } + } + + if (!found) + { + inlined_entry *new_entry = (inlined_entry *) xmalloc (sizeof (inlined_entry)); + new_entry->origin_die = current_origin_die; + new_entry->inlined_instances = VEC_alloc (dw_die_ref, gc, 32); + VEC_safe_push (dw_die_ref, gc, new_entry->inlined_instances, &die); + VEC_safe_push (inlined_entry, gc, debug_inlined_table, new_entry); + } +} + +static void +output_debug_inlined_section (VEC (inlined_entry, gc) * inlined_dies) +{ + unsigned i; + unsigned long inlined_length = size_of_inlined (inlined_dies); + inlined_entry *iptr; + + if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4) + dw2_asm_output_data (4, 0xffffffff, + "Initial length escape value indicating 64-bit DWARF extension"); + dw2_asm_output_data (DWARF_OFFSET_SIZE, inlined_length, + "Length of Inlined Subroutines Info"); + dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version"); + /* + dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label, + debug_info_section, + "Offset of Compilation Unit Info"); + dw2_asm_output_data (DWARF_OFFSET_SIZE, next_die_offset, + "Compilation Unit Length"); + */ + dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)"); + + for (i = 0; VEC_iterate (inlined_entry, inlined_dies, i, iptr); i++) + { + dw_attr_ref name_attr; + dw_attr_ref mips_name_attr; + dw_die_ref *diep; + unsigned j; + unsigned num_entries = VEC_length (dw_die_ref, iptr->inlined_instances); + dw_die_ref origin_die = iptr->origin_die; + + mips_name_attr = get_AT (origin_die, DW_AT_MIPS_linkage_name); + name_attr = get_AT (origin_die, DW_AT_name); + + if (!mips_name_attr) + mips_name_attr = name_attr; + + gcc_assert (origin_die != NULL); + gcc_assert (name_attr != NULL); + gcc_assert (mips_name_attr != NULL); + gcc_assert (num_entries > 0); + gcc_assert (AT_string_form (name_attr) == DW_FORM_strp); + gcc_assert (AT_string_form (mips_name_attr) == DW_FORM_strp); + + /* + dw2_asm_output_data (DWARF_OFFSET_SIZE, origin_die->die_offset, + "Origin die offset"); + */ + + dw2_asm_output_offset (DWARF_OFFSET_SIZE, + mips_name_attr->dw_attr_val.v.val_str->label, + debug_str_section, + "MIPS linkage name: \"%s\"", + AT_string (mips_name_attr)); + + dw2_asm_output_offset (DWARF_OFFSET_SIZE, + name_attr->dw_attr_val.v.val_str->label, + debug_str_section, + "Function name: \"%s\"", AT_string (name_attr)); + + dw2_asm_output_data_uleb128 (num_entries, NULL); + + for (j = 0; VEC_iterate (dw_die_ref, iptr->inlined_instances, j, diep); + j++) + { + const char *low_pc = get_AT_low_pc (*diep); + + gcc_assert (low_pc != NULL); + + dw2_asm_output_data (DWARF_OFFSET_SIZE, (*diep)->die_offset, + "inlined subroutine die offset"); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, low_pc, "%s", + "Low PC address"); + + } + } +} +/* APPLE LOCAL end radar 6275985 debug inlined section */ + /* Output the public names table used to speed up access to externally visible names; or the public types table used to find type definitions. For now, only generate entries for externally @@ -8774,8 +8985,7 @@ if (sub_die != NULL) add_AT_die_ref (mod_type_die, DW_AT_type, sub_die); - /* APPLE LOCAL begin radar 5359827 add named pointer types to - pubtype table */ + /* APPLE LOCAL begin radar 5359827 add named pointer types to pubtype table */ if (mod_type_die && mod_type_die->die_tag == DW_TAG_pointer_type && get_AT (mod_type_die, DW_AT_name)) @@ -11262,7 +11472,22 @@ here. */ if (origin_die) + /* APPLE LOCAL begin radar 6275985 debug inlined section */ + { add_AT_die_ref (die, DW_AT_abstract_origin, origin_die); + if (die->die_tag == DW_TAG_inlined_subroutine) + { + dw_attr_ref inline_attr = get_AT (origin_die, DW_AT_inline); + if (!inline_attr) + { + if (DECL_P (origin) && DECL_DECLARED_INLINE_P (origin)) + add_AT_unsigned (origin_die, DW_AT_inline, DW_INL_declared_inlined); + else + add_AT_unsigned (origin_die, DW_AT_inline, DW_INL_inlined); + } + } + } + /* APPLE LOCAL end radar 6275985 debug inlined section */ } /* We do not currently support the pure_virtual attribute. */ @@ -11500,15 +11725,18 @@ enum tree_code code = TREE_CODE (type); dw_die_ref type_die = NULL; +/* APPLE LOCAL begin radar 5847213 */ /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks */ /* APPLE LOCAL - radar 6113240 */ - if (code == BLOCK_POINTER_TYPE && invoke_impl_ptr_type) + /* APPLE LOCAL begin radar 6300081 */ + if (code == BLOCK_POINTER_TYPE && generic_block_literal_struct_type) { - /* APPLE LOCAL - radar 6113240 Removed gcc_assert */ - type = invoke_impl_ptr_type; + type = build_pointer_type (generic_block_literal_struct_type); code = TREE_CODE (type); } + /* APPLE LOCAL end radar 6300081 */ /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ +/* APPLE LOCAL end radar 5847213 */ /* ??? If this type is an unnamed subrange type of an integral or floating-point type, use the inner type. This is because we have no @@ -12474,11 +12702,28 @@ if (TREE_CODE (block_struct) != RECORD_TYPE) return ret_type; - if ((! TYPE_NAME (block_struct)) - || (! IDENTIFIER_POINTER (TYPE_NAME (block_struct))) - || (strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), + /* APPLE LOCAL begin radar 6237086 */ + /* Look for a type name, and make sure it contains the __Block_byref_ + substring. */ + + if (! TYPE_NAME (block_struct)) + return ret_type; + + if (TREE_CODE (TYPE_NAME (block_struct)) != IDENTIFIER_NODE + && TREE_CODE (TYPE_NAME (block_struct)) != TYPE_DECL) + return ret_type; + + if (TREE_CODE (TYPE_NAME (block_struct)) == IDENTIFIER_NODE + && (strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), "__Block_byref_", 14) != 0)) return ret_type; + else if (TREE_CODE (TYPE_NAME (block_struct)) == TYPE_DECL + && ((! DECL_NAME (TYPE_NAME (block_struct))) + || (strncmp + (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (block_struct))), + "__Block_byref_", 14) != 0))) + return ret_type; + /* APPLE LOCAL end radar 6237086 */ /* We've got the record for a __Byref_block_etc; go through the fields looking for one with the same name as the var_decl. */ @@ -12504,6 +12749,35 @@ return ret_type; } +/* APPLE LOCAL begin radar 6237616 */ +/* Called from build_byref_var_location_expression, this function + checks to see if the starting location description is of type + DW_OP_regX (which, legally, cannot have anything added to it), + and if so, changes it to the equivalent DW_OP_bregX + 0, which + CAN legally have other stuff added to it. */ + +static void +blocks_fixup_location_description (dw_loc_descr_ref *main_descr) +{ + dw_loc_descr_ref old_descr; + dw_loc_descr_ref new_descr; + enum dwarf_location_atom new_op; + int regno; + unsigned int offset = 0; + + old_descr = *main_descr; + + if (old_descr->dw_loc_opc >= DW_OP_reg0 + && old_descr->dw_loc_opc <= DW_OP_reg31) + { + regno = old_descr->dw_loc_opc - DW_OP_reg0; + new_op = DW_OP_breg0 + regno; + new_descr = new_loc_descr (new_op, offset, 0); + *main_descr = new_descr; + } +} +/* APPLE LOCAL end radar 6237616 */ + /* This function is a helper function for the function below, add_block_byref_var_location_attribute. See comments there for full description. */ @@ -12516,6 +12790,12 @@ { dw_loc_descr_ref temp_descr; + /* APPLE LOCAL begin radar 6237616 */ + /* Make sure main_descr is legal, to start with. */ + + blocks_fixup_location_description (main_descr); + /* APPLE LOCAL end radar 6237616 */ + /* If we started with a pointer to the __Block_byref... struct, then the first thing we need to do is dereference the pointer (DW_OP_deref). */ @@ -12645,11 +12925,28 @@ if (TREE_CODE (block_struct) != RECORD_TYPE) return false; - if ((! TYPE_NAME (block_struct)) - || (! IDENTIFIER_POINTER (TYPE_NAME (block_struct))) - || strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), - "__Block_byref_", 14) != 0) + /* APPLE LOCAL begin radar 6237086 */ + /* Look for a type name, and make sure it contains the __Block_byref_ + substring. */ + + if (! TYPE_NAME (block_struct)) + return false; + + if (TREE_CODE (TYPE_NAME (block_struct)) != IDENTIFIER_NODE + && TREE_CODE (TYPE_NAME (block_struct)) != TYPE_DECL) + return false; + + if (TREE_CODE (TYPE_NAME (block_struct)) == IDENTIFIER_NODE + && (strncmp (IDENTIFIER_POINTER (TYPE_NAME (block_struct)), + "__Block_byref_", 14) != 0)) + return false; + else if (TREE_CODE (TYPE_NAME (block_struct)) == TYPE_DECL + && ((! DECL_NAME (TYPE_NAME (block_struct))) + || (strncmp + (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (block_struct))), + "__Block_byref_", 14) != 0))) return false; + /* APPLE LOCAL end radar 6237086 */ /* Find the forwarding field and the variable field within the struct. */ @@ -12668,7 +12965,7 @@ var_name) == 0) var_field = temp_field; else if (strcmp (IDENTIFIER_POINTER (DECL_NAME (temp_field)), - "forwarding") == 0) + "__forwarding") == 0) forwarding_field = temp_field; } @@ -12825,14 +13122,26 @@ { if (TREE_CODE (decl_type) == POINTER_TYPE) decl_type = TREE_TYPE (decl_type); + /* APPLE LOCAL begin radar 6237086 */ if (decl_type && TREE_CODE (decl_type) == RECORD_TYPE - && TYPE_NAME (decl_type) - && TREE_CODE (TYPE_NAME (decl_type)) == IDENTIFIER_NODE - && IDENTIFIER_POINTER (TYPE_NAME (decl_type)) - && (strncmp (IDENTIFIER_POINTER (TYPE_NAME (decl_type)), - "__Block_byref_", 14) == 0)) - is_block_byref_var = true; + && TYPE_NAME (decl_type)) + { + if (TREE_CODE (TYPE_NAME (decl_type)) == IDENTIFIER_NODE + && strncmp (IDENTIFIER_POINTER (TYPE_NAME (decl_type)), + "__Block_byref_", 14) == 0) + is_block_byref_var = true; + else if (TREE_CODE (TYPE_NAME (decl_type)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (decl_type)) + && IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (decl_type))) + && (strncmp + (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (decl_type))), + "__Block_byref_", 14) == 0)) + is_block_byref_var = true; + else + is_block_byref_var = false; + } + /* APPLE LOCAL end radar 6237086 */ } /* APPLE LOCAL end radar 6048397 handle block byref variables */ if (origin != NULL) @@ -13053,6 +13362,8 @@ decls_for_scope (stmt, subr_die, depth); current_function_has_inlines = 1; + /* APPLE LOCAL radar 6275985 debug inlined section */ + add_inlined_section_entry (subr_die); } else /* We may get here if we're the outer block of function A that was @@ -14846,6 +15157,8 @@ pubname_table = VEC_alloc (pubname_entry, gc, 32); pubtype_table = VEC_alloc (pubname_entry, gc, 32); /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ + /* APPLE LOCAL radar 6275985 debug inlined section */ + debug_inlined_table = VEC_alloc (inlined_entry, gc, 32); /* Generate the initial DIE for the .debug section. Note that the (string) value given in the DW_AT_name attribute of the DW_TAG_compile_unit DIE @@ -14879,6 +15192,12 @@ SECTION_DEBUG, NULL); #endif /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ + /* APPLE LOCAL begin radar 6275985 debug inlined section */ +#ifdef DEBUG_INLINED_SECTION + debug_inlined_section = get_section (DEBUG_INLINED_SECTION, + SECTION_DEBUG, NULL); +#endif + /* APPLE LOCAL end radar 6275985 debug inlined section */ debug_str_section = get_section (DEBUG_STR_SECTION, DEBUG_STR_SECTION_FLAGS, NULL); debug_ranges_section = get_section (DEBUG_RANGES_SECTION, @@ -15105,15 +15424,19 @@ s->refcount++; /* Avoid unnecessarily putting strings that are used less than twice in the hash table. */ - if (s->refcount - == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2)) + /* APPLE LOCAL begin radar 6275985 debug inlined section */ + /* We always want function names to go into the hash table. */ + if ((s->refcount + == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2)) + || s->is_fn_name) { void ** slot; slot = htab_find_slot_with_hash (debug_str_hash, s->str, htab_hash_string (s->str), INSERT); - gcc_assert (*slot == NULL); - *slot = s; + if (*slot == NULL) + *slot = s; + /* APPLE LOCAL end radar 6275985 debug inlined section */ } } } @@ -15402,6 +15725,17 @@ #endif /* APPLE LOCAL end pubtypes, approved for 4.3 4535968 */ + /* APPLE LOCAL begin radar 6275985 debug inlined section */ +#ifdef DEBUG_INLINED_SECTION + /* Output debug section containing info about inlined subroutines */ + if (! VEC_empty (inlined_entry, debug_inlined_table)) + { + switch_to_section (debug_inlined_section); + output_debug_inlined_section (debug_inlined_table); + } +#endif + /* APPLE LOCAL end radar 6275985 debug inlined section */ + /* Output the address range information. We only put functions in the arange table, so don't write it out if we don't have any. */ if (fde_table_in_use) Modified: llvm-gcc-4.2/trunk/gcc/function.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/function.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/function.c (original) +++ llvm-gcc-4.2/trunk/gcc/function.c Mon Nov 3 01:33:15 2008 @@ -216,6 +216,8 @@ static void do_clobber_return_reg (rtx, void *); static void do_use_return_reg (rtx, void *); static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED; +/* APPLE LOCAL radar 6163705, Blocks prologues */ +static rtx find_block_prologue_insns (void); /* Pointer to chain of `struct function' for containing functions. */ struct function *outer_function_chain; @@ -5140,6 +5142,140 @@ } #endif +/* APPLE LOCAL begin radar 6163705, Blocks prologues */ + +/* The function should only be called for Blocks functions. + + On being called, the main instruction list for the Blocks function + may contain instructions for setting up the ref_decl and byref_decl + variables in the Block. Those isns really need to go before the + function prologue note rather than after. If such instructions are + present, they are identifiable by their source line number, which + will be one line preceding the declaration of the function. If + they are present, there will also be a source line note instruction + for that line. + + This function does a set of things: + - It finds the first such prologue insn. + - It finds the last such prologue insn. + - It changes the insn locator of all such prologue insns to + the prologue locator. + - It finds the source line note for the bogus location and + removes it. + - It decides if it is safe to place the prolgoue end note + after the last prologue insn it finds, and if so, returns + the last prologue insn (otherwise it returns NULL). + + This function makes the following checks to determine if it is + safe to move the prologue end note to just below the last + prologue insn it finds. If ALL of the checks succeed then it + is safe. If any check fails, this function returns NULL. The + checks it makes are: + + - There were no INSN_P instructions that occurred before the + first prologue insn. + - If there are any non-prologue insns between the first & last + prologue insn, the non-prologue insns do not outnumber the + prologue insns. + - The first prologue insn & the last prologue insn are in the + same basic block. +*/ + +static rtx +find_block_prologue_insns (void) +{ + rtx first_prologue_insn = NULL; + rtx last_prologue_insn = NULL; + rtx line_number_note = NULL; + rtx tmp_insn; + int num_prologue_insns = 0; + int total_insns = 0; + int prologue_line = DECL_SOURCE_LINE (cfun->decl) - 1; + bool other_insns_before_prologue = false; + bool start_of_fnbody_found = false; + + /* Go through all the insns and find the first prologue insn, the + last prologue insn, the source line location note, and whether or + not there are any "real" insns that occur before the first + prologue insn. Re-set the insn locator for prologue insns to the + prologue locator. */ + + for (tmp_insn = get_insns(); tmp_insn; tmp_insn = NEXT_INSN (tmp_insn)) + { + if (INSN_P (tmp_insn)) + { + if (insn_line (tmp_insn) == prologue_line) + { + if (!first_prologue_insn) + first_prologue_insn = tmp_insn; + num_prologue_insns++; + last_prologue_insn = tmp_insn; + INSN_LOCATOR (tmp_insn) = prologue_locator; + } + else if (!first_prologue_insn + && start_of_fnbody_found) + other_insns_before_prologue = true; + } + else if (NOTE_P (tmp_insn) + && NOTE_LINE_NUMBER (tmp_insn) == NOTE_INSN_FUNCTION_BEG) + start_of_fnbody_found = true; + else if (NOTE_P (tmp_insn) + && (XINT (tmp_insn, 5) == prologue_line)) + line_number_note = tmp_insn; + } + + /* If there were no prologue insns, return now. */ + + if (!first_prologue_insn) + return NULL; + + /* If the source location note for the line before the beginning of the + function was found, remove it. */ + + if (line_number_note) + remove_insn (line_number_note); + + /* If other real insns got moved above the prologue insns, we can't + pull out the prologue insns, so return now. */ + + if (other_insns_before_prologue && (optimize > 0)) + return NULL; + + /* Count the number of insns between the first prologue insn and the + last prologue insn; also count the number of non-prologue insns + between the first prologue insn and the last prologue insn. */ + + tmp_insn = first_prologue_insn; + while (tmp_insn != last_prologue_insn) + { + total_insns++; + tmp_insn = NEXT_INSN (tmp_insn); + } + total_insns++; + + /* If more than half of the insns between the first & last prologue + insns are not prologue insns, then there is too much code that + got moved in between prologue insns (by optimizations), so we + will not try to pull it out. */ + + if ((num_prologue_insns * 2) <= total_insns) + return NULL; + + /* Make sure all the prologue insns are within one basic block. + If the insns cross a basic block boundary, then there is a chance + that moving them will cause incorrect code, so don't do it. */ + + gcc_assert (first_prologue_insn != NULL); + gcc_assert (last_prologue_insn != NULL); + + if (BLOCK_FOR_INSN (first_prologue_insn) != + BLOCK_FOR_INSN (last_prologue_insn)) + return NULL; + + return last_prologue_insn; +} +/* APPLE LOCAL end radar 6163705, Blocks prologues */ + /* Generate the prologue and epilogue RTL if the machine supports it. Thread this into place with notes indicating where the prologue ends and where the epilogue begins. Update the basic block information when possible. */ @@ -5163,13 +5299,24 @@ #ifdef HAVE_prologue if (HAVE_prologue) { + /* APPLE LOCAL begin radar 6163705, Blocks prologues */ + rtx last_prologue_insn = NULL; + + if (BLOCK_SYNTHESIZED_FUNC (cfun->decl)) + last_prologue_insn = find_block_prologue_insns(); + /* APPLE LOCAL end radar 6163705, Blocks prologues */ + start_sequence (); seq = gen_prologue (); emit_insn (seq); /* Retain a map of the prologue insns. */ record_insns (seq, &prologue); - prologue_end = emit_note (NOTE_INSN_PROLOGUE_END); + + /* APPLE LOCAL begin radar 6163705, Blocks prologues */ + if (!last_prologue_insn) + prologue_end = emit_note (NOTE_INSN_PROLOGUE_END); + /* APPLE LOCAL end radar 6163705, Blocks prologues */ #ifndef PROFILE_BEFORE_PROLOGUE /* Ensure that instructions are not moved into the prologue when @@ -5190,7 +5337,11 @@ insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR)); inserted = 1; - } + + /* APPLE LOCAL begin radar 6163705, Blocks prologues */ + if (last_prologue_insn) + emit_note_after (NOTE_INSN_PROLOGUE_END, last_prologue_insn); + /* APPLE LOCAL end radar 6163705, Blocks prologues */ } #endif /* If the exit block has no non-fake predecessors, we don't need Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gimplify.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/gimplify.c Mon Nov 3 01:33:15 2008 @@ -1148,8 +1148,9 @@ tree result_decl, result; if (!ret_expr || TREE_CODE (ret_expr) == RESULT_DECL - /* APPLE LOCAL radar 6040305 - blocks */ - || ret_expr == error_mark_node || cur_block) + /* APPLE LOCAL radar 6261552 */ + /* code to check for cur_block is removed. */ + || ret_expr == error_mark_node) return GS_ALL_DONE; if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl)))) Modified: llvm-gcc-4.2/trunk/gcc/ipa-type-escape.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ipa-type-escape.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ipa-type-escape.c (original) +++ llvm-gcc-4.2/trunk/gcc/ipa-type-escape.c Mon Nov 3 01:33:15 2008 @@ -519,11 +519,22 @@ /* Return true if PARENT is supertype of CHILD. Both types must be known to be structures or unions. */ +/* APPLE LOCAL begin 6107012 */ +static struct pointer_set_t GTY(()) *parent_type_p_pset; +/* APPLE LOCAL end 6107012 */ + static bool parent_type_p (tree parent, tree child) { int i; tree binfo, base_binfo; + + /* APPLE LOCAL begin 6107012 */ + /* Don't walk the same tree twice. */ + if (parent_type_p_pset && pointer_set_insert (parent_type_p_pset, parent)) + return false; + /* APPLE LOCAL end 6107012 */ + if (TYPE_BINFO (parent)) for (binfo = TYPE_BINFO (parent), i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) @@ -643,8 +654,18 @@ if (to_type == from_type) return CT_USELESS; + /* APPLE LOCAL 6107012 */ + parent_type_p_pset = pointer_set_create (); if (parent_type_p (to_type, from_type)) return CT_UP; + /* APPLE LOCAL begin 6107012 */ + pointer_set_destroy (parent_type_p_pset); + parent_type_p_pset = pointer_set_create (); + /* APPLE LOCAL end 6107012 */ if (parent_type_p (from_type, to_type)) return CT_DOWN; + /* APPLE LOCAL begin 6107012 */ + pointer_set_destroy (parent_type_p_pset); + parent_type_p_pset = (struct pointer_set_t *)0; + /* APPLE LOCAL end 6107012 */ return CT_SIDEWAYS; } 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=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Nov 3 01:33:15 2008 @@ -141,6 +141,12 @@ #endif /* APPLE LOCAL end radar 4531086 */ +/* APPLE LOCAL begin radar 6307941 */ +#ifndef OBJC2_ABI_DISPATCH +#define OBJC2_ABI_DISPATCH 0 +#endif +/* APPLE LOCAL end radar 6307941 */ + /* These need specifying. */ #ifndef OBJC_FORWARDING_STACK_OFFSET #define OBJC_FORWARDING_STACK_OFFSET 0 @@ -188,7 +194,8 @@ /* Code generation. */ static tree objc_build_constructor (tree, tree); -static tree build_objc_method_call (int, tree, tree, tree, tree); +/* APPLE LOCAL radar 6307941 */ +static tree build_objc_method_call (int, tree, tree, tree, tree, tree); static tree get_proto_encoding (tree); static tree lookup_interface (tree); static tree objc_add_static_instance (tree, tree); @@ -257,7 +264,8 @@ static void build_v2_class_template (void); static void build_v2_protocol_template (void); static void build_message_ref_template (void); -static tree build_v2_build_objc_method_call (int, tree, tree, tree, tree, bool); +/* APPLE LOCAL radar 6307941 */ +static tree build_v2_build_objc_method_call (int, tree, tree, tree, tree, tree, bool); /* APPLE LOCAL radar 4695109 */ static void build_v2_protocol_reference (tree); /* APPLE LOCAL radar 5153561 */ @@ -389,7 +397,8 @@ #endif static int comp_proto_with_proto (tree, tree, int); /* APPLE LOCAL begin 4209854 */ -static tree get_arg_type_list (tree, int, int); +/* APPLE LOCAL radar 6307941 */ +static tree get_arg_type_list (tree, tree, int, int); static tree objc_decay_parm_type (tree); /* APPLE LOCAL end 4209854 */ static void objc_push_parm (tree); @@ -753,16 +762,18 @@ if (flag_next_runtime) { /* APPLE LOCAL begin ARM hybrid objc-2.0 */ - bool use_hybrid_msgSend = (flag_objc_abi == 2 - && flag_objc_legacy_dispatch); + /* APPLE LOCAL radar 6307941 */ + /* code removed. */ TAG_GETCLASS = "objc_getClass"; TAG_GETMETACLASS = "objc_getMetaClass"; TAG_MSGSEND = "objc_msgSend"; - TAG_MSGSENDSUPER = use_hybrid_msgSend ? "objc_msgSendSuper2" - : "objc_msgSendSuper"; + /* APPLE LOCAL begin radar 6307941 */ + TAG_MSGSENDSUPER = flag_objc_abi==2 ? "objc_msgSendSuper2" + : "objc_msgSendSuper"; TAG_MSGSEND_STRET = "objc_msgSend_stret"; - TAG_MSGSENDSUPER_STRET = use_hybrid_msgSend ? "objc_msgSendSuper2_stret" - : "objc_msgSendSuper_stret"; + TAG_MSGSENDSUPER_STRET = flag_objc_abi==2 ? "objc_msgSendSuper2_stret" + : "objc_msgSendSuper_stret"; + /* APPLE LOCAL end radar 6307941 */ /* APPLE LOCAL end ARM hybrid objc-2.0 */ default_constant_string_class_name = "NSConstantString"; /* APPLE LOCAL begin radar 4810609 */ @@ -1070,6 +1081,7 @@ void objc_continue_implementation (void) + { objc_ivar_chain = continue_class (objc_implementation_context); @@ -1175,7 +1187,9 @@ managed_objc_object_pointer (tree type) { return type && type != error_mark_node && POINTER_TYPE_P (type) - && (objc_is_object_id (TREE_TYPE (type)) || TYPED_OBJECT (TREE_TYPE (type))); + && (objc_is_object_id (TREE_TYPE (type)) || TYPED_OBJECT (TREE_TYPE (type)) + /* APPLE LOCAL radar 6255671 */ + || TREE_CODE (type) == BLOCK_POINTER_TYPE); } /* APPLE LOCAL end radar 5168496 */ @@ -1314,9 +1328,17 @@ /* APPLE LOCAL begin radar 4855821 */ if (!flag_objc_gc) { + /* APPLE LOCAL begin radar 6255671 */ if (!property_assign) - warning (0, "'assign' attribute (default) not appropriate for non-gc object property %qs", - IDENTIFIER_POINTER (PROPERTY_NAME (property_decl))); + { + if (TREE_CODE (TREE_TYPE (property_decl)) == BLOCK_POINTER_TYPE) + error ("assign attribute (default) not appropriate for non-gc object property %qs", + IDENTIFIER_POINTER (PROPERTY_NAME (property_decl))); + else + warning (0, "assign attribute (default) not appropriate for non-gc object property %qs", + IDENTIFIER_POINTER (PROPERTY_NAME (property_decl))); + } + /* APPLE LOCAL end radar 6255671 */ } /* APPLE LOCAL end radar 4855821 */ else if (!property_assign) @@ -1916,7 +1938,8 @@ and in accordance with C99 rules we generate: type temp; (temp = rhs, [lhs Setter:temp], temp) */ /* APPLE LOCAL begin radar 5279122 */ - rhs = default_conversion (rhs); + /* APPLE LOCAL radar 6264448 */ + /* rhs = default_conversion (rhs); removed */ temp = objc_create_named_tmp_var (TREE_TYPE (rhs), "prop"); /* APPLE LOCAL end radar 5279122 */ bind = build3 (BIND_EXPR, void_type_node, temp, NULL, NULL); @@ -1925,6 +1948,12 @@ comma_exp = build_modify_expr (temp, NOP_EXPR, rhs); comma_exp = build_compound_expr (comma_exp, objc_setter_func_call (receiver, prop_ident, temp)); + /* APPLE LOCAL begin radar 6264448 */ + /* conversion of 'temp' moved *after* it is passed ar argument to build + setter call. This is because its type must match the setter's argument + type. */ + temp = default_conversion (temp); + /* APPLE LOCAL end radar 6264448 */ } else { @@ -2766,12 +2795,11 @@ /* struct objc_method_list *optional_instance_methods; */ if (!optional_instance_meth) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, - convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + convert (objc_method_list_ptr, integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, build_unary_op (ADDR_EXPR, @@ -2781,12 +2809,11 @@ /* struct objc_method_list *optional_class_methods; */ if (!optional_class_meth) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, - convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + convert (objc_method_list_ptr, integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, build_unary_op (ADDR_EXPR, @@ -2796,12 +2823,11 @@ /* struct objc_prop_list *instance_properties; */ if (!instance_prop) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, - convert (objc_prop_list_ptr, - build_int_cst (NULL_TREE, 0)), + convert (objc_prop_list_ptr, integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_prop_list_ptr, build_unary_op (ADDR_EXPR, @@ -2876,18 +2902,17 @@ initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, size)); initlist = tree_cons (NULL_TREE, - (!weak_ivar_layout_tree ? build_int_cst (NULL_TREE, 0) + (!weak_ivar_layout_tree ? integer_zero_node : weak_ivar_layout_tree), initlist); /* struct _prop_list_t *properties; */ if (!property_list) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, - convert (objc_prop_list_ptr, - build_int_cst (NULL_TREE, 0)), + convert (objc_prop_list_ptr, integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_prop_list_ptr, @@ -3009,6 +3034,61 @@ : INSTANCE_METHOD_DECL); } + +/* APPLE LOCAL begin radar 6307941 */ +/* Non-legacy dispatch is a performance optimization only. + Using the "wrong" dispatch is not a correctness problem, + assuming non-legacy dispatch is supported at all. + + SnowLeopard: only the selectors below are optimized by the runtime. + Other selectors should use legacy dispatch to save memory. +*/ +static const char * const nonlegacy_dispatched_selectors[] = { + "allocWithZone:", + "alloc", + "class", + "self", + "isKindOfClass:", + "respondsToSelector:", + "isFlipped", + "length", + "objectForKey:", + "count", + "objectAtIndex:", + "isEqualToString:", + "isEqual:", + "retain", + "release", + "autorelease", + "hash", + "addObject:", + "countByEnumeratingWithState:objects:count:", +}; + +static int +objc_legacy_dispatched_selector_p (tree sel_name) +{ + gcc_assert (flag_objc_abi == 2); + gcc_assert (sel_name); + if (flag_objc_legacy_dispatch) + return true; + if (OBJC2_ABI_DISPATCH) + /* Do this for Snow Leopard ot later only. */ + return false; + else { + size_t i, count; + const char *sel_cname = IDENTIFIER_POINTER (sel_name); + count = sizeof(nonlegacy_dispatched_selectors) / sizeof(nonlegacy_dispatched_selectors[0]); + for (i = 0; i < count; i++) + { + if (!strcmp (sel_cname, nonlegacy_dispatched_selectors[i])) + return false; + } + } + return true; +} +/* APPLE LOCAL end radar 6307941 */ + tree objc_build_method_signature (tree rettype, tree selector, tree optparms, bool ellipsis) @@ -3212,7 +3292,7 @@ /* APPLE LOCAL begin radar 5676962 */ tree t; int cv = 0; - /* LLVM LOCAL */ + /* APPLE LOCAL radar 6285794 */ struct lang_type ** pTypeLang = 0; /* APPLE LOCAL end radar 5676962 */ @@ -3615,7 +3695,8 @@ APPLE LOCAL end 4175534 */ bool -objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee) +/* APPLE LOCAL radar 6231433 */ +objc_compare_types (tree ltyp, tree rtyp, int argno, tree callee, const char *message) { tree lcls, rcls, lproto, rproto; bool pointers_compatible; @@ -3647,7 +3728,8 @@ /* Return types must be covariant. */ if (!comptypes (TREE_TYPE (ltyp), TREE_TYPE (rtyp)) && !objc_compare_types (TREE_TYPE (ltyp), TREE_TYPE (rtyp), - argno, callee)) + /* APPLE LOCAL radar 6231433 */ + argno, callee, message)) return false; /* Argument types must be contravariant. */ @@ -3656,7 +3738,8 @@ { if (!comptypes (TREE_VALUE (rtyp), TREE_VALUE (ltyp)) && !objc_compare_types (TREE_VALUE (rtyp), TREE_VALUE (ltyp), - argno, callee)) + /* APPLE LOCAL radar 6231433 */ + argno, callee, message)) return false; } @@ -3791,8 +3874,10 @@ /* APPLE LOCAL end 4175534 */ /* APPLE LOCAL begin radar 5839123 */ case -3: - warning (0, "comparison of distinct Objective-C types %qT and %qT lacks a cast", - orig_rtyp, orig_ltyp); + /* APPLE LOCAL begin radar 6231433 */ + warning (0, "%s of distinct Objective-C types %qT and %qT lacks a cast", + message, orig_rtyp, orig_ltyp); + /* APPLE LOCAL end radar 6231433 */ break; case -2: @@ -3823,16 +3908,16 @@ return true; } -/* APPLE LOCAL begin radar 4229905 */ +/* APPLE LOCAL begin radar 4229905 - radar 6131433 */ /* This routine is similar to objc_compare_types except that function-pointers are excluded. This is because, caller assumes that common types are of (id, Object*) variety and calls objc_common_type to obtain a common type. There is no commonolty between two function-pointers in this regard. */ bool -objc_have_common_type (tree ltyp, tree rtyp, int argno, tree callee) +objc_have_common_type (tree ltyp, tree rtyp, int argno, tree callee, const char *message) { - if (objc_compare_types (ltyp, rtyp, argno, callee)) + if (objc_compare_types (ltyp, rtyp, argno, callee, message)) { /* exclude function-pointer types. */ do @@ -3845,7 +3930,7 @@ } return false; } -/* APPLE LOCAL end radar 4229905 */ +/* APPLE LOCAL end radar 4229905 - radar 6131433 */ /* Check if LTYP and RTYP have the same type qualifiers. If either type lives in the volatilized hash table, ignore the 'volatile' bit when @@ -4032,8 +4117,17 @@ : xref_tag (RECORD_TYPE, type)); } /* APPLE LOCAL end 4216500 */ - else + /* APPLE LOCAL begin radar 6267049 */ + else { + /* This can only happen because of bogus code. Note that in this + path, protocols is not even considered. */ + error ("qualified type is not a valid object"); + /* Check further to see if protocol is valid. */ + if (protocols) + (void) lookup_and_install_protocols (protocols, false); return interface; + } + /* APPLE LOCAL end radar 6267049 */ } if (protocols) @@ -4210,6 +4304,10 @@ #ifdef OBJCPLUS DECL_THIS_STATIC (var) = 1; /* squash redeclaration errors */ #endif + /* APPLE LOCAL begin 6255801 */ + /* Keep word alignment for metadata records. */ + DECL_USER_ALIGN (var) = 1; + /* APPLE LOCAL end 6255801 */ } /* APPLE LOCAL end radar 4431864 */ @@ -5018,7 +5116,8 @@ = build_tree_list (fields, flag_next_runtime ? build_unary_op (ADDR_EXPR, string_class_decl, 0) - : build_int_cst (NULL_TREE, 0)); + /* APPLE LOCAL radar 6285794 */ + : integer_zero_node); fields = TREE_CHAIN (fields); initlist = tree_cons (fields, build_unary_op (ADDR_EXPR, string, 1), initlist); @@ -5206,7 +5305,8 @@ if (static_instances_decl) expr = build_unary_op (ADDR_EXPR, static_instances_decl, 0); else - expr = build_int_cst (NULL_TREE, 0); + /* APPLE LOCAL radar 6285794 */ + expr = integer_zero_node; initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -5229,12 +5329,12 @@ /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */ if (flag_next_runtime || ! sel_ref_chain) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (build_pointer_type (objc_selector_type), - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else initlist = tree_cons (NULL_TREE, @@ -5381,7 +5481,8 @@ if (UOBJC_SYMBOLS_decl) expr = build_unary_op (ADDR_EXPR, UOBJC_SYMBOLS_decl, 0); else - expr = build_int_cst (NULL_TREE, 0); + /* APPLE LOCAL radar 6285794 */ + expr = integer_zero_node; initlist = tree_cons (NULL_TREE, expr, initlist); return objc_build_constructor (type, nreverse (initlist)); @@ -5576,7 +5677,8 @@ } /* Output {..., NULL}. */ - initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist); + /* APPLE LOCAL radar 6285794 */ + initlist = tree_cons (NULL_TREE, integer_zero_node, initlist); expr = objc_build_constructor (TREE_TYPE (decl), nreverse (initlist)); finish_var_decl (decl, expr); @@ -5584,7 +5686,8 @@ = tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, decl, 1), decls); } - decls = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), decls); + /* APPLE LOCAL radar 6285794 */ + decls = tree_cons (NULL_TREE, integer_zero_node, decls); expr = objc_build_constructor (type, nreverse (decls)); static_instances_decl = start_var_decl (type, "_OBJC_STATIC_INSTANCES"); finish_var_decl (static_instances_decl, expr); @@ -5881,11 +5984,14 @@ ? objc_build_constructor (objc_selector_template, tree_cons (NULL_TREE, - build_int_cst (NULL_TREE, 0), + /* APPLE LOCAL radar 6285794 */ + integer_zero_node, tree_cons (NULL_TREE, - build_int_cst (NULL_TREE, 0), + /* APPLE LOCAL radar 6285794 */ + integer_zero_node, NULL_TREE))) - : build_int_cst (NULL_TREE, 0), initlist); + /* APPLE LOCAL radar 6285794 */ + : integer_zero_node, initlist); initlist = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl), nreverse (initlist)); finish_var_decl (UOBJC_SELECTOR_TABLE_decl, initlist); @@ -5909,7 +6015,8 @@ return add_objc_string (encoding, meth_var_types); } else - return build_int_cst (NULL_TREE, 0); + /* APPLE LOCAL radar 6285794 */ + return integer_zero_node; } /* sel_ref_chain is a list whose "value" fields will be instances of @@ -9655,17 +9762,16 @@ /* static struct objc_protocol _OBJC_PROTOCOL_; */ protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names); - /* LLVM LOCAL - begin NUL pointer */ if (refs_decl) refs_expr = convert (build_pointer_type (build_pointer_type (objc_protocol_template)), build_unary_op (ADDR_EXPR, refs_decl, 0)); else + /* APPLE LOCAL begin radar 6285794 */ refs_expr = convert (build_pointer_type (build_pointer_type (objc_protocol_template)), - build_int_cst (NULL_TREE, 0)); - /* LLVM LOCAL - end NUL pointer */ - + integer_zero_node); + /* APPLE LOCAL end radar 6285794 */ /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */ save_objc_implementation_context = objc_implementation_context; objc_implementation_context = p; @@ -9739,11 +9845,12 @@ /* APPLE LOCAL begin ObjC new abi */ /* APPLE LOCAL begin radar 4533974 - ObjC new protocol */ /* APPLE LOCAL begin radar 4533974 - ObjC newprotocol - radar 4695109 */ - /* LLVM LOCAL - begin NUL pointer */ if (newabi) { /* 'isa' is NULL in the new ObjC abi */ - expr = convert (objc_object_type, build_int_cst (NULL_TREE, 0)); + /* APPLE LOCAL begin radar 6285794 */ + expr = convert (objc_object_type, integer_zero_node); + /* APPLE LOCAL end radar 6285794 */ } /* APPLE LOCAL end radar 4533974 - ObjC newprotocol - radar 4695109 */ /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */ @@ -9751,19 +9858,20 @@ else { if (!objc_protocol_or_opt_ins_meth) + /* APPLE LOCAL begin radar 6285794 */ { if (!objc_protocol_extension_template) build_objc_protocol_extension_template (); expr = convert (build_pointer_type (objc_protocol_extension_template), - build_int_cst (NULL_TREE, 0)); + integer_zero_node); } + /* APPLE LOCAL end radar 6285794 */ else expr = convert (build_pointer_type (objc_protocol_extension_template), build_unary_op (ADDR_EXPR, objc_protocol_or_opt_ins_meth, 0)); } - /* LLVM LOCAL - end NUL pointer */ /* APPLE LOCAL end radar 4585769 - Objective-C 1.0 extensions */ initlist = tree_cons (NULL_TREE, expr, initlist); @@ -9773,12 +9881,12 @@ initlist = tree_cons (NULL_TREE, protocol_list, initlist); if (!instance_methods) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_proto_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_proto_list_ptr, @@ -9787,12 +9895,12 @@ } if (!class_methods) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_proto_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_proto_list_ptr, @@ -9805,12 +9913,12 @@ { /* APPLE LOCAL begin radar 4695109 */ if (!objc_protocol_or_opt_ins_meth) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_proto_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_proto_list_ptr, @@ -9818,12 +9926,12 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } if (!opt_cls_meth) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_proto_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_proto_list_ptr, @@ -9832,12 +9940,12 @@ } /* APPLE LOCAL end radar 4695109 */ if (!property_list) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_prop_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_prop_list_ptr, @@ -9851,7 +9959,7 @@ TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_protocol_template))); initlist = tree_cons (NULL_TREE, expr, initlist); /* const uint32_t flags; = 0 */ - initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist); + initlist = tree_cons (NULL_TREE, integer_zero_node, initlist); /* APPLE LOCAL end radar 5192466 */ } /* APPLE LOCAL end C* property metadata (Radar 4498373) */ @@ -10925,12 +11033,12 @@ ivar); else /* Unnamed bit-field ivar (yuck). */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ ivar = tree_cons (NULL_TREE, convert (string_type_node, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), ivar); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ /* Set type. */ encode_field_decl (field_decl, @@ -11498,12 +11606,12 @@ meth_var_types), eltlist); - /* LLVM LOCAL begin */ + /* APPLE LOCAL begin radar 6285794 */ eltlist = tree_cons (NULL_TREE, convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), eltlist); - /* LLVM LOCAL end */ + /* APPLE LOCAL end radar 6285794 */ initlist = tree_cons (NULL_TREE, objc_build_constructor (type, nreverse (eltlist)), @@ -11621,7 +11729,8 @@ size++; /* Build initializer. */ - initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), NULL_TREE); + /* APPLE LOCAL radar 6285794 */ + initlist = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE); e = build_int_cst (build_pointer_type (objc_protocol_template), size); initlist = tree_cons (NULL_TREE, e, initlist); @@ -11674,12 +11783,12 @@ initlist = tree_cons (NULL_TREE, class_name, initlist); if (!instance_methods) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, @@ -11687,12 +11796,12 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } if (!class_methods) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, @@ -11701,7 +11810,7 @@ } /* protocol_list = */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ { tree protocol_list_ptr = (abi_v2) ? build_pointer_type (objc_v2_protocol_template) @@ -11710,7 +11819,7 @@ if (!protocol_list) initlist = tree_cons (NULL_TREE, convert (protocol_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); else { @@ -11720,7 +11829,7 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } } - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */ if (!abi_v2) { @@ -11732,12 +11841,12 @@ /* APPLE LOCAL begin C* property metadata (Radar 4498373) */ /* struct _objc_property_list *instance_properties; */ if (!property_list) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_prop_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_prop_list_ptr, @@ -11804,12 +11913,12 @@ /* objc_ivar_list = */ if (!ivar_list) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_ivar_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_ivar_list_ptr, @@ -11819,12 +11928,12 @@ /* objc_method_list = */ if (!dispatch_table) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, @@ -11832,7 +11941,7 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ if (flag_next_runtime) /* method_cache = */ initlist = tree_cons (NULL_TREE, @@ -11840,20 +11949,20 @@ (xref_tag (RECORD_TYPE, get_identifier ("objc_cache"))), - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); else { tree null_objc_class_ptr = convert (build_pointer_type (objc_class_template), - build_int_cst (NULL_TREE, 0)); + integer_zero_node); /* dtable = */ initlist = tree_cons (NULL_TREE, convert (build_pointer_type (xref_tag (RECORD_TYPE, get_identifier ("sarray"))), - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); /* subclass_list = */ @@ -11862,10 +11971,10 @@ /* sibling_class = */ initlist = tree_cons (NULL_TREE, null_objc_class_ptr, initlist); } - /* LLVM LOCAL - end NUL pointer */ - + /* APPLE LOCAL end radar 6285794 */ + /* protocol_list = */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ { tree objc_protocol_ptr_ptr = build_pointer_type (build_pointer_type (objc_protocol_template)); @@ -11873,7 +11982,7 @@ if (!protocol_list) initlist = tree_cons (NULL_TREE, convert (objc_protocol_ptr_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); else { @@ -11882,34 +11991,34 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } } - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */ if (flag_next_runtime) { /* const char *ivar_layout; */ if (IS_CLS_META (status)) /* Meta Class ? */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (string_type_node, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { tree ivar_layout = objc_build_ivar_layout (true); if (!ivar_layout) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (string_type_node, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else initlist = tree_cons (NULL_TREE, ivar_layout, initlist); } /* struct _objc_class_ext *ext; */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ if (!objc_class_ext_template) build_objc_class_ext_template (); @@ -11920,7 +12029,7 @@ if (!objc_class_ext) initlist = tree_cons (NULL_TREE, convert (objc_class_ext_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); else { @@ -11929,11 +12038,11 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } } - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ } else /* gc_object_type = NULL */ - /* LLVM LOCAL - NUL pointer */ + /* APPLE LOCAL radar 6285794 - NUL pointer */ initlist = tree_cons (NULL_TREE, null_pointer_node, initlist); /* APPLE LOCAL end radar 4585769 - Objective-C 1.0 extensions */ @@ -12098,19 +12207,19 @@ if (cache) initlist = tree_cons (NULL_TREE, cache, initlist); else - /* LLVM LOCAL - NUL pointer */ + /* APPLE LOCAL radar 6285794 - NUL pointer */ initlist = tree_cons (NULL_TREE, null_pointer_node, initlist); /* vtable */ if (vtable) initlist = tree_cons (NULL_TREE, vtable, initlist); else - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (build_pointer_type (objc_imp_type), - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ /* ro */ initlist = tree_cons (NULL_TREE, ro, initlist); @@ -12154,12 +12263,12 @@ /* APPLE LOCAL begin radar 4695101 */ /* ivarLayout */ if (!ivarLayout) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (string_type_node, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else initlist = tree_cons (NULL_TREE, ivarLayout, initlist); /* APPLE LOCAL end radar 4695101 */ @@ -12169,12 +12278,12 @@ /* baseMethods */ if (!baseMethods) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_method_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_method_list_ptr, @@ -12183,7 +12292,7 @@ } /* baseProtocols */ - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ { tree protocol_list_t_p = build_pointer_type (xref_tag (RECORD_TYPE, @@ -12192,7 +12301,7 @@ if (!baseProtocols) initlist = tree_cons (NULL_TREE, convert (protocol_list_t_p, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); else { @@ -12201,16 +12310,16 @@ initlist = tree_cons (NULL_TREE, expr, initlist); } } - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ /* ivars */ if (!ivars) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_v2_ivar_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_v2_ivar_list_ptr, @@ -12221,12 +12330,12 @@ /* APPLE LOCAL begin radar 4695101 */ /* weakIvarLayout */ if (!weakIvarLayout) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (string_type_node, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else initlist = tree_cons (NULL_TREE, weakIvarLayout, initlist); /* APPLE LOCAL end radar 4695101 */ @@ -12234,12 +12343,12 @@ /* APPLE LOCAL begin C* property metadata (Radar 4498373) */ /* property list */ if (!property_list) - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ initlist = tree_cons (NULL_TREE, convert (objc_prop_list_ptr, - build_int_cst (NULL_TREE, 0)), + integer_zero_node), initlist); - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ else { expr = convert (objc_prop_list_ptr, @@ -12315,17 +12424,36 @@ /* APPLE LOCAL begin radar 4695109 */ /* APPLE LOCAL begin - LLVM radar 5476262 */ #ifdef ENABLE_LLVM - /* LLVM LOCAL - add 'L' prefix */ - sprintf (string, "L_OBJC_PROTOCOL_$_%s", - IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + if (flag_objc_abi == 2) + /* LLVM LOCAL - add 'l' prefix */ + sprintf (string, "l_OBJC_PROTOCOL_$_%s", + IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + else + /* LLVM LOCAL - add 'L' prefix */ + sprintf (string, "L_OBJC_PROTOCOL_$_%s", + IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + expr = lookup_name (get_identifier(string)); + if (expr == NULL_TREE) - /* LLVM LOCAL - &string[1] because of 'L' prefix */ + /* LLVM LOCAL - &string[1] because of '[Ll]' prefix */ expr = start_var_decl (objc_v2_protocol_template, &string[1]); #else - sprintf (string, "_OBJC_PROTOCOL_$_%s", - IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); - expr = start_var_decl (objc_v2_protocol_template, string); + /* APPLE LOCAL begin radar 6255913 */ + if (flag_objc_abi == 2) + { + sprintf (string, "l_OBJC_PROTOCOL_$_%s", + IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + expr = start_var_decl (objc_v2_protocol_template, string); + set_user_assembler_name (expr, string); + } + /* APPLE LOCAL end radar 6255913 */ + else + { + sprintf (string, "_OBJC_PROTOCOL_$_%s", + IDENTIFIER_POINTER (PROTOCOL_NAME (expr))); + expr = start_var_decl (objc_v2_protocol_template, string); + } #endif /* APPLE LOCAL end - LLVM radar 5476262 */ /* APPLE LOCAL end radar 4695109 */ @@ -12524,10 +12652,10 @@ /* root class. */ root_expr = build_unary_op (ADDR_EXPR, metaclass_decl, 0); metaclass_superclass_expr = build_unary_op (ADDR_EXPR, class_decl, 0); - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ class_superclass_expr = convert (build_pointer_type (objc_v2_class_template), - build_int_cst (NULL_TREE, 0)); - /* LLVM LOCAL - end NUL pointer */ + integer_zero_node); + /* APPLE LOCAL end radar 6285794 */ flags |= 0x2; /* CLS_ROOT: it is also a root meta class */ } @@ -12735,13 +12863,13 @@ super_expr = build_c_cast (cast_type, super_expr); /* cast! */ } else - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ { super_expr = convert (string_type_node, - build_int_cst (NULL_TREE, 0)); + integer_zero_node); super_expr = build_c_cast (cast_type, super_expr); /* cast! */ } - /* LLVM LOCAL - end NUL pointer */ + /* APPLE LOCAL end radar 6285794 */ root_expr = add_objc_string (my_root_id, class_names); root_expr = build_c_cast (cast_type, root_expr); /* cast! */ @@ -13051,7 +13179,9 @@ /* hackery to make an obj method look like a function type. */ tree rettype = TREE_TYPE (*node); TREE_TYPE (*node) = build_function_type (TREE_VALUE (rettype), - get_arg_type_list (*node, METHOD_REF, 0)); + /* APPLE LOCAL radar 6307941 */ + get_arg_type_list (METHOD_SEL_NAME (*node), + *node, METHOD_REF, 0)); decl_attributes (node, attributes, flags); METHOD_TYPE_ATTRIBUTES (*node) = TYPE_ATTRIBUTES (TREE_TYPE (*node)); TREE_TYPE (*node) = rettype; @@ -13070,7 +13200,8 @@ arguments (i.e., beyond self and _cmd) shall be represented by `...'. */ static tree -get_arg_type_list (tree meth, int context, int superflag) +/* APPLE LOCAL radar 6307941 */ +get_arg_type_list (tree sel_name, tree meth, int context, int superflag) { tree arglist, akey; @@ -13085,8 +13216,8 @@ /* Selector type - will eventually change to `int'. */ /* APPLE LOCAL begin ObjC new abi */ chainon (arglist, build_tree_list (NULL_TREE, flag_objc_abi == 2 - /* APPLE LOCAL ARM hybrid objc-2.0 */ - && !flag_objc_legacy_dispatch + /* APPLE LOCAL ARM hybrid objc-2.0 - radar 6307941 */ + && !objc_legacy_dispatched_selector_p (sel_name) ? (superflag ? objc_v2_super_selector_type : objc_v2_selector_type) @@ -13654,8 +13785,8 @@ /* APPLE LOCAL ObjC new abi */ /* Code moved down */ /* APPLE LOCAL begin ObjC new abi */ - /* APPLE LOCAL ARM hybrid objc-2.0 */ - if (flag_objc_abi == 2 && !flag_objc_legacy_dispatch) + /* APPLE LOCAL ARM hybrid objc-2.0 - radar 6307941 */ + if (flag_objc_abi == 2 && !objc_legacy_dispatched_selector_p (sel_name)) { tree ret_type; tree message_func_decl; @@ -13725,9 +13856,10 @@ /* (*_msg.messenger) (receiver, &_msg, ...); */ retval = build_v2_build_objc_method_call (super, method_prototype, - receiver, selector, - method_params, - check_for_nil); + /* APPLE LOCAL radar 6307941 */ + receiver, sel_name, selector, + method_params, + check_for_nil); } else { @@ -13741,7 +13873,8 @@ /* APPLE LOCAL end radar 4359757 */ retval = build_objc_method_call (super, method_prototype, - receiver, + /* APPLE LOCAL radar 6307941 */ + receiver, sel_name, selector, method_params); } /* APPLE LOCAL end ObjC new abi */ @@ -13760,7 +13893,8 @@ static tree build_objc_method_call (int super_flag, tree method_prototype, - tree lookup_object, tree selector, + /* APPLE LOCAL radar 6307941 */ + tree lookup_object, tree sel_name, tree selector, tree method_params) { tree sender = (super_flag ? umsg_super_decl : @@ -13779,7 +13913,9 @@ ? TREE_VALUE (TREE_TYPE (method_prototype)) : objc_object_type); /* APPLE LOCAL begin radar 3803157 - objc attribute */ - tree method_param_types = get_arg_type_list (method_prototype, METHOD_REF, super_flag); + /* APPLE LOCAL radar 6307941 */ + tree method_param_types = get_arg_type_list (sel_name, method_prototype, + METHOD_REF, super_flag); tree ftype = build_function_type (ret_type, method_param_types); tree sender_cast; tree method, t; @@ -13856,9 +13992,9 @@ static tree build_v2_build_objc_method_call (int super_flag, tree method_prototype, - tree lookup_object, tree selector, - tree method_params, - bool check_for_nil) + tree lookup_object, tree sel_name, + tree selector, tree method_params, + bool check_for_nil) { tree ret_val; tree sender, rcv_p, t; @@ -13866,7 +14002,8 @@ = (method_prototype ? TREE_VALUE (TREE_TYPE (method_prototype)) : objc_object_type); - tree method_param_types = get_arg_type_list (method_prototype, + /* APPLE LOCAL radar 6307941 */ + tree method_param_types = get_arg_type_list (sel_name, method_prototype, METHOD_REF, super_flag); /* APPLE LOCAL begin radar 3803157 - objc attribute */ tree ftype = build_function_type (ret_type, method_param_types); @@ -13936,8 +14073,12 @@ /* static struct protocol_t _OBJC_PROTOCOL_$; */ - proto_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL_$", p); - decl = start_var_decl (objc_v2_protocol_template, proto_name); + /* APPLE LOCAL begin radar 6255913 */ + proto_name = synth_id_with_class_suffix ("l_OBJC_PROTOCOL_$", p); + decl = create_hidden_decl (objc_v2_protocol_template, proto_name); + DECL_WEAK (decl) = 1; + set_user_assembler_name (decl, proto_name); + /* APPLE LOCAL end radar 6255913 */ PROTOCOL_V2_FORWARD_DECL (p) = decl; /* APPLE LOCAL begin - LLVM radar 5476262 */ #ifdef ENABLE_LLVM @@ -14039,11 +14180,11 @@ refs_expr = convert (build_pointer_type (objc_v2_protocol_template), build_unary_op (ADDR_EXPR, refs_decl, 0)); else - /* LLVM LOCAL - begin NUL pointer */ + /* APPLE LOCAL begin radar 6285794 */ refs_expr = convert (build_pointer_type (objc_v2_protocol_template), - build_int_cst (NULL_TREE, 0)); - /* LLVM LOCAL - end NUL pointer */ + integer_zero_node); + /* APPLE LOCAL end radar 6285794 */ /* APPLE LOCAL begin radar 4695101 */ /* Build table of list of properties for this protocol. */ @@ -15804,7 +15945,8 @@ PROPERTY_READONLY (cl_prop) == boolean_true_node && PROPERTY_READONLY (property) == boolean_true_node && objc_compare_types (TREE_TYPE (cl_prop), TREE_TYPE (property), - -6, NULL_TREE)) + /* APPLE LOCAL radar 6231433 */ + -6, NULL_TREE, NULL)) ; else warning (0, "property %qs type does not match %s %qs property type", @@ -16724,6 +16866,27 @@ } /* APPLE LOCAL end radar 4968128 */ +/* APPLE LOCAL begin radar 6017984 */ +/* This routine merges all methods declared in the protocol-list + into the current class. */ +static void +objc_merge_protocol_methods (tree class, tree rproto_list) +{ + tree rproto; + for (rproto = rproto_list; rproto; rproto = TREE_CHAIN (rproto)) + { + tree p = TREE_VALUE (rproto); + if (TREE_CODE (p) == PROTOCOL_INTERFACE_TYPE) + { + objc_merge_methods (class, PROTOCOL_CLS_METHODS (p), '+'); + objc_merge_methods (class, PROTOCOL_NST_METHODS (p), '-'); + /* Search in nested protocols also. */ + objc_merge_proto_properties_in_class (class, PROTOCOL_LIST (p)); + } + } +} +/* APPLE LOCAL end radar 6017984 */ + /* This is called once we see the "@end" in an interface/implementation. */ static void @@ -17014,6 +17177,12 @@ { objc_merge_methods (primary, CLASS_NST_METHODS (class), '-'); objc_merge_methods (primary, CLASS_CLS_METHODS (class), '+'); + /* APPLE LOCAL begin radar 6017984 */ + /* Just as we are adding anonymous category's methods to the + primary class, must also add methods in anonymous category's protocols + to the class as well, */ + objc_merge_protocol_methods (primary, CLASS_PROTOCOL_LIST (class)); + /* APPLE LOCAL end radar 6017984 */ } } /* APPLE LOCAL end radar 4965989 */ @@ -17925,13 +18094,16 @@ return 0; if (!objc_types_share_size_and_alignment (type1, type2)) return 0; - if (strict == 1 && !objc_compare_types(type1, type2, -2, 0)) + /* APPLE LOCAL radar 6231433 */ + if (strict == 1 && !objc_compare_types(type1, type2, -2, 0, NULL)) return 0; } /* Compare argument types. */ - for (type1 = get_arg_type_list (proto1, METHOD_REF, 0), - type2 = get_arg_type_list (proto2, METHOD_REF, 0); + /* APPLE LOCAL begin radar 6307941 */ + for (type1 = get_arg_type_list (METHOD_SEL_NAME (proto1), proto1, METHOD_REF, 0), + type2 = get_arg_type_list (METHOD_SEL_NAME (proto2), proto2, METHOD_REF, 0); + /* APPLE LOCAL end radar 6307941 */ type1 && type2; type1 = TREE_CHAIN (type1), type2 = TREE_CHAIN (type2)) { @@ -17941,7 +18113,8 @@ if (!objc_types_share_size_and_alignment (TREE_VALUE (type1), TREE_VALUE (type2))) return 0; /* Note, order of type2 and type1 in argument call is intentional. */ - if (strict == 1 && !objc_compare_types(TREE_VALUE (type2), TREE_VALUE (type1), -2, 0)) + /* APPLE LOCAL radar 6231433 */ + if (strict == 1 && !objc_compare_types(TREE_VALUE (type2), TREE_VALUE (type1), -2, 0, NULL)) return 0; } } @@ -18119,7 +18292,8 @@ meth_type = build_function_type (ret_type, - get_arg_type_list (method, METHOD_DEF, 0)); + /* APPLE LOCAL radar 6307941 */ + get_arg_type_list (METHOD_SEL_NAME (method), method, METHOD_DEF, 0)); /* APPLE LOCAL radar 5839812 - location for synthesized methods */ objc_start_function (method_id, meth_type, NULL_TREE, parmlist, method); @@ -19131,7 +19305,7 @@ build_index_type (build_int_cst (NULL_TREE, 2 - 1)))); /* LLVM LOCAL */ #endif - initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, 0)); + initlist = build_tree_list (NULL_TREE, integer_zero_node); initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), initlist); initlist = objc_build_constructor (TREE_TYPE (decl), nreverse (initlist)); TREE_TYPE (initlist) = TREE_TYPE (decl); @@ -19431,11 +19605,11 @@ constructor_fields = TYPE_FIELDS (fast_enum_state_type); /* __objcFastEnumerationState enumState = { 0 }; */ *enumState_decl = objc_create_named_tmp_var (fast_enum_state_type, "cstar"); - /* LLVM LOCAL begin */ + /* APPLE LOCAL begin radar 6285794 */ initlist = build_tree_list (constructor_fields, convert (TREE_TYPE(constructor_fields), - build_int_cst (NULL_TREE, 0))); - /* LLVM LOCAL end */ + integer_zero_node)); + /* APPLE LOCAL end radar 6285794 */ init = objc_build_constructor (fast_enum_state_type, initlist); DECL_INITIAL (*enumState_decl) = init; @@ -20006,7 +20180,8 @@ #endif comparison_result = comptypes (ivar_type, property_type) != 1; if (comparison_result - && !objc_compare_types (property_type, ivar_type, -5, NULL_TREE)) + /* APPLE LOCAL radar 6231433 */ + && !objc_compare_types (property_type, ivar_type, -5, NULL_TREE, NULL)) /* APPLE LOCAL end radar 6029624 */ /* APPLE LOCAL end radar 5389292 */ { Modified: llvm-gcc-4.2/trunk/gcc/stub-objc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-objc.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-objc.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-objc.c Mon Nov 3 01:33:15 2008 @@ -102,19 +102,23 @@ bool objc_compare_types (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp), - int ARG_UNUSED (argno), tree ARG_UNUSED (callee)) + /* APPLE LOCAL begin radar 6231433 */ + int ARG_UNUSED (argno), tree ARG_UNUSED (callee), + const char * ARG_UNUSED (message)) + /* APPLE LOCAL end radar 6231433 */ { return false; } -/* APPLE LOCAL begin radar 4229905 */ +/* APPLE LOCAL begin radar 4229905 - radar 6231433 */ bool objc_have_common_type (tree ARG_UNUSED (ltyp), tree ARG_UNUSED (rtyp), - int ARG_UNUSED (argno), tree ARG_UNUSED (callee)) + int ARG_UNUSED (argno), tree ARG_UNUSED (callee), + const char * ARG_UNUSED (message)) { return false; } -/* APPLE LOCAL end radar 4229905 */ +/* APPLE LOCAL end radar 4229905 - radar 6231433 */ void objc_volatilize_decl (tree ARG_UNUSED (decl)) @@ -592,7 +596,12 @@ } bool block_requires_copying (tree exp) { - return TREE_CODE (TREE_TYPE (exp)) == BLOCK_POINTER_TYPE; + /* APPLE LOCAL begin radar 6175959 */ + tree type = TREE_TYPE (exp); + return TREE_CODE (type) == BLOCK_POINTER_TYPE + || (POINTER_TYPE_P (type) + && lookup_attribute ("NSObject", TYPE_ATTRIBUTES (type))); + /* APPLE LOCAL end radar 6175959 */ } /* APPLE LOCAL end radar 5782740 - blocks */ Modified: llvm-gcc-4.2/trunk/gcc/tree-inline.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-inline.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-inline.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-inline.c Mon Nov 3 01:33:15 2008 @@ -1278,14 +1278,15 @@ var = modify_dest; use = NULL; - /* LLVM LOCAL begin */ + /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM - /* The return node may not dominate all of its uses. Because of this, - conservatively don't consider it for SSA form anymore. */ - if (TREE_CODE (var) == VAR_DECL) - DECL_GIMPLE_FORMAL_TEMP_P (var) = 0; + /* The return node may not dominate all of its uses. Because of this, + conservatively don't consider it for SSA form anymore. */ + if (TREE_CODE (var) == VAR_DECL) + DECL_GIMPLE_FORMAL_TEMP_P (var) = 0; #endif /* LLVM LOCAL end */ + goto done; } } Modified: llvm-gcc-4.2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Nov 3 01:33:15 2008 @@ -5108,6 +5108,11 @@ { tree t; + /* APPLE LOCAL begin radar 6300081 */ + if (!generic_block_literal_struct_type) + generic_block_literal_struct_type = build_generic_block_struct_type (); + /* APPLE LOCAL end radar 6300081 */ + t = make_node (BLOCK_POINTER_TYPE); TREE_TYPE (t) = to_type; Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Mon Nov 3 01:33:15 2008 @@ -4850,7 +4850,10 @@ extern void note_alternative_entry_points (void); /* APPLE LOCAL end CW asm blocks */ -/* APPLE LOCAL radar 6113240 */ -extern GTY(()) tree invoke_impl_ptr_type; +/* APPLE LOCAL begin radar 6300081 */ +extern GTY(()) tree generic_block_literal_struct_type; + +extern tree build_generic_block_struct_type (void); +/* APPLE LOCAL end radar 6300081 */ #endif /* GCC_TREE_H */ Modified: llvm-gcc-4.2/trunk/gcc/varasm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/varasm.c (original) +++ llvm-gcc-4.2/trunk/gcc/varasm.c Mon Nov 3 01:33:15 2008 @@ -2974,7 +2974,12 @@ /* Create a string containing the label name, in LABEL. */ labelno = const_labelno++; - ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); + /* APPLE LOCAL begin radar 6243961 */ + if (flag_writable_strings && TREE_CODE (exp) == STRING_CST) + ASM_GENERATE_INTERNAL_LABEL (label, "lC", labelno); + else + ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); + /* APPLE LOCAL end radar 6243961 */ /* We have a symbol name; construct the SYMBOL_REF and the MEM. */ if (use_object_blocks_p ()) @@ -3027,6 +3032,12 @@ struct constant_descriptor_tree key; void **loc; + /* APPLE LOCAL begin radar 6243961 */ + int save_flag_writable_strings = flag_writable_strings; + if (flag_writable_strings && TREE_CODE (exp) == STRING_CST + && darwin_constant_cfstring_p (exp)) + flag_writable_strings = 0; + /* APPLE LOCAL end radar 6243961 */ /* Look up EXP in the table of constant descriptors. If we didn't find it, create a new one. */ key.value = exp; @@ -3042,6 +3053,8 @@ } maybe_output_constant_def_contents (desc, defer); + /* APPLE LOCAL radar 6243961 */ + flag_writable_strings = save_flag_writable_strings; return desc->rtl; } Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=58599&r1=58598&r2=58599&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Mon Nov 3 01:33:15 2008 @@ -11,12 +11,12 @@ /* APPLE LOCAL begin Apple version */ #ifdef ENABLE_LLVM #ifdef LLVM_VERSION_INFO -#define VERSUFFIX " (Based on Apple Inc. build 5623) (LLVM build " LLVM_VERSION_INFO ")" +#define VERSUFFIX " (Based on Apple Inc. build 5627) (LLVM build " LLVM_VERSION_INFO ")" #else -#define VERSUFFIX " (Based on Apple Inc. build 5623) (LLVM build)" +#define VERSUFFIX " (Based on Apple Inc. build 5627) (LLVM build)" #endif #else -#define VERSUFFIX " (Based on Apple Inc. build 5623)" +#define VERSUFFIX " (Based on Apple Inc. build 5627)" #endif /* APPLE LOCAL end Apple version */ From evan.cheng at apple.com Mon Nov 3 01:47:52 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 2 Nov 2008 23:47:52 -0800 Subject: [llvm-commits] Patch: generalize vector shuffle In-Reply-To: <00BEE636-9DBF-40CE-A322-1A50F2D6BEE3@apple.com> References: <7C812DE7-E002-4767-A0AE-192738C25237@apple.com> <00BEE636-9DBF-40CE-A322-1A50F2D6BEE3@apple.com> Message-ID: Hi Mon Ping, Thanks for doing this. It's an important improvement. However, this patch is hard (at least for me) to digest. It's just a lot of code. :-) Some of the functions have become so big that it's hard to follow. For example, SplitVecRes_VECTOR_SHUFFLE. Is it possible to factor some stuff out? Also, some of code seems to be replicated in several functions (please correct me if that's not the case). For example, the code that determines how an element is used. A stylistic nitpick: + if (VT1NumElems*2 == NumElems && SequentialMask(Mask, 0)) { + setValue(&I, DAG.getNode(ISD::CONCAT_VECTORS, VT, V1, V2)); + return; + } + else { The else { } isn't needed because of the early exit. Same issue here: + if (VT1NumElems == NumElems && SequentialMask(Mask,0)) { + setValue(&I, V1); + return; + } else if (VT1NumElems == NumElems && SequentialMask(Mask,NumElems)) { + setValue(&I, V2); + return; + } else { + // Analyze the access pattern of the vector to see if we can extract + // two subvectors and do the shuffle. Don't forget to end comment sentences with periods. :-) Evan On Oct 31, 2008, at 7:56 PM, Mon Ping Wang wrote: > From duncan.sands at math.u-psud.fr Mon Nov 3 02:30:20 2008 From: duncan.sands at math.u-psud.fr (Duncan Sands) Date: Mon, 3 Nov 2008 09:30:20 +0100 Subject: [llvm-commits] Recent apple changes broke the Ada build Message-ID: <200811030930.20704.duncan.sands@math.u-psud.fr> Hi Bill, I'm getting these errors when building Ada: libbackend.a(dwarf2out.o): In function `add_type_attribute': gcc/dwarf2out.c:11732: undefined reference to `generic_block_literal_struct_type' libbackend.a(gtype-desc.o):(.rodata+0x9f8): undefined reference to `generic_block_literal_struct_type' libbackend.a(tree.o): In function `build_block_pointer_type': gcc/tree.c:5112: undefined reference to `generic_block_literal_struct_type' gcc/tree.c:5113: undefined reference to `build_generic_block_struct_type' gcc/tree.c:5113: undefined reference to `generic_block_literal_struct_type' Can you please take care of it. I understand that you can't reasonably try to build Ada before committing, but maybe in the future you can check that Fortran builds (both languages usually fail to build when Apple changes put C stuff in non-C places): it should just be a matter of adding "fortran" to --enable-languages=. Since Fortran is (hopefully) going to be included in the next release, it would anyway be good to regularly test Fortran. Ciao, Duncan. From isanbard at gmail.com Mon Nov 3 02:36:00 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 03 Nov 2008 08:36:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58601 - in /llvm-gcc-4.2/trunk/gcc/testsuite: ./ bugs/powerpc/ g++.apple/ g++.dg/ gcc.apple/ gcc.dg/cpp/ gcc.target/i386/ gcc.target/powerpc/ gcc.target/x86_64/abi/ obj-c++.dg/ objc.dg/ objc.dg/special/ Message-ID: <200811030836.mA38a8Rt011324@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 02:35:57 2008 New Revision: 58601 URL: http://llvm.org/viewvc/llvm-project?rev=58601&view=rev Log: Sync with Apple GCC mainline. Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-66.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-destructors.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-duplicate-err.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-this.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in-foreach-header.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in_structors.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-localisglobal.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested-block-var.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-objectassign.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-printf-attribute-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-sentinel-attribute.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-method-call.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/cp-block-byref-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/debug-inlined-section.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-weak.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/prototype.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/template.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/warn-ctors.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5813921.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5919583.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6187262.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6222167.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6227434.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6258941.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6286881.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6308664.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6310728.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-duplicate-err.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-in-foreach-header.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-localisglobal.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nested-block-var.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-no-block-def.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-objectassign.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-printf-attribute-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-sentinel-attribute.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.h llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/longcall-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/no-nested-deprecated-warn.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/r6292557.c llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cond-expr-warn.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-type-attribute.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-property-enumtype.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-missing-comma.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-9.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6255801.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6311054.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/cond-expr-warn.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-lvalue-cast-warn.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-property-enumtype.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-newmetadata-sections.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-property-typedefprotocol.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-sendsuper_msg.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-missing-comma.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/unimplemented-anon-category.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-5992047.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcglobal.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcivar.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcstrongcast.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgcivar.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-attributes-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-block-property-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-4.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-5.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-6.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-8.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref-attribute.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-codegen-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-complicated-type.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-continuation.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copy-destroy.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copyconstructor.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-dup-invoke_impl.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-enum.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-do.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-goto.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-nested-while.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-switch.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-while.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-return-type.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-global-byref-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-literal.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-local-stack.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-3.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nullblockisa.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgc.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgcivar.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-reference-in-method.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-parameter.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-warn.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-recovercpp.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/lookup-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-3.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext4.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext7.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4104248.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4113078.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4115609.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4167459.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4182984.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4603883.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5b.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5d.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-17.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-18.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-24.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-25.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-31.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-32.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-33.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-35.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-36.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-41.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-45.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-50.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-54.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-55.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-57.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-6.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-7.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-test-nofralloc.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-5992047.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-6116917.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcglobal.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcivar.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcstrongcast.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgcivar.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-attributes-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-block-property-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-4.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-5.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-6.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-7.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-8.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-attribute.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-codegen-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-complicated-type.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-copy-destroy.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-dup-invoke_impl.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-enum.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-error-global-byref.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-do.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-goto.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-nested-while.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-switch.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-while.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-explicit-return-type.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-literal.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-stack.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-static-test.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nullblockisa.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgc.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgcivar.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-parameter.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-warn.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-x86_32-sse3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/dynamic-no-pic-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-att-stub-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-deep-branch-predict-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-regparmandstackparm-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-ssetype-6.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-unaligned-movaps.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/opt-size-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/_Pragma3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/4891561.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/reload-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-12.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-13.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/layout-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fpret-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-8.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-weak-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-stret-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-5.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-9.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-neg-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/sync-objc-exception.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-7.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/try-catch-20.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-12.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-6.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7a.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/layout-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-dir-dispatch.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-7.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-weak-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-alignment-test-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-4.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-5.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-9.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/selector-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/special/unclaimed-category-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/sync-objc-exception.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-17.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/volatile-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Mon Nov 3 02:35:57 2008 @@ -1,3 +1,629 @@ +2008-10-31 Stuart Hastings + + Radar 5813291 + * gcc.apple/5813291.c: New. + +2008-10-31 Fariborz Jahanian + + Radar 6175959 + * gcc.apple/block-5992047.c: Modified + * gcc.apple/block-objectassign.c: Add + * g++.apple/block-objectassign.C: Add + * g++.apple/block-5992047.C: Modified + +2008-10-28 Fariborz Jahanian + + Radar 6329245 + * gcc.apple/block-nullblockisa.c: Modified + * gcc.apple/block-blocks-test-8.c: Modified + * gcc.apple/block-6116917.c: Modified + * g++.apple/block-nullblockisa.C: Modified + * g++.apple/block-blocks-test-8.C: Modified + * g++.apple/blocks-recovercpp.C: Modified + +2008-10-28 Fariborz Jahanian + + Radar 6261630 + * obj-c++.dg/method-type-attribute.mm: Add + +2008-10-27 Fariborz Jahanian + + Radar 6231433 + * objc.dg/cond-expr-warn.m: Add + * obj-c++.dg/cond-expr-warn.mm: Add + +2008-10-27 Fariborz Jahanian + + Radar 6302949 + * objc.dg/property-missing-comma.m: Add + * obj-c++.dg/property-missing-comma.mm: Add + +2008-10-24 Fariborz Jahanian + + Radar 6305545 + * g++.apple/block-in_structors.C: Add + +2008-10-24 Stuart Hastings + + Radar 308664 6310728 6311054 6311100 + * gcc.apple/6310728.c: New. + * gcc.apple/6308664.c: New. + * objc.dg/6311054.m: New. + +2008-10-24 Josh Conner + + Radar 6305331 + * gcc.apple/longcall-2.c: New test. + +2008-10-22 Fariborz Jahanian + + Radar 6310599 + * gcc.apple/block-duplicate-err.c: Add + * g++.apple/block-duplicate-err.C: Add + +2008-10-21 Stuart Hastings + + Radar 6187262 + * gcc.apple/6187262.c: New. + +2008-10-21 Fariborz Jahanian + + Radar 4746503 + * gcc.apple/no-nested-deprecated-warn.c: Add + +2008-10-20 Stuart Hastings + + Radar 6222167 + * gcc.apple/6222167.c: New. + +2008-10-20 Fariborz Jahanian + + Radar 6255595 + * objc.dg/objc2-newmetadata-sections.m: New + +2008-10-17 Fariborz Jahanian + + Radar 6289031 + * gcc.apple/block-escape-do.c: Modified + * gcc.apple/block-escape-goto.c: Modified + * gcc.apple/block-escape-return.c: Modified + * gcc.apple/block-escape-while.c: Modified + * gcc.apple/block-noescape-helper.c: Modified + * gcc.apple/block-escape-for.c: Modified + * gcc.apple/block-escape-for1.c: Modified + * gcc.apple/block-noescape-helper-1.c: Modified + * gcc.apple/block-noescape-helper-2.c: Modified + +2008-10-15 Stuart Hastings + + Radar 6255801 + * objc.dg/6255801.m: New. + +2008-10-16 Fariborz Jahanian + + Radar 6276695 + * gcc.apple/block-blocks-test-4.c: Modified + * gcc.apple/block-byref.c: Modified + * gcc.apple/block-noescape-helper-3.c: Modified + * gcc.apple/block-error-global-byref.c: Modified + * gcc.apple/block-block-property-2.c: Modified + * gcc.apple/block-blocks-test-5.c: Modified + * gcc.apple/block-escape-do.c: Modified + * gcc.apple/block-escape-switch.c: Modified + * gcc.apple/block-enum.c: Modified + * gcc.apple/block-assignweakgc-1.c: Modified + * gcc.apple/block-assigngcstrongcast.c: Modified + * gcc.apple/block-unused-parameter.c: Modified + * gcc.apple/block-blocks-test-6.c: Modified + * gcc.apple/block-escape-goto.c: Modified + * gcc.apple/block-escape-return.c: Modified + * gcc.apple/block-global-byref.c: Modified + * gcc.apple/block-byref-attribute.c: Modified + * gcc.apple/block-unused-warn.c: Modified + * gcc.apple/block-blocks-test-7.c: Modified + * gcc.apple/block-readweakgc.c: Modified + * gcc.apple/block-blocks-test-8.c: Modified + * gcc.apple/block-escape-while.c: Modified + * gcc.apple/block-codegen-1.c: Modified + * gcc.apple/block-assignweakgc.c: Modified + * gcc.apple/block-readweakgcivar.c: Modified + * gcc.apple/block-blocks-test-1.c: Modified + * gcc.apple/block-noescape-helper.c: Modified + * gcc.apple/block-escape-for.c: Modified + * gcc.apple/block-escape-nested-while.c: Modified + * gcc.apple/block-escape-for1.c: Modifie.c: Modified + * gcc.apple/block-blocks-test-2.c: Modified + * gcc.apple/block-noescape-helper-1.c: Modified + * gcc.apple/block-assigngcglobal.c: Modified + * gcc.apple/block-copy-destroy.c: Modified + * gcc.apple/block-global-byref-1.c: Modified + * gcc.apple/block-assigngcivar.c: Modified + * gcc.apple/block-blocks-test-3.c: Modified + * gcc.apple/block-escape-return1.c: Modified + * gcc.apple/block-noescape-helper-2.c: Modified + * gcc.apple/block-assignweakgcivar.c: Modified + * gcc.apple/block-dup-invoke_impl.c: Modified + * gcc.apple/block-global-byref-2.c: Modified + * g++.apple/block-byref.C: Modified + * g++.apple/block-noescape-helper-3.C: Modified + * g++.apple/block-block-property-2.C: Modified + * g++.apple/block-blocks-test-5.C: Modified + * g++.apple/block-escape-do.C: Modified + * g++.apple/block-escape-switch.C: Modified + * g++.apple/block-enum.C: Modified + * g++.apple/block-assignweakgc-1.C: Modified + * g++.apple/block-assigngcstrongcast.C: Modified + * g++.apple/block-unused-parameter.C: Modified + * g++.apple/block-blocks-test-6.C: Modified + * g++.apple/block-escape-goto.C: Modified + * g++.apple/block-escape-return.C: Modified + * g++.apple/block-unused-warn.C: Modified + * g++.apple/block-byref-attribute.C: Modified + * g++.apple/block-nested.C: Modified + * g++.apple/block-blocks-test-7.C: Modified + * g++.apple/block-readweakgc.C: Modified + * g++.apple/block-blocks-test-8.C: Modified + * g++.apple/block-escape-while.C: Modified + * g++.apple/block-codegen-1.C: Modified + * g++.apple/block-assignweakgc.C: Modified + * g++.apple/block-readweakgcivar.C: Modified + * g++.apple/block-blocks-test-1.C: Modified + * g++.apple/block-noescape-helper.C: Modified + * g++.apple/block-escape-for.C: Modified + * g++.apple/block-escape-nested-while.C: Modified + * g++.apple/block-escape-for1.C: Modified + * g++.apple/block-blocks-test-2.C: Modified + * g++.apple/block-noescape-helper-1.C: Modified + * g++.apple/block-assigngcglobal.C: Modified + * g++.apple/block-copy-destroy.C: Modified + * g++.apple/block-assigngcivar.C: Modified + * g++.apple/block-blocks-test-3.C: Modified + * g++.apple/block-escape-return1.C: Modified + * g++.apple/block-noescape-helper-2.C: Modified + * g++.apple/block-assignweakgcivar.C: Modified + * g++.apple/block-dup-invoke_impl.C: Modified + * g++.apple/block-global-byref-2.C: Modified + * g++.apple/block-blocks-test-4.C: Modified +2008-10-16 Fariborz Jahanian + + Radar 6017984 + * objc.dg/unimplemented-anon-category.m: Add + +2008-10-15 Fariborz Jahanian + + Radar 6285794 + * objc.dg/symtab-1-64bit.m: Modified + +2008-10-15 Fariborz Jahanian + + Radar 6271728 + * obj-c++.dg/syntax-error-7.mm: Modified + * obj-c++.dg/syntax-error-9.mm: Add + +2008-10-14 Fariborz Jahanian + + Radar 6275956 + * g++.apple/block-explicit-this.C: Add + +2008-10-14 Fariborz Jahanian + + Radar 6286881 + * gcc.apple/6286881.c: New + +2008-10-13 Devang Patel + + Radar 6184418 + * gcc.apple/block-nested.c: Undo previous fix. + * gcc.apple/block-byref-block.c: Undo previous fix. + * gcc.apple/block-6116917.c: Undo previous fix. + * gcc.apple/align-test-5c.c: Undo previous fix. + * g++.apple/block-byref-block.c: Undo previous fix. + * objc-c++.dg/objc-gc-5.mm: Undo previous fix. + * objc.dg/objc-gc-3.m: Undo previous fix. + +2008-10-13 Fariborz Jahanian + + Radar 6255913 + * objc.dg/objc2-protocol-1.m: Modifed + * objc.dg/objc2-protocol-9.m: Modifed + * objc.dg/objc2-protocol-2.m: Modifed + * objc.dg/objc2-protocol-4.m: Modifed + * objc.dg/objc2-protocol-5.m: Modifed + * obj-c++.dg/objc2-protocol-9.mm: Modifed + * obj-c++.dg/objc2-protocol-4.mm: Modifed + * obj-c++.dg/objc2-protocol-5.mm: Modifed + * obj-c++.dg/objc2-protocol-1.mm: Modifed + * obj-c++.dg/objc2-protocol-2.mm: Modifed + +2008-10-10 Fariborz Jahanian + + Radar 5847213 - New block ABI + + * gcc.apple/block-nullblockisa.c: Modified + * gcc.apple/block-blocks-test-8.c: Modified + * gcc.apple/block-6116917.c: Modified + * gcc.apple/block-nested-block-var.c: Modified + * g++.apple/block-nullblockisa.C: Modified + * g++.apple/block-blocks-test-8.C: Modified + * g++.apple/blocks-recovercpp.C: Modified + * g++.apple/block-nested-block-var.C: Modified + +2008-10-10 Stuart Hastings + + Radar 6227434 + * gcc.apple/6227434.c: New. + +2008-10-10 Caroline Tice a + + Radar 6275985 + * obj-c++.dg/dwarf-1.mm : Modify to expect function name + to be in __debug_str section. + * gcc.apple/debug-inlined-section.c: New testcase. + * gcc.apple/debug-inlined-section.h: New testcase. + * g++.apple/debug-inlined-section.C: New testcase. + +2008-10-09 Fariborz Jahanian + + Radar 6269491 + * objc.dg/objc-gc-lvalue-cast-warn.m: Add + * objc.dg/objc-gc-7.m: Modified + * objc.dg/objc-gc-weak-1.m: Modified + * objc.dg/objc-gc-1.m: Modified + * objc.dg/objc-gc-2.m: Modified + * obj-c++.dg/objc-gc-2.mm: Modified + * obj-c++.dg/objc-gc-weak-1.mm: Modified + * obj-c++.dg/objc-gc-8.mm: Modified + * obj-c++.dg/objc-gc-1.mm: Modified + + +2008-10-09 Devang Patel + + Radar 6184418 + * gcc.target/powerpc/darwin-bool-1.c: Require ilp32. + * gcc.target/i386/4891561.c: Require ilp32. + * gcc.target/i386/stack-prot-kernel.c: Require ilp32. + * gcc.target/i386/reload-1.c: Require ilp32. + * gcc.apple/asm-block-18.c: Require ilp32. + * gcc.apple/align-test-5d.c: Require ilp32. + * gcc.apple/block-byref-block.c: Require ilp32. + * gcc.apple/4525731-2.c: Require ilp32. + * gcc.apple/asm-block-6.c: Require ilp32. + * gcc.apple/i386-ssetype-6.c: Require ilp32. + * gcc.apple/asm-block-36.c: Require ilp32. + * gcc.apple/asm-block-45.c: Require ilp32. + * gcc.apple/4182984.c: Require ilp32. + * gcc.apple/bswap-1.c: Require ilp32. + * gcc.apple/asm-block-7.c: Require ilp32. + * gcc.apple/asm-block-54.c: Require ilp32. + * gcc.apple/4603883.c: Require ilp32. + * gcc.apple/default-x86_32-sse3.c: Require ilp32. + * gcc.apple/i386-att-stub-1.c: Require ilp32. + * gcc.apple/asm-block-13.c: Require ilp32. + * gcc.apple/asm-block-55.c: Require ilp32. + * gcc.apple/i386-bitmask1.c: Require ilp32. + * gcc.apple/block-nested.c: Require ilp32. + * gcc.apple/asm-block-31.c: Require ilp32. + * gcc.apple/i386-regparmandstackparm-1.c: Require ilp32. + * gcc.apple/block-blocks-test-8.c: Require ilp32. + * gcc.apple/asm-block-32.c: Require ilp32. + * gcc.apple/asm-block-57.c: Require ilp32. + * gcc.apple/asm-block-41.c: Require ilp32. + * gcc.apple/asm-block-24.c: Require ilp32. + * gcc.apple/i386-unaligned-movaps.c: Require ilp32. + * gcc.apple/i386-deep-branch-predict-1.c: Require ilp32. + * gcc.apple/asm-block-50.c: Require ilp32. + * gcc.apple/asm-block-33.c: Require ilp32. + * gcc.apple/default-cpu-1.c: Require ilp32. + * gcc.apple/opt-size-2.c: Require ilp32. + * gcc.apple/align-test-5b.c: Require ilp32. + * gcc.apple/4104248.c: Require ilp32. + * gcc.apple/asm-block-25.c: Require ilp32. + * gcc.apple/4167459.c: Require ilp32. + * gcc.apple/const-cfstring-3.c: Require ilp32. + * gcc.apple/4115609.c: Require ilp32. + * gcc.apple/asm-block-17.c: Require ilp32. + * gcc.apple/default-cpu-2.c: Require ilp32. + * gcc.apple/align-test-5c.c: Require ilp32. + * gcc.apple/4113078.c: Require ilp32. + * gcc.apple/4525731-1.c: Require ilp32. + * gcc.apple/dynamic-no-pic-1.c: Require ilp32. + * gcc.apple/asm-test-nofralloc.c: Require ilp32. + * gcc.apple/block-6116917.c: Require ilp32. + * gcc.apple/asm-block-35.c: Require ilp32. + * g++.dg/kext4.C: Require ilp32. + * g++.dg/apple-longcall-2.C: Require ilp32. + * g++.dg/kext7.C: Require ilp32. + * g++.dg/apple-longcall-3.C: Require ilp32. + * objc.dg/objc-fast-4.m: Require ilp32. + * objc.dg/objc-dir-dispatch.m: Require ilp32. + * objc.dg/objc-fpret-2.m: Require ilp32. + * objc.dg/objc-gc-3.m: Require ilp32. + * objc.dg/const-str-10.m: Require ilp32. + * objc.dg/try-catch-17.m: Require ilp32. + * objc.dg/objc2-alignment-test-1.m: Require ilp32. + * objc.dg/const-str-11.m: Require ilp32. + * objc.dg/objc-visibility-hidden-1.m: Require ilp32. + * objc.dg/selector-3.m: Require ilp32. + * objc.dg/objc-gc-section-1.m: Require ilp32. + * objc.dg/const-str-12.m: Require ilp32. + * objc.dg/symtab-1.m: Require ilp32. + * objc.dg/objc-gc-section-2.m: Require ilp32. + * objc.dg/volatile-1.m: Require ilp32. + * objc.dg/const-str-13.m: Require ilp32. + * objc.dg/stubify-2.m: Require ilp32. + * objc.dg/special/unclaimed-category-1.m: Require ilp32. + * objc.dg/encode-7a.m: Require ilp32. + * objc.dg/layout-1.m: Require ilp32. + * objc.dg/bitfield-3.m: Require ilp32. + * objc.dg/defs-warn-1.m: Require ilp32. + * objc.dg/objc-fast-1.m: Require ilp32. + * objc.dg/stret-2.m: Require ilp32. + * objc.dg/zero-link-2.m: Require ilp32. + * objc.dg/objc-fast-2.m: Require ilp32. + * objc.dg/method-4.m: Require ilp32. + * objc.dg/sync-objc-exception.m: Require ilp32. + * objc.dg/next-runtime-1.m: Require ilp32. + * objc.dg/image-info.m: Require ilp32. + * objc.dg/bitfield-5.m: Require ilp32. + * objc.dg/objc-fast-3.m: Require ilp32. + * objc.dg/try-catch-15.m: Require ilp32. + * objc.dg/objc-fpret-1.m: Require ilp32. + * objc.dg/const-str-6.m: Require ilp32. + * objc.dg/objc-gc-2.m: Require ilp32. + * objc.dg/const-cfstring-4.m: Require ilp32. + * objc.dg/defs.m: Require ilp32. + * obj-c++.dg/template-4.m: Require ilp32. + * obj-c++.dg/defs.m: Require ilp32. + * obj-c++.dg/const-str-12.m: Require ilp32. + * obj-c++.dg/cxx-ivars-3.m: Require ilp32. + * obj-c++.dg/const-cfstring-4.mm: Require ilp32. + * obj-c++.dg/objc-fast-2.mm: Require ilp32. + * obj-c++.dg/layout-1.mm: Require ilp32. + * obj-c++.dg/const-str-13.mm: Require ilp32. + * obj-c++.dg/try-catch-20.mm: Require ilp32. + * obj-c++.dg/bitfield-1.mm: Require ilp32. + * obj-c++.dg/objc-fast-3.mm: Require ilp32. + * obj-c++.dg/debug-1.mm: Require ilp32. + * obj-c++.dg/const-str-9.mm: Require ilp32. + * obj-c++.dg/objc-fpret-1.mm: Require ilp32. + * obj-c++.dg/method-11.mm: Require ilp32. + * obj-c++.dg/objc-gc-4.mm: Require ilp32. + * obj-c++.dg/objc-gc-section-1.mm: Require ilp32. + * obj-c++.dg/objc-fast-4.mm: Require ilp32. + * obj-c++.dg/objc-gc-5.mm: Require ilp32. + * obj-c++.dg/const-str-10.mm: Require ilp32. + * obj-c++.dg/objc-gc-section-2.mm: Require ilp32. + * obj-c++.dg/objc-visibility-hidden-1.mm: Require ilp32. + * obj-c++.dg/objc-stret-1.mm: Require ilp32. + * obj-c++.dg/defs-warn-1.mm: Require ilp32. + * obj-c++.dg/const-str-11.mm: Require ilp32. + * obj-c++.dg/bitfield-4.mm: Require ilp32. + * obj-c++.dg/sync-objc-exception.mm: Require ilp32. + * obj-c++.dg/objc-fast-1.mm: Require ilp32. + * g++.apple/block-blocks-test-8.C: Require ilp32. + * g++.apple/block-byref-block.C: Require ilp32. + +2008-10-07 Stuart Hastings + + Radar 6258941 + * gcc.apple/6258941.c: New. + +2008-10-06 Fariborz Jahanian + + Radar 6268817 + * gcc.apple/block-in-foreach-header.c: Add + * g++.apple/block-in-foreach-header.C: Add + +2008-10-03 Fariborz Jahanian + + Radar 6267049 + * objc.dg/objc2-property-typedefprotocol.m: Add + +2008-10-03 Fariborz Jahanian + + Radar 6264448 + * objc.dg/objc-property-enumtype.m: Add + * obj-c++.dg/objc-property-enumtype.mm: Add + +2008-10-02 Fariborz Jahanian + + Radar 6230656 + + * gcc.apple/block-no-block-def.c: Add + +2008-10-02 Fariborz Jahanian + + Radar 6246527 + * gcc.apple/block-printf-attribute-1.c: Add + * gcc.apple/block-sentinel-attribute.c: Add + * g++.apple/block-sentinel-attribute.C: Add + * g++.apple/block-printf-attribute-1.C: Add + +2008-10-02 Stuart Hastings + + Radar 5919583 + * gcc.apple/5919583.c: New. + +2008-10-01 Fariborz Jahanian + + Radar 6252174 + * objc.dg/objc2-sendsuper_msg.m: Add + +2008-10-01 Fariborz Jahanian + + Radar 6255671 + * gcc.apple/block-block-property-2.c: Add + * g++.apple/block-block-property-2.C: Add + +2008-09-30 Fariborz Jahanian + + Radar 6230297 + * g++.apple/block-localisglobal.C: New + * gcc.apple/block-localisglobal.c: New + * gcc.apple/block-complicated-type.c: Modified + * gcc.apple/block-explicit-return-type.c: Modified + * gcc.apple/block-local-stack.c: Modified + * gcc.apple/block-literal.c: Modified + * g++.apple/block-continuation.C: Modified + * g++.apple/block-explicit-return-type.C: Modified + * g++.apple/block-literal.C: Modified + * g++.apple/block-local-stack.C: Modified + * g++.apple/block-complicated-type.C: Modified + * gcc.apple/block-attributes-1.c: Modified + * g++.apple/block-attributes-1.C: Modified + + +2008-09-30 Fariborz Jahanian + + Radar 6225809 + * gcc.apple/block-nested-block-var.c: Add + * g++.apple/block-nested-block-var.C: Add + +2008-09-30 Stuart Hastings + + Radar 5919583 + Revert 2008-09-26 patch. + +2008-09-30 Caroline Tice + + Radars 6237086 & 6237616 + g++.apple/cp-block-byref-2.C: Make minor fix to testcase. + +2008-09-30 Caroline Tice + + Radars 6237086 & 6237616 + gcc.apple/block-byref-2.c: New testcase. + g++.apple/cp-block-byref-2.C: New testcase + +2008-09-29 Fariborz Jahanian + + Radar 6154598 + * g++.apple/blocks-method-call.C: Add + +2008-09-26 Fariborz Jahanian + + Radar 6243400 + * g++.apple/block-destructors.C: New + +2008-09-28 Caroline Tice + + Radar 6163705 + * gcc.apple/block-byref-3.c: Fix to work properly with -m64. + +2008-09-26 Stuart Hastings + + Radar 5919583 + * gcc.apple/5919583.c: New. + +2008-09-26 Caroline Tice + + Radar 6163705 + * gcc.apple/block-byref-3.c: New testcase. + +2008-09-25 Fariborz Jahanian + + Radar 6246965 + * gcc.apple/block-call.c : Added more tests. + +2008-09-25 Fariborz Jahanian + + Radar 6244520 + * gcc.apple/block-nullblockisa.c: Add + * gcc.apple/block-blocks-test-8.c: Modified + * g++.apple/block-nullblockisa.C: Add + +2008-09-25 Fariborz Jahanian + + Radar 6237713 + * gcc.apple/block-attributes-1.c: New + * g++.apple/block-attributes-1.C: New + +2008-09-24 Stuart Hastings + + Radar 6025404 + * gcc.apple/6025404.c: New. + +2008-09-24 Stuart Hastings + + Radar 6119849 + * gcc.apple/6119849.c: Added return. + +2008-09-23 Fariborz Jahanian + + Radar 6196572 + * gcc.apple/block-call.c: Modified + +2008-09-23 Fariborz Jahanian + + Radar 6230701 + * gcc.apple/block-no-trampoline.c: New + * gcc.apple/block-implicit-byref.c: Modified + * g++.apple/block-no-trampoline.C: New + +2008-09-22 Stuart Hastings + + Radar 6185789 + * g++.apple/6185789.C: New. + +2008-09-22 Josh Conner + + Radar 6204451 + * objc.dg/6204451.m: New test. + +2008-09-19 Fariborz Jahanian + + Radar 6230800 + * obj-c++.dg/objc2-none-fragile-ivar-use.mm: Modified + * objc.dg/objc2-none-fragile-ivar-use.m: Modified + +2008-09-19 Fariborz Jahanian + + Radar 4900615 + * objc.dg/encode-ld.m: Add + +2008-09-19 Fariborz Jahanian + + Radar 6173152 + * objc.dg/enhanced-proto-4.m: Modified + * objc.dg/newproperty-type-conv-1.m: Modified + * objc.dg/property-synthesize-ivar-1.m: Modified + * objc.dg/property-synthesize-ivar-9.m: Add + * objc.dg/newproperty-syntax-1.m: Modified + * objc.dg/newproperty-weak-attribute-3.m: Modified + * objc.dg/property-synthesize-ivar-2.m: Modified + * objc.dg/property-synthesize-ivar-3.m: Modified + * objc.dg/property-synthesize-ivar-4.m: Modified + * objc.dg/property-synthesize-ivar-32-5.m: Add + * objc.dg/property-synthesize-ivar-5.m: Modified + * objc.dg/property-synthesize-ivar-6.m: Add + * objc.dg/newproperty-nowarn-compound-exp.m: Modified + * objc.dg/newproperty-neg-ivar-check-1.m: Modified + * objc.dg/synthesized-unknown-ivar-warn.m: Modified + * objc.dg/property-synthesize-ivar-7.m: Modified + * obj-c++.dg/newproperty-type-conv-1.mm: Modified + * obj-c++.dg/property-synthesize-ivar-5.mm: Add + * obj-c++.dg/property-synthesize-ivar-32-5.mm: Add + * obj-c++.dg/newproperty-syntax-1.mm: Modified + * obj-c++.dg/property-synthesize-ivar-6.mm: Add + * obj-c++.dg/property-synthesize-ivar-1.mm: Modified + * obj-c++.dg/newproperty-weak-attribute-3.mm: Modified + * obj-c++.dg/property-synthesize-ivar-7.mm: Modified + * obj-c++.dg/enhanced-proto-4.mm: Modified + * obj-c++.dg/newproperty-nowarn-compound-exp.mm: Modified + * obj-c++.dg/property-synthesize-ivar-2.mm: Modified + * obj-c++.dg/newproperty-neg-ivar-check-1.mm: Modified + * obj-c++.dg/property-synthesize-ivar-8.mm: Add + * obj-c++.dg/property-synthesize-ivar-3.mm: Modified + * obj-c++.dg/property-synthesize-ivar-10.mm: Add + * obj-c++.dg/property-synthesize-ivar-9.mm: Add + * objc.dg/property-synthesize-ivar-8.m: Add + * obj-c++.dg/property-synthesize-ivar-4.mm: Modified + +2008-09-19 Stuart Hastings + + Radar 6119849 + * gcc.apple/6119849.c: New. + 2008-09-16 Fariborz Jahanian Radar 6214617 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/bugs/powerpc/gcc.xfail Mon Nov 3 02:35:57 2008 @@ -12,6 +12,24 @@ ###------------------------------------------------------------------ 5066141: gcc.dg/pr30643.c scan-assembler-not undefined 5951276: gcc.target/i386/20020616-1.c execution test +# temporary failures due to new linker messages +6312070: gcc.dg/compat/scalar-by-value-1 c_compat_x_tst.o-c_compat_y_tst.o link +6312070: gcc.dg/compat/scalar-by-value-3 c_compat_x_tst.o-c_compat_y_tst.o link +6312070: gcc.dg/darwin-ld-1.c (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -O0 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -O1 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -O2 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -O3 -fomit-frame-pointer (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -O3 -g (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -Os (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-float80-timode.c -fast (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -O0 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -O1 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -O2 (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -O3 -fomit-frame-pointer (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -O3 -g (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -Os (test for excess errors) +6312070: gcc.dg/torture/fp-int-convert-timode.c -fast (test for excess errors) # # ppc only 3906375: gcc.dg/debug/debug-1.c -gstabs -fast scan-assembler xyzzy @@ -27,6 +45,40 @@ 4875164: gcc.dg/vect/section-anchors-vect-69.c (test for excess errors) 4875164: gcc.dg/vect/section-anchors-vect-69.c scan-tree-dump-times Alignment of access forced using peeling 4 4875176: gcc.target/powerpc/stabs-attrib-vect-darwin.c scan-assembler .stabs.*vi:\\(0,[0-9]+\\)=@V +6186620: gcc.dg/builtins-18.c (test for excess errors) +6186620: gcc.dg/builtins-20.c (test for excess errors) +6186620: gcc.dg/builtins-55.c (test for excess errors) +6186620: gcc.dg/darwin-minversion-2.c (test for excess errors) +6186620: gcc.dg/darwin64-abi.c (test for excess errors) +6186620: gcc.dg/single-precision-constant.c (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -O0 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -O1 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -O2 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -O3 -fomit-frame-pointer (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -O3 -g (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -Os (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-1.c -fast (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -O0 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -O1 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -O2 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -O3 -fomit-frame-pointer (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -O3 -g (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -Os (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-2.c -fast (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -O0 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -O1 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -O2 (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -O3 -fomit-frame-pointer (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -O3 -g (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -Os (test for excess errors) +6186620: gcc.dg/torture/builtin-convert-3.c -fast (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -O0 (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -O1 (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -O2 (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -O3 -fomit-frame-pointer (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -O3 -g (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -Os (test for excess errors) +6186620: gcc.dg/torture/builtin-power-1.c -fast (test for excess errors) # # x86 only 4874504: gcc.dg/tree-ssa/gen-vect-11b.c scan-tree-dump-times vectorized 0 loops 1 Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-66.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/asm-block-66.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-66.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/asm-block-66.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,8 @@ +/* APPLE LOCAL file CW asm blocks 6276214 */ +/* { dg-do compile { target i?86*-*-darwin* } } */ +/* { dg-options { -fasm-blocks } } */ +/* Radar 6276214 */ + +void foo () { + asm test esi, 24 ; 11000b +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-5992047.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-5992047.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-5992047.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-5992047.C Mon Nov 3 02:35:57 2008 @@ -1,11 +1,11 @@ -/* APPLE LOCAL file radar 5992047 */ +/* APPLE LOCAL file radar 5992047 - radar 6175959 */ /* Check that with a previous declaration of _Block_destroy, test case compiles with no error or ICE. */ /* { dg-options "-fblocks" } */ /* { dg-do compile { target *-*-darwin* } } */ #define Block_destroy(xxx) _Block_destroy((const void *)(xxx)) -void _Block_destroy(const void *aBlock); +void _Block_destroy(const void *aBlock, int); typedef struct dispatch_item_s *dispatch_item_t; typedef void (^completion_block_t)(void); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcglobal.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assigngcglobal.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcglobal.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcglobal.C Mon Nov 3 02:35:57 2008 @@ -31,7 +31,7 @@ int main(char *argc, char *argv[]) { - __byref int i = 0; + __block int i = 0; // assigning a Block into a global should elicit a global write-barrier under GC GlobalVoidVoid = ^ { ++i; }; return GlobalInt - 1; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcivar.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assigngcivar.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcivar.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcivar.C Mon Nov 3 02:35:57 2008 @@ -48,7 +48,7 @@ int main(char *argc, char *argv[]) { - __byref int i = 0; + __block int i = 0; TestObject *to = [[TestObject alloc] init]; // assigning a Block into an ivar should elicit a write-barrier under GC to->ivarBlock = ^ { ++i; }; // fails to gen write-barrier Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcstrongcast.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assigngcstrongcast.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcstrongcast.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assigngcstrongcast.C Mon Nov 3 02:35:57 2008 @@ -38,7 +38,7 @@ int main(char *argc, char *argv[]) { StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*)); - __byref int i = 10; + __block int i = 10; // assigning a Block into an struct slot should elicit a write-barrier under GC swbp->ivarBlock = ^ { ++i; }; return GlobalInt - 1; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assignweakgc-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc-1.C Mon Nov 3 02:35:57 2008 @@ -28,7 +28,7 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - __byref int i = 0; + __block int i = 0; void (^local)(void); Henry = ^ { ++i; return &i; }; if (GlobalInt == 1) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assignweakgc.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgc.C Mon Nov 3 02:35:57 2008 @@ -28,7 +28,7 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - __byref int i = 0; + __block int i = 0; void (^local)(void); Henry = ^ { ++i; }; if (GlobalInt == 1) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgcivar.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-assignweakgcivar.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgcivar.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-assignweakgcivar.C Mon Nov 3 02:35:57 2008 @@ -36,7 +36,7 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - __byref int i = 0; + __block int i = 0; void (^local)(void); Foo *foo = [[Foo alloc] init]; foo->ivar = ^ { ++i; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-attributes-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-attributes-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-attributes-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-attributes-1.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6237713 */ +/* APPLE LOCAL file radar 6237713 - modified for radar 6230297 */ /* Test for using attributes on blocks. */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ /* { dg-do compile } */ @@ -11,10 +11,10 @@ { void (^a)(void) __attribute__((noreturn)) = ^ (void) __attribute__((noreturn)) { exit (0); }; // OK; - ^ (int i) __attribute__((noreturn)) { return i; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ + int (^b)(int) __attribute__((noreturn)) = ^ (int i) __attribute__((noreturn)) { return i; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ /* { dg-warning "\\'noreturn\\' function does return" "" { target *-*-* } 14 } */ - ^ __attribute__((noreturn)) { return 100; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ + int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ /* { dg-warning "\\'noreturn\\' function does return" "" { target *-*-* } 17 } */ a = ^ (void) __attribute__((noreturn)) { exit (0); }; // OK Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-block-property-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-block-property-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-block-property-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-block-property-2.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 5831920 */ +/* APPLE LOCAL file radar 5831920 - Modified for radar 6255671 */ #import /* Test a property with block type. */ /* { dg-do run } */ @@ -15,8 +15,8 @@ int (^getIntRetain)(void); } - at property int (^getIntCopy)(void); - at property int (^getIntRetain)(void); + at property (assign) int (^getIntCopy)(void); + at property (assign) int (^getIntRetain)(void); @end @implementation TestObject @@ -34,7 +34,7 @@ int main(char *argc, char *argv[]) { int count; - __byref int val = 0; + __block int val = 0; TestObject *to = [[TestObject alloc] init]; to.getIntRetain = ^ { printf("\n Hello(%d)\n", val); return ++val; }; to.getIntCopy = to.getIntRetain; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-1.C Mon Nov 3 02:35:57 2008 @@ -2,14 +2,14 @@ /* { dg-options "-fblocks" } */ /* { dg-do compile } */ -__byref int X; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ +__block int X; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ -int foo(__byref int param) { /* { dg-warning "byref attribute can be specified on variables only - ignored" } */ - __byref int OK = 1; +int foo(__block int param) { /* { dg-warning "__block attribute can be specified on variables only - ignored" } */ + __block int OK = 1; - extern __byref double extern_var; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ + extern __block double extern_var; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ if (X) { - static __byref char * pch; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ + static __block char * pch; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ } return OK - 1; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C Mon Nov 3 02:35:57 2008 @@ -6,8 +6,8 @@ #include int main() { - __byref int X = 1234; - __byref const char * message = "HELLO"; + __block int X = 1234; + __block const char * message = "HELLO"; X = X - 1234; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-3.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C Mon Nov 3 02:35:57 2008 @@ -6,8 +6,8 @@ #include int main() { - __byref int X = 1234; - __byref const char * message = "HELLO\n"; + __block int X = 1234; + __block const char * message = "HELLO\n"; X = X - 1234; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-4.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-4.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-4.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-4.C Mon Nov 3 02:35:57 2008 @@ -10,7 +10,7 @@ }; int main() { - __byref int X = 1234; + __block int X = 1234; int (^CP)(void) = ^{ X = X+1; return X; }; CP(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-5.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-5.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-5.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-5.C Mon Nov 3 02:35:57 2008 @@ -17,8 +17,8 @@ int main() { int x = 1; - __byref int y = 2; - __byref int br_x; + __block int y = 2; + __block int br_x; int y1; double res = test(^(int z){ y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-6.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-6.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-6.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-6.C Mon Nov 3 02:35:57 2008 @@ -16,8 +16,8 @@ } int main() { - __byref int x = 1; - __byref int y = 2; + __block int x = 1; + __block int y = 2; double res = test(^(int z){ y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 1 || y != 43) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-7.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-7.C Mon Nov 3 02:35:57 2008 @@ -12,27 +12,27 @@ int i; int foo() { - __byref id FFFFFF; - __byref id Q; + __block id FFFFFF; + __block id Q; ^{ FFFFFF = 0; }; if (i) { - __byref id FFFFFF; - __byref id Q; + __block id FFFFFF; + __block id Q; ^{ FFFFFF = 0; }; } } int main() { - __byref id X; - __byref id X1; + __block id X; + __block id X1; ^{ X = 0; }; if (i) { - __byref id X; - __byref id X1; + __block id X; + __block id X1; ^{ X = 0; }; } return 0; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-8.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-8.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-8.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-8.C Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Test the __byreg runtime features. */ /* { dg-options "-mmacosx-version-min=10.5 -ObjC++ -framework Foundation" { target i?86-*-darwin* } } */ /* { dg-do run { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #import @@ -48,17 +48,28 @@ BLOCK_IS_GC = (1 << 27), }; +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ struct Block_basic { - void *isa; - int Block_flags; // int32_t - int Block_size; // XXX should be packed into Block_flags + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int Block_flags; + int reserved; void (*Block_invoke)(void *); - void (*Block_copy)(void *dst, void *src); - void (*Block_dispose)(void *); - //long params[0]; // generic space for const & byref hidden params, return value, variable on needs of course + + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int Block_size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *src); + } *descriptor; + + // imported variables }; +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ + struct Block_byref { - //long reserved; + void* isa; struct Block_byref *forwarding; int flags;//refcount; int size; @@ -89,7 +100,7 @@ } int main(int argc, char *argv[]) { - id __byref dumbo = newDumbObject(); //[DumbObject new]; + id __block dumbo = newDumbObject(); //[DumbObject new]; void (^dummy)(void) = ^{ [dumbo self]; }; @@ -101,8 +112,8 @@ } char result[200]; - printf("calling out to copy support helper at %p\n", aBlock->Block_copy); - (*aBlock->Block_copy)(result, aBlock); // do fixup + printf("calling out to copy support helper at %p\n", aBlock->descriptor->Block_copy); + (*aBlock->descriptor->Block_copy)(result, aBlock); // do fixup // The copy/destroy helper should have had a callout to _Block_byref_assign_copy for its byref block if (! ByrefAssignCopy) { @@ -116,7 +127,7 @@ return 1; } - (*aBlock->Block_dispose)(aBlock); + (*aBlock->descriptor->Block_dispose)(aBlock); return 0; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref-attribute.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-byref-attribute.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref-attribute.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref-attribute.C Mon Nov 3 02:35:57 2008 @@ -1,11 +1,11 @@ /* APPLE LOCAL file radar 6096219 */ -/* Test that __byref attribute can be used directly. */ +/* Test that __block attribute can be used directly. */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ /* { dg-do compile } */ int main() { - __byref int JJJJ; + __block int JJJJ; __attribute__((__blocks__(byref))) int III; int (^XXX)(void) = ^{ return III+JJJJ; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-byref.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-byref.C Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fblocks" } */ int main() { - __byref int x, y; + __block int x, y; ^{ }; ^{ int r; return x+y+r; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-codegen-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-codegen-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-codegen-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-codegen-1.C Mon Nov 3 02:35:57 2008 @@ -18,8 +18,8 @@ } int main() { - __byref int x = 1; - __byref int y = 2; + __block int x = 1; + __block int y = 2; double res = test(^(int z){ y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 1 || y != 43) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-complicated-type.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-complicated-type.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-complicated-type.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-complicated-type.C Mon Nov 3 02:35:57 2008 @@ -15,6 +15,8 @@ int (^(^block)(double x))(char, short); void foo() { - block = ^(double x){ return ^(char c, short y) { return (int)c + y; };}; /* { dg-error "returning block that lives on the local stack" } */ + int one = 1; + /* APPLE LOCAL radar 6230297 */ + block = ^(double x){ return ^(char c, short y) { return one + (int)c + y; };}; /* { dg-error "returning block that lives on the local stack" } */ } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-continuation.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-continuation.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-continuation.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-continuation.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 5732232 - blocks */ +/* APPLE LOCAL file radar 5732232 - radar 6230297 - blocks */ /* Modified for radar 6169527 */ /* { dg-do compile } */ /* { dg-options "-fblocks" } */ @@ -6,12 +6,13 @@ void takeblock (void (^)()); int main() { + int one = 1; while (1) { takeblock(^{ break; /* { dg-error "break statement not within loop or switch" } */ - while (1) break;/* ok */ + while (one) break;/* ok */ goto label1; /* { dg-error "goto not allowed in block literal" } */ - /* { dg-error "label" "" { target *-*-* } 13 } */ + /* { dg-error "label" "" { target *-*-* } 14 } */ }); /* { dg-error "enters" } */ label1: /* { dg-error "jump to label" } */ break; /* OK */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copy-destroy.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-copy-destroy.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copy-destroy.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copy-destroy.C Mon Nov 3 02:35:57 2008 @@ -12,7 +12,7 @@ @implementation Root - (void)example { - __byref int y, x; + __block int y, x; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSAutoreleasePool *relpool = [NSAutoreleasePool new]; bar(^(int z){ y = x+z; [pool drain]; if (y) y++; [relpool release]; return y+2.0; }); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copyconstructor.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-copyconstructor.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copyconstructor.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-copyconstructor.C Mon Nov 3 02:35:57 2008 @@ -3,6 +3,7 @@ support code. */ /* { dg-do run } */ /* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ #import #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-debug-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-1.C Mon Nov 3 02:35:57 2008 @@ -4,7 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-g -O0 -fblocks -dA" } */ -/* { dg-final { scan-assembler "invoke_impl.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_descriptor.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_literal_generic.*DW_AT_name" } } */ struct inStruct { void (^genericBlockPtr)(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-debug-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-debug-2.C Mon Nov 3 02:35:57 2008 @@ -4,7 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-g -O0 -fblocks -dA" } */ -/* { dg-final { scan-assembler "invoke_impl.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_descriptor.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_literal_generic.*DW_AT_name" } } */ void (^os)(); Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-destructors.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-destructors.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-destructors.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-destructors.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,74 @@ +/* APPLE LOCAL file radar 6243400 */ +/* { dg-options "-fblocks" } */ +/* { dg-do run } */ + +#include +extern "C" void abort(void); +int constructors = 0; +int destructors = 0; + +class TestObject +{ +public: + TestObject(const TestObject& inObj); + TestObject(); + ~TestObject(); + + TestObject& operator=(const TestObject& inObj); + + int version() const { return _version; } +private: + mutable int _version; +}; + +TestObject::TestObject(const TestObject& inObj) + +{ + ++constructors; + _version = inObj._version; + printf("%p (%d) -- TestObject(const TestObject&) called\n", this, _version); +} + + +TestObject::TestObject() +{ + _version = ++constructors; + printf("%p (%d) -- TestObject() called\n", this, _version); +} + + +TestObject::~TestObject() +{ + printf("%p -- ~TestObject() called\n", this); + ++destructors; +} + + +TestObject& TestObject::operator=(const TestObject& inObj) +{ + printf("%p -- operator= called\n", this); + _version = inObj._version; + return *this; +} + +void testRoutine() { + TestObject one; + + void (^b)(void) = ^{ printf("my const copy of one is %d\n", one.version()); }; +} + + + +int main(char *argc, char *argv[]) { + testRoutine(); + if (constructors == 0) { + printf("No copy constructors!!!\n"); + abort(); + } + if (constructors != destructors) { + printf("%d constructors but only %d destructors\n", constructors, destructors); + abort(); + } + printf("%s:success\n", argv[0]); + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-dup-invoke_impl.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-dup-invoke_impl.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-dup-invoke_impl.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-dup-invoke_impl.C Mon Nov 3 02:35:57 2008 @@ -23,8 +23,8 @@ } int main() { - __byref enum numbers x = one; - __byref enum numbers y = two; + __block enum numbers x = one; + __block enum numbers y = two; myblock CL = ^(enum numbers z) { y = z; Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-duplicate-err.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-duplicate-err.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-duplicate-err.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-duplicate-err.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file radar 6310599 */ +/* Check that internal fields do not conflict with user names. */ +/* { dg-options "-fblocks" } */ +/* { dg-do compile } */ + +int main() +{ + __block int flags; + __block void *isa; + + ^{ flags=1; isa = (void *)isa; }; + return 0; +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-enum.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-enum.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-enum.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-enum.C Mon Nov 3 02:35:57 2008 @@ -23,8 +23,8 @@ } int main() { - __byref enum numbers x = one; - __byref enum numbers y = two; + __block enum numbers x = one; + __block enum numbers y = two; enum numbers res = test(^(enum numbers z){ y = z; return x; }); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-do.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-do.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-do.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-do.C Mon Nov 3 02:35:57 2008 @@ -14,12 +14,12 @@ int main() { { - __byref int O1; + __block int O1; int p = 0; do { - __byref int I1; + __block int I1; do { - __byref int J1; + __block int J1; if (p == 2) break; } while ( ++p < 3); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-for.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for.C Mon Nov 3 02:35:57 2008 @@ -12,11 +12,11 @@ int main() { { - __byref int O1; + __block int O1; int i; for (i = 1; i <= 5; i++) { - __byref int I1; + __block int I1; } if (count != 5) abort(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-for1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-for1.C Mon Nov 3 02:35:57 2008 @@ -15,14 +15,14 @@ int main() { { - __byref int O1; + __block int O1; int i; int p; for (i = 1; i <= 5; i++) { - __byref int I1; + __block int I1; p = 0; while (p != 10) { - __byref int II1; + __block int II1; if (p == 2) break; ++p; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-goto.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-goto.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-goto.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-goto.C Mon Nov 3 02:35:57 2008 @@ -4,13 +4,13 @@ int main(int p) { p = -5; - __byref int O1; + __block int O1; int i; LOUT: ; for (i = 1; i < 100; i++) { - __byref int I1; + __block int I1; while (p < 0) { - __byref int II1; + __block int II1; if (p == 100) goto LOUT; ++p; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-nested-while.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-nested-while.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-nested-while.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-nested-while.C Mon Nov 3 02:35:57 2008 @@ -16,8 +16,8 @@ void objc_get_type_qualifiers (int flag, int type) { while (flag--) while (type++ < 4) { - __byref int W1; - __byref int W2; + __block int W1; + __block int W2; if (type == 2) break; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-return.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return.C Mon Nov 3 02:35:57 2008 @@ -16,9 +16,9 @@ int main1() { - __byref int X = 1234; + __block int X = 1234; if (X) { - __byref int local_BYREF = 100; + __block int local_BYREF = 100; X += 100 + local_BYREF; return count-2; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-return1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-return1.C Mon Nov 3 02:35:57 2008 @@ -17,9 +17,9 @@ void *_NSConcreteStackBlock; void FOO(int arg) { - __byref int X = 1234; + __block int X = 1234; if (arg) { - __byref int local_BYREF = 100; + __block int local_BYREF = 100; X += 100 + local_BYREF; return; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-switch.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-switch.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-switch.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-switch.C Mon Nov 3 02:35:57 2008 @@ -15,34 +15,34 @@ } int foo(int p, int q) { - __byref int O1; + __block int O1; switch (p) { case 1: { - __byref int I1; + __block int I1; I1 += 1; break; } case 10: { - __byref int J1; + __block int J1; break; } default : { - __byref int D1; - __byref int D2; + __block int D1; + __block int D2; switch (q) { case 11: { - __byref int Q1; + __block int Q1; break; } default: { - __byref int ID1; - __byref int ID2; + __block int ID1; + __block int ID2; } }; break; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-while.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-escape-while.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-while.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-escape-while.C Mon Nov 3 02:35:57 2008 @@ -12,10 +12,10 @@ int main() { { - __byref int O1; + __block int O1; int i = 0; while (++i != 5) { - __byref int I1; + __block int I1; } if (count != 4) abort(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-return-type.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-explicit-return-type.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-return-type.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-return-type.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6185344 */ +/* APPLE LOCAL file radar 6185344 - updated for radar 6230297 */ /* Test for blocks with explicit return type specified. */ /* { dg-options "-mmacosx-version-min=10.6 -ObjC++" { target *-*-darwin* } } */ /* { dg-do compile } */ @@ -75,9 +75,10 @@ int (^(^block)(double x))(char, short); void foo() { - block = ^(double x){ return ^int(char c, short y) { return c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ + int one = 1; + block = ^(double x){ return ^int(char c, short y) { return one + c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ // or: - block = ^(double x){ return ^(char c, short y) { return (int)c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ + block = ^(double x){ return ^(char c, short y) { return one + (int)c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ } Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-this.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-explicit-this.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-this.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-explicit-this.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,29 @@ +/* APPLE LOCAL file radar 6275956 */ +/* Use of explicit "this" inside a block. */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ +/* { dg-do run } */ +extern "C" void abort (void); + +struct S { + + int ifield; + + int mem () + { + int (^p) (void) = ^ { return this->ifield; }; + if (p() != ifield) + abort (); + return 0; + } + S (int val) { ifield = val; } + +}; + +int main() +{ + S s(123); + + return s.mem(); +} + + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-global-byref-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-global-byref-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-global-byref-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-global-byref-2.C Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file radar 6014138 */ -/* Test use of __byref on locals which will be used as 'byref' variables in blocks. */ +/* Test use of __block on locals which will be used as 'byref' variables in blocks. */ /* { dg-do run } */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ @@ -14,9 +14,9 @@ int foo() { - __byref int local_byref_1 = 10; - __byref int local_byref_2 = 10; - __byref int local_byref_3 = 10; + __block int local_byref_1 = 10; + __block int local_byref_2 = 10; + __block int local_byref_3 = 10; CallBlock( ^ { ++local_byref_1; ++local_byref_2; ++local_byref_3; CallBlock(^ { ++local_byref_1; ++local_byref_2; ++local_byref_3; }); Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in-foreach-header.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-in-foreach-header.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in-foreach-header.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in-foreach-header.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,57 @@ +/* APPLE LOCAL file radar 6268817 */ +/* Testing use of block literal expression in ObjC's enumeration foreach-statement loop header. */ +/* { dg-options "-mmacosx-version-min=10.6 -ObjC++ -framework Foundation" { target *-*-darwin* } } */ +/* { dg-do run } */ + +#import + + at interface TargetSymbol : NSObject { + NSString * _symbolName; +} + at property (copy) NSString *name; + at end + + at implementation TargetSymbol + at synthesize name = _symbolName; + at end + +static void Looper(NSArray *symbols) { + // 1. Block literal assigned to a block pointer, which is used in loop: build succeeds + NSComparator comparator = ^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}; + + for (id symbol in [symbols sortedArrayUsingComparator:comparator]) { + // Do something + } + + // 2. Block expression literal used, but still outside loop: build succeeds + NSArray *sortedSymbols = [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]; + + for (id symbol in sortedSymbols) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } +} + + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + // insert code here... + NSLog(@"Hello, World!"); + [pool drain]; + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in_structors.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-in_structors.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in_structors.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-in_structors.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,33 @@ +/* APPLE LOCAL file radar 6305545 */ +/* { dg-do run } */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ + +extern "C" void abort(void); + +static int count = 100; +struct CParallelTest +{ + CParallelTest (void); + ~CParallelTest (void) { + void (^p1)() = ^ { count -= 3; }; + p1(); + } +}; + +CParallelTest::CParallelTest (void) +{ + void (^p1)() = ^ { count = 1; }; + int (^p2)() = ^ { return ++count; }; + int (^p3)() = ^ { return ++count; }; + p1(); p2(); p3(); +} + +int main() +{ + { + CParallelTest t1; + } + if (count != 0) + abort(); + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-literal.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-literal.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-literal.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-literal.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 5732232, 6034839 - blocks */ +/* APPLE LOCAL file radar 5732232, 6034839, 6230297 - blocks */ /* { dg-do compile } */ /* { dg-options "-fblocks" } */ @@ -25,7 +25,7 @@ noop = ^; /* { dg-error "expected" } */ - return ^{printf("\nBlock\n"); }; /* { dg-error "returning block that lives on the local stack" } */ + return ^{printf("\nBlock\n"); }; } void test2() { @@ -36,7 +36,8 @@ } void (^test3())(void) { - return ^{}; /* { dg-error "returning block that lives on the local stack" } */ + __block int i; + return ^{ i = 1; }; /* { dg-error "returning block that lives on the local stack" } */ } void test4() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-local-stack.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-local-stack.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-local-stack.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-local-stack.C Mon Nov 3 02:35:57 2008 @@ -1,8 +1,9 @@ -/* APPLE LOCAL file radar 5732232 - blocks */ +/* APPLE LOCAL file radar 5732232 - radar 6230297 - blocks */ /* { dg-do compile } */ /* { dg-options "-fblocks" } */ void (^test3())(void) { - return ^{}; /* { dg-error "returning block that lives on the local stack" } */ + __block int i; + return ^{i = 1; }; /* { dg-error "returning block that lives on the local stack" } */ } Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-localisglobal.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-localisglobal.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-localisglobal.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-localisglobal.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,42 @@ +/* APPLE LOCAL file radar 6230297 */ +/* { dg-options "-mmacosx-version-min=10.6" { target *-*-darwin* } } */ +/* { dg-do run } */ + +/* + * localisglobal.c + * testObjects + * + * Created by Blaine Garst on 9/29/08. + * Copyright 2008 __MyCompanyName__. All rights reserved. + * + * works in all configurations + * CONFIG + * rdar://6230297 + */ + +#include + +void (^global)(void) = ^{ printf("hello world\n"); }; + +int aresame(void *first, void *second) { + long *f = (long *)first; + long *s = (long *)second; + return *f == *s; +} +int main(int argc, char *argv[]) { + int i = 10; + void (^local)(void) = ^ { printf("hi %d\n", i); }; + void (^localisglobal)(void) = ^ { printf("hi\n"); }; + + if (aresame(local, localisglobal)) { + printf("local block could be global, but isn't\n"); + return 1; + } + if (!aresame(global, localisglobal)) { + printf("local block is not global, not stack, what is it??\n"); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; + +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested-block-var.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-nested-block-var.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested-block-var.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested-block-var.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,32 @@ +/* APPLE LOCAL file radar 6225809 - radar 5847213 */ +/* __block var used in a nested block neeb be implicitly declared in + each intervening block. */ +/* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */ +/* { dg-do run } */ + +#include + +static void Block_copy (void (^I)(void)) +{ + I(); +} + +int main(int argc, char *argv[]) { + __block int a = 42; + int save_a = a; // just to keep the address on the stack. + + void (^b)(void) = ^{ + Block_copy(^{ + a = 2; + }); + }; + + Block_copy(b); + + if(a == save_a) { + printf("**** __block heap storage should have been created at this point\n"); + return 1; + } + printf("%s: Success (old %d new %d)\n", argv[0], save_a, a); + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-nested.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nested.C Mon Nov 3 02:35:57 2008 @@ -22,12 +22,12 @@ } int main() { - __byref enum numbers x = one; - __byref enum numbers y = two; + __block enum numbers x = one; + __block enum numbers y = two; myblock CL = ^(enum numbers z) { enum numbers savex = x; - { __byref enum numbers x = savex; + { __block enum numbers x = savex; y = z; if (y != three) exit (6); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-noescape-helper-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-1.C Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ /* Test for generation of escape _Block_byref_release call when a local - __byref variable is copied in. */ + __block variable is copied in. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -22,7 +22,7 @@ int test() { { - int __byref i = 10; + int __block i = 10; void (^dummy)(void) = ^{ printf("i = %d\n", i); }; junk(dummy); } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-noescape-helper-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-2.C Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ /* Test for generation of escape _Block_byref_release call when a local - __byref variable is copied in and block has a return statement. */ + __block variable is copied in and block has a return statement. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -22,7 +22,7 @@ int test() { { - int __byref i = 10; + int __block i = 10; int (^dummy)(void) = ^{ printf("i = %d\n", i); return i; }; junk(dummy); } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-noescape-helper-3.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper-3.C Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ -/* Test for generation of escape _Block_byref_release call when a __byref +/* Test for generation of escape _Block_byref_release call when a __block variable inside a block is declared and used. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -22,7 +22,7 @@ int test() { { - void (^dummy)(void) = ^{ int __byref i = 10; printf("i = %d\n", i); }; + void (^dummy)(void) = ^{ int __block i = 10; printf("i = %d\n", i); }; junk(dummy); } return count; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-noescape-helper.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-noescape-helper.C Mon Nov 3 02:35:57 2008 @@ -20,7 +20,7 @@ int test() { { - __byref int i = 10; + __block int i = 10; void (^dummy)(void) = ^{ ++i; }; junk(dummy); } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nullblockisa.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-nullblockisa.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nullblockisa.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-nullblockisa.C Mon Nov 3 02:35:57 2008 @@ -5,13 +5,9 @@ #include #include -#define HASISA 1 - void check(void *ptr) { struct inner { -#if HASISA void* isa; // should be zero -#endif long forwarding; int flags; int size; @@ -19,20 +15,30 @@ // long disposehelper not needed int i; // }; +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ struct block_with_blocki { - long isa; - int flags; - int size; - long impl; - long copyhelper; - long destroyhelper; - struct inner *blocki; + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int Block_flags; + int reserved; + void (*Block_invoke)(void *); + + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *src); + } *descriptor; + struct inner *blocki; } *block = (struct block_with_blocki *)ptr; +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ + // sanity checks - if (block->size != sizeof(struct block_with_blocki)) { + if (block->descriptor->size != sizeof(struct block_with_blocki)) { // layout funny printf("layout is funny, struct size is %d vs runtime size %ld\n", - block->size, + (int)block->descriptor->size, sizeof(struct block_with_blocki)); exit(1); } @@ -41,12 +47,10 @@ block->blocki->size); exit(1); } -#if HASISA if (block->blocki->isa != (void*)NULL) { printf("not a NULL __block isa\n"); exit(1); } -#endif return; } Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-objectassign.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-objectassign.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-objectassign.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-objectassign.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,79 @@ +/* APPLE LOCAL file radar 6175959 */ +/* Test for generation of two new APIs; _Block_object_assign and _Block_object_dispose */ +/* { dg-options "-mmacosx-version-min=10.6 -fblocks" { target *-*-darwin* } } */ +/* { dg-do run } */ + +#include + +#define BLOCK_HAS_DESCRIPTOR (1 << 29) +#define BLOCK_HAS_COPY_DISPOSE (1 << 25) + +struct Block_descriptor { + unsigned long int reserved; + unsigned long int size; + void (*copy)(void *dst, void *src); + void (*dispose)(void *); +}; + +struct Block_layout { + void *isa; + int flags; + int reserved; + void (*invoke)(void *, ...); + struct Block_descriptor *descriptor; + // imported variables +}; + +int AssignCalled = 0; +int DisposeCalled = 0; + +// local copy instead of libSystem.B.dylib copy +void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { + printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); + AssignCalled = 1; +} + +void _Block_object_dispose(const void *object, const int isWeak) { + printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); + DisposeCalled = 1; +} + +struct MyStruct { + long isa; + long field; +}; + +typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; + +int main(int argc, char *argv[]) { + // create a block + struct MyStruct X; + MyStruct_t xp = (MyStruct_t)&X; + xp->field = 10; + void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; + // should be a copy helper generated with a calls to above routines + // Lets find out! + struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; + if ((bl->flags & BLOCK_HAS_DESCRIPTOR) != BLOCK_HAS_DESCRIPTOR) { + printf("using old runtime layout!\n"); + return 1; + } + if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { + printf("no copy dispose!!!!\n"); + return 1; + } + // call helper routines directly. These will, in turn, we hope, call the stubs above + long destBuffer[256]; + printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); + bl->descriptor->copy(destBuffer, bl); + bl->descriptor->dispose(bl); + if (AssignCalled == 0) { + printf("did not call assign helper!\n"); + return 1; + } + if (DisposeCalled == 0) { + printf("did not call dispose helper\n"); + return 1; + } + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-printf-attribute-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-printf-attribute-1.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-printf-attribute-1.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-printf-attribute-1.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,15 @@ +/* APPLE LOCAL file radar 6246527 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +int main() +{ + void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = /* { dg-error "format string argument not a string type" } */ + ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; /* { dg-error "format string argument not a string type" } */ + void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {}; + + z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type" } */ + z(1, "%s", "HELLO"); + +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgc.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-readweakgc.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgc.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgc.C Mon Nov 3 02:35:57 2008 @@ -28,7 +28,7 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block void (^local)(void); - __byref int i = 10; + __block int i = 10; Henry = ^ { ++i; }; local = Henry; if (GlobalInt2 == 1) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgcivar.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-readweakgcivar.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgcivar.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-readweakgcivar.C Mon Nov 3 02:35:57 2008 @@ -33,7 +33,7 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - __byref int i = 0; + __block int i = 0; void (^local)(void); Foo *foo = [[Foo alloc] init]; foo->ivar = ^ { ++i; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-reference-in-method.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-reference-in-method.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-reference-in-method.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-reference-in-method.C Mon Nov 3 02:35:57 2008 @@ -2,6 +2,7 @@ /* Test use of blocks in member functions. */ /* { dg-do run } */ /* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ #import #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-sentinel-attribute.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-sentinel-attribute.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-sentinel-attribute.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-sentinel-attribute.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,28 @@ +/* APPLE LOCAL file radar 6246527 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ +#include + +void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1))); +void (^e1) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1, 3))); /* { dg-error "wrong number of arguments" "sentinel" } */ + +int main() +{ + void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = + ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {}; + void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; + + + void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; + + b(1, "%s", NULL); // OK + b(1, "%s", 0); /* { dg-warning "missing sentinel in function call" } */ + z(1, "%s",4 ,1,0); /* { dg-warning "missing sentinel in function call" } */ + z(1, "%s", NULL, 1, 0); // OK + + y(1, "%s", 1,2,3,4,5,6,7); /* { dg-warning "missing sentinel in function call" } */ + + y(1, "%s", NULL,3,4,5,6,7); // OK + +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-parameter.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-unused-parameter.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-parameter.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-parameter.C Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ int main() { - __byref int i = 1; + __block int i = 1; ^ { i = 1; return i; }; return 0; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-warn.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-unused-warn.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-warn.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-unused-warn.C Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-Wall" } */ int main() { - __byref int x = 10; + __block int x = 10; int y = 1; int (^myBlock)(void) = ^{ return x+y; }; Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-method-call.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/blocks-method-call.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-method-call.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-method-call.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,29 @@ +/* APPLE LOCAL file radar 6154598 */ +/* Test that methods may be called from within a block + declared inside a member function. */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ +/* { dg-do run } */ + +extern "C" void abort(void); +struct SSSSSS +{ + void Index( void ) { if (_version != 2) abort(); } + void func(void); + int _version; + SSSSSS() { _version = 2; } +}; + +void SSSSSS::func(void) +{ + void (^X)(void) = ^(void) { Index(); }; + X(); +} + +int main() +{ + SSSSSS s1; + s1.func(); + return 0; +} + + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-recovercpp.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/blocks-recovercpp.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-recovercpp.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/blocks-recovercpp.C Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6214617 */ +/* APPLE LOCAL file radar 6214617 - modified for radar 5847213 */ /* { dg-options "-mmacosx-version-min=10.5 -ObjC++" { target *-*-darwin* } } */ /* { dg-do run } */ @@ -57,16 +57,24 @@ } void hack(void *block) { + /* APPLE LOCAL begin radar 6329245 */ // check flags to see if constructor/destructor is available; struct myblock { void *isa; int flags; - int refcount; - void *invokeptr; - void (*copyhelper)(struct myblock *dst, struct myblock *src); - void (*disposehelper)(struct myblock *src); + int reserved; + void (*Block_invoke)(void *); + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int Block_size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*copyhelper)(void *dst, void *src); + void (*disposehelper)(void *src); + } *descriptor; long space[32]; } myversion, *mbp = (struct myblock *)block; + /* APPLE LOCAL end radar 6329245 */ printf("flags -> %x\n", mbp->flags); if (! ((1<<25) & mbp->flags)) { printf("no copy/dispose helper functions provided!\n"); @@ -76,16 +84,16 @@ printf("no marking for ctor/dtors present!\n"); exit(1); } - printf("copyhelper -> %p\n", mbp->copyhelper); + printf("copyhelper -> %p\n", mbp->descriptor->copyhelper); // simulate copy - mbp->copyhelper(&myversion, mbp); + mbp->descriptor->copyhelper(&myversion, mbp); if (constructors != 3) { printf("copy helper didn't do the constructor part\n"); exit(1); } - printf("disposehelper -> %p\n", mbp->disposehelper); + printf("disposehelper -> %p\n", mbp->descriptor->disposehelper); // simulate destroy - mbp->disposehelper(&myversion); + mbp->descriptor->disposehelper(&myversion); if (destructors != 1) { printf("dispose helper didn't do the dispose\n"); exit(1); Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/cp-block-byref-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/cp-block-byref-2.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/cp-block-byref-2.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/cp-block-byref-2.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,34 @@ +/* APPLE LOCAL file radar 6237086 */ +/* { dg-do compile } */ +/* { dg-options "-g -O0 -dA -mmacosx-version-min=10.6" }*/ +/* { dg-final { scan-assembler "DW_OP_fbreg+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x\[0-9a-f]+\[ \t]+\[#;@]\[ \t]sleb128 -\[0-9]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x6+\[ \t]+\[#;@]\[ \t]DW_OP_deref+\[ \t\n]+\[ \t]\\.byte+\[ \t]\[0x6;0x23]+\[ \t]+\[#;@]\[ \t]\[DW_OP_deref;DW_OP_plus_uconst]" } } */ + +#include + +int +main () +{ + int val_1, val_2; + + int (^my_block) (int); + + if (1) + { + __block int use_by_ref = 1; + int use_by_value = 0xfefefefe; + + my_block = ^ (int in_value) { + use_by_ref++; + printf ("Block function has: %d %d %d.\n", in_value, use_by_value, use_by_ref); + return in_value + use_by_ref + use_by_value; + }; + use_by_ref++; + val_1 = my_block (10); + } + + val_1 = my_block (20); + val_2 = my_block (30); + printf ("Got: %d and %d.\n", val_1, val_2); + + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/debug-inlined-section.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/debug-inlined-section.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/debug-inlined-section.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/debug-inlined-section.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,53 @@ +/* APPLE LOCAL file, Radar 6275985 */ +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-O1 -gdwarf-2 -dA" } */ +/* { dg-final { scan-assembler "__debug_inlined" } } */ +/* { dg-final { scan-assembler "\[#;@]+\[ \t]+MIPS linkage name: \"_ZNK1UcvPKcEv\"" } } */ +/* { dg-final { scan-assembler "\[#;@]+\[ \t]+Function name: \"operator const char" } } */ +/* { dg-final { scan-assembler "\[#;@]+\[ \t]+MIPS linkage name: \"operator" } } */ + +struct S +{ + virtual ~S(); + S (const char *str); + S& operator= (const char *str); + operator const char *() const; + S& operator+= (const char *str); +}; +inline S operator+ (const char *s1, const S &s2) +{ + S x (s1); + x += s2; + return x; +} +struct U +{ + U (); + U& operator= (const char *); + const char *foo() const; + operator const char *() const { return foo(); } +}; +template struct V +{ + T v; +}; +template struct W +{ + V *w; + W() : w (0) {} + const T& operator* () const { return w->v; } + T& operator* () { return w->v; } +}; +struct X { + X(); +}; +struct Y { + Y (const U &u); +}; +X::X() +{ + W a; + U b; + b = (*a) + "xx"; + Y c (b); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/eh1.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/eh1.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file EH __TEXT __gcc_except_tab 5819051 */ +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-final { scan-assembler "section __TEXT,__gcc_except_tab" } } */ +/* Radar 5819051 */ + +#include + +void foo() { + try { + throw 1; + } catch (int i) { + printf("Hi\n"); + } +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-weak.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/kext-weak.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-weak.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-weak.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,9 @@ +/* APPLE LOCAL kext weak_import 5935650 */ +/* { dg-do assemble { target i?86*-*-darwin* } } */ +/* { dg-options "-mkernel -dynamic -m64" } */ + +extern void foo() __attribute__((weak_import)); +void test() { + if (foo) + foo(); +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/lookup-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/lookup-1.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/lookup-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/lookup-1.C Mon Nov 3 02:35:57 2008 @@ -7,7 +7,7 @@ void A::foo(const char* basename) { class B { friend class C; - static void WaitForSinks(C:: /* { dg-error "has not been declared" } */ - D* data); /* { dg-error "expected" } */ + static void WaitForSinks(C:: /* { dg-error "has not been declared" } */ + D* data); /* { dg-error "expected" } */ }; } Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/prototype.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/prototype.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/prototype.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/prototype.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,55 @@ +/* APPLE LOCAL file warn missing prototype 6261539 */ +/* Radar 6261539 */ +/* { dg-options "-Wmissing-prototypes" } */ +void foo() { } /* { dg-warning "no previous prototype" } */ +void foo(int i) { } /* { dg-warning "no previous prototype" } */ +void bar(); +void bar() { } +void bar1(); +void bar1(int i); +void bar1(int i) { } +void bar1(float) { } /* { dg-warning "no previous prototype" } */ +extern "C" void bar1(char); +extern "C" void bar1(char) { } /* { dg-error "previous declaration" } */ +extern "C" void bar1(short); /* { dg-error "conflicts with" } */ +extern "C" void bar1(short) { } +extern "C" void bar2(char); +extern "C" void bar2(char) { } /* { dg-error "previous declaration" } */ +extern "C" void bar2(short) { } /* { dg-error "conflicts with" } */ +extern "C" void bar3(char); +extern "C" void bar3(char) { } /* { dg-error "previous declaration" } */ +extern "C" void bar3(short) { } /* { dg-error "conflicts with" } */ +struct beef { }; +void beef() { } /* { dg-warning "no previous prototype" } */ +void dead(); +namespace { + void dead() { } +} +void dead4(); +namespace A { + void dead4() { } /* { dg-warning "no previous prototype" } */ +} +void dead1(); +namespace A { + void dead1(int); + void dead1() { } /* { dg-warning "no previous prototype" } */ +} +void dead2(); /* { dg-error "old declaration" } */ +int dead2() { } /* { dg-error "new declaration" } */ +struct undef; +undef meat; /* { dg-error "incomplete type and cannot be defined" } */ +double meat() { } +static void local() { } +int main() { } +void exit(float); +void exit(int e) { a: goto a; } /* { dg-warning "no previous prototype" } */ +void dead3(float); +int dead3(int); /* { dg-error "old declaration" } */ +void dead3(int e) { a: goto a; }/* { dg-error "new declaration" } */ +class A { + void m(); +}; +void A::m() { } +namespace { + void m() { } +}; Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/template.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/template.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/template.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/template.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,31 @@ +/* APPLE LOCAL file templated static data 6298605 */ +/* Radar 6298605 */ + +namespace { + template + struct ElfSizes { + static const int sym_size = 5; + static const int ehdr_size = 5; + }; + + template + struct SizedElfFileData { + SizedElfFileData(); + + virtual void ReadSymbols(); + }; + + template + SizedElfFileData::SizedElfFileData() { + ElfSizes::ehdr_size; + } + + template + void SizedElfFileData::ReadSymbols() { + ElfSizes::sym_size; + } + + void Open() { + SizedElfFileData<32> foo = SizedElfFileData<32>(); + } +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/warn-ctors.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/warn-ctors.C?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/warn-ctors.C (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/warn-ctors.C Mon Nov 3 02:35:57 2008 @@ -0,0 +1,22 @@ +/* APPLE LOCAL file Wglobal-constructors 6324584 */ +/* { dg-options "-Wglobal-constructors" } */ +/* Radar 6324584 */ + +volatile int i; + +class A { +public: + A() { i = 1; } +} a; /* { dg-warning "requires global construction" } */ + +class B { +public: + ~B() { i = 1; } +} b; /* { dg-warning "requires global destruction" } */ + +void ctor() __attribute__((constructor)); +void ctor() { /* { dg-warning "requires global construction" } */ +} +void dtor() __attribute__((destructor)); +void dtor() { /* { dg-warning "requires global destruction" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/apple-longcall-2.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-2.C Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4299630 */ /* { dg-do compile { target powerpc*-*-darwin* } } */ -/* { dg-skip-if "Not valid on 64-bit" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mlongcall" } */ /* { dg-final { scan-assembler "\tjmp[ ]" } } */ /* Radar 4299630: insure C++ thunks get long jmps. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/apple-longcall-3.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/apple-longcall-3.C Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4380289 */ /* { dg-do compile { target powerpc*-*-darwin* } } */ -/* { dg-skip-if "Not valid on 64-bit" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mlongcall -mkernel" } */ /* { dg-final { scan-assembler "\tjmp" } } */ /* { dg-final { scan-assembler "\tjbsr" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext4.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/kext4.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext4.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext4.C Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file KEXT double destructor */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fapple-kext" } */ -/* { dg-skip-if "Not valid on 64-bit" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* test for use of apple_kext_compatibility on stack */ struct B1 { virtual ~B1(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext7.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/kext7.C?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext7.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/kext7.C Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Radar 3943783 kernel extensions built with gcc-4.0 can't be loaded */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-S -fapple-kext" } */ -/* { dg-skip-if "Not valid on 64-bit" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ struct Base { virtual ~Base(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4104248.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4104248.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4104248.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4104248.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4104248 */ /* { dg-do compile { target "i?86*-*-darwin*" } } */ -/* { dg-skip-if "" { i?86*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-Os" } */ register char foo asm("edi"); char x; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4113078.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4113078.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4113078.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4113078.c Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Check that stack alignment is correct when callee inlined function uses a vector and caller does not. */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O2 -msse3 -march=pentium4 -march=prescott" } */ #include extern void bar(__m128i*); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4115609.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4115609.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4115609.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4115609.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4115609 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O3 -mdynamic-no-pic -fomit-frame-pointer" } */ /* { dg-final { scan-assembler-times "movl\t*" 55} } */ /* { dg-final { scan-assembler-not "sall" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4167459.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4167459.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4167459.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4167459.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL begin radar 4167459 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O -march=pentium4" } */ extern double foo(double); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4182984.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4182984.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4182984.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4182984.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4182984 */ /* { dg-do run { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O3" } */ typedef unsigned int UINT; typedef unsigned long UINT32; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4525731 */ /* { dg-do run { target i?86-*-* } } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O3" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4525731-2.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4525731 */ /* { dg-do compile { target i?86-*-* } } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O3" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4603883.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4603883.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4603883.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/4603883.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 4603883 */ /* { dg-do compile } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ double param[10][10][5000000]; /* { dg-error "size of array 'param' is too large" } */ void foo () { Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5813921.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5813921.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5813921.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5813921.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,18 @@ +/* APPLE LOCAL file 5813921 */ +/* { dg-do compile { target powerpc-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options { -Os } } */ +/* { dg-final { scan-assembler "cntlzw" { target powerpc-*-* } } } */ +/* { dg-final { scan-assembler "bsr" { target i?86-*-* x86_64-*-* } } } */ +typedef long unsigned int __darwin_size_t; +typedef __darwin_size_t size_t; +typedef enum RoundingMode { + kRoundTowardNearestEven = 1, kRoundTowardZero = 2, kRoundTowardInf = 4, + kRoundTowardMinusInf = 8, + kRoundAll = kRoundTowardNearestEven | kRoundTowardZero | kRoundTowardInf + | kRoundTowardMinusInf } RoundingMode; +extern const int roundingModes[4]; +void SetRoundingMode( RoundingMode mode ) { + long m = mode; + size_t r = (8*sizeof(long)-1) - __builtin_clzl( m ); + fesetround( roundingModes[ r ] ); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5919583.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5919583.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5919583.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5919583.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,41 @@ +/* APPLE LOCAL file 5919583 */ +/* { dg-do run { target i?86*-*-* } } */ +/* { dg-options { -msse3 } } */ +#include +#include + +typedef union { + char ary[16]; + __m128i vec; +} vectype; + +vectype ref; + +int __attribute__ ((__noinline__)) scare (vectype); +int __attribute__ ((__noinline__)) +scare (vectype vec) +{ + int i; + for (i=0; i<16; i++) + if (vec.ary[i] != ref.ary[i]) + return -1; /* fail */ + return 0; /* pass */ +} + +int main( void ) +{ + vectype v; + + ref.vec = (const __m128i) { 0x32100123456789ABULL, 0xFEDCBA987654ULL }; + v.vec = _mm_srli_si128( (const __m128i) { 0x0123456789ABCDEFULL, 0xFEDCBA9876543210ULL }, 2 ); + /* + { + int i; + for( i = 0; i < 16; i++ ) + printf( "%2.2x", ((unsigned char*) &v)[i] ); + } + printf ("scare = %d\n", scare(v)); + */ + + return scare (v); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6187262.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6187262.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6187262.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6187262.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file 6187262 */ +/* { dg-do compile { target { i?86-*-darwin* x86_64-*-darwin* } } } */ +/* { dg-options { -O1 } } */ +typedef long long __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); +int main() +{ + __m64 mm6; + int i; + for(i=0; i<1e7; ++i) + { + mm6 = (__m64)(unsigned long long)i; + mm6 = __builtin_ia32_pand(mm6, mm6); + } +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6222167.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6222167.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6222167.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6222167.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,21 @@ +/* { dg-do compile { target i?86-apple-darwin* x86_64-apple-darwin* } } */ +/* { dg-options "-msse4.1" } */ +/* { dg-final { scan-assembler "pmaxsd" } } */ +/* { dg-final { scan-assembler "pminsd" } } */ +#include +#include "smmintrin.h" +typedef int int4 __attribute__ ((vector_size(16))); + +int main( void ) +{ + volatile int4 a = (int4) { 0, 1, 2, 3}; + volatile int4 b = (int4) { 2, 2, 2, 2}; + + int4 max = __builtin_ia32_pmaxsd128( a, b ); + int4 min = __builtin_ia32_pminsd128( a, b ); + + printf( "max: { %d, %d %d, %d}\n", ((int*) &max)[0], ((int*) &max)[1], ((int*) &max)[2], ((int*) &max)[3] ); + printf( "min: { %d, %d %d, %d}\n", ((int*) &min)[0], ((int*) &min)[1], ((int*) &min)[2], ((int*) &min)[3] ); + + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6227434.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6227434.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6227434.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6227434.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,12 @@ +/* APPLE LOCAL file 6227434 */ +/* { dg-do compile { target i?86-apple-darwin* x86_64-apple-darwin* } } */ +/* { dg-options { -mfix-and-continue } } */ +/* { dg-require-effective-target lp64 } */ +/* { scan-assembler-not "_count\[12\]-" } */ +static unsigned count1 = 0; +extern unsigned count2; + +void t(void) { + count1 = 1; + count2 = 2; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6258941.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6258941.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6258941.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6258941.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,9 @@ +/* APPLE LOCAL file 6258941 */ +/* { dg-do compile { target powerpc*-apple-darwin* } } */ +/* { dg-options { -mtune=G4 } } */ +extern void malloc_printf(const char *format, ...); +void auto_fatal(const char *format, ...) { + static char buffer[512]; + malloc_printf("%s", buffer); + __builtin_trap(); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6286881.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6286881.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6286881.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6286881.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,9 @@ +/* APPLE LOCAL file radar 6286881 */ +/* Check for incorrect expression does not result in compiler looping; instead of diagnostic. */ +/* { dg-do compile } */ +unsigned int +func_48 (signed char p_49) +{ + signed char l_340; + func_44 (&((1 ^ 1 == (lshift_u_s (1)) != (l_340 < 1)) & 1L)); /* { dg-error "lvalue required as unary" } */ +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6308664.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6308664.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6308664.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6308664.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,11 @@ +/* APPLE LOCAL file 6308664 */ +/* { dg-do compile { target i?86-*-darwin* x86_64-*-darwin* } } */ +/* { dg-options { -m64 } } */ +/* { dg-final { scan-assembler-not "GOTPCREL" } } */ +extern void doit(double x); + +void test() +{ + doit(16.0); + doit(32.0); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6310728.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6310728.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6310728.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6310728.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,62 @@ +/* APPLE LOCAL file 6310728 */ +/* { dg-do compile } */ +/* { dg-options { -mfix-and-continue -m64 } } */ +typedef int int32_t; +typedef int32_t SINT32 ; +void RowCol8x8( SINT32 *in8x8, SINT32 *out8x8, SINT32 acqfact, SINT32 intraFlag, float *i2f9808div2, float *i2f9239div2, float *i2f7071div2, char *qAC) { + SINT32 k; + float tmpout[64]; + SINT32 *ptrL; + float *ptrF; + SINT32 tmpL0,tmpL1,tmpL2,tmpL3,tmpL4,tmpL5,tmpL6,tmpL7,tmpL8,tmpL9; + float kess7071div2 = 0.3535533905932737; + float kess9808div2 = 0.4903926402016152; + float kess8315div2 = 0.4157348061512726; + float kess5556div2 = 0.2777851165098011; + float kess1951div2 = 0.09754516100806417; + float kess9239div2 = 0.4619397662556434; + float kess3827div2 = 0.1913417161825449; + float tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9; + for (ptrL=in8x8,ptrF=tmpout,k=0; + k<8; + k++,ptrF++,ptrL++) { + tmp1 = ptrF[0]; + tmp2 = ptrF[56]; + tmp4 = ptrF[48]; + if (intraFlag && k == 0) { + tmp5 = 0.5 + tmp5*0.125; + } + tmpL1 = tmp5; + tmpL2 = tmp7 - kess7071div2*tmp8; + tmp7 = kess9239div2*tmp0; + tmpL4 = tmp7 + kess3827div2*tmp1; + tmp8 = kess3827div2*tmp0; + tmpL7 = tmp8 - kess9239div2*tmp1; + tmp5 = kess9808div2*tmp9; + tmp5 += kess8315div2*tmp2; + tmp5 += kess5556div2*tmp4; + tmpL3 = tmp5 + kess1951div2*tmp6; + tmp8 += kess8315div2*tmp4; + tmpL8 = tmp8 - kess9808div2*tmp6; + if (!(intraFlag && k == 0)) { + if (!( acqfact <= 7 )) { + ptrL[0] = (SINT32) qAC[(tmpL1)]; + } + else ptrL[0] = tmpL1; + } + if (!( acqfact <= 7 )) { + ptrL[16] = (SINT32) qAC[(tmpL4)]; + ptrL[24] = (SINT32) qAC[(tmpL5)]; + ptrL[40] = (SINT32) qAC[(tmpL6)]; + ptrL[48] = (SINT32) qAC[(tmpL7)]; + ptrL[56] = (SINT32) qAC[(tmpL8)]; + } + else { + ptrL[32] = tmpL2; + ptrL[8] = tmpL3; + ptrL[16] = tmpL4; + ptrL[48] = tmpL7; + ptrL[56] = tmpL8; + } + } +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5b.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5b.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5b.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5b.c Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-malign-power -DSIZE=12" } */ /* We have a different test to pick up the warning from 64-bit case. */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* * GCC alignment test for command line options for setting alignment modes. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5d.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5d.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5d.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/align-test-5d.c Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-malign-natural -DSIZE=12" } */ /* This is for Intel only. */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* * GCC alignment test for command line options for setting alignment modes. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-13.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4259442 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-17.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-17.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-17.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-17.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 -O2 } } */ /* Radar */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-18.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-18.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-18.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-18.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 -O2 } } */ /* Radar 4248228 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-24.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-24.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-24.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-24.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4300095 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-25.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-25.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-25.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-25.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4309942 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-31.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-31.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-31.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-31.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 -mdynamic-no-pic } } */ /* Radar 4319881 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-32.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-32.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-32.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-32.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4319887 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-33.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-33.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-33.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-33.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4300193 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-35.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-35.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-35.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-35.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 -mdynamic-no-pic } } */ /* Radar 4371551 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-36.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-36.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-36.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-36.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4371958 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-41.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-41.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-41.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-41.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4429851 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-45.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-45.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-45.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-45.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4419735 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-50.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-50.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-50.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-50.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4505741 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-54.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-54.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-54.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-54.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* { dg-final { scan-assembler "movq -\(16|36\)\\\(%ebp\\\), %mm0" } } */ /* Radar 4515069 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-55.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-55.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-55.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-55.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 -mdynamic-no-pic } } */ /* { dg-final { scan-assembler "movq _packedw1.*, %mm0" } } */ /* Radar 4515069 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-57.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-57.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-57.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-57.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do run { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { i?86*-*-darwin* } { "-m64" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4682427 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-6.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-6.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-6.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-6.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { "-fasm-blocks" } } */ /* Radar 4211978 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-7.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-7.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-7.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-block-7.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options { "-fasm-blocks" } } */ /* Radar 4214021 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-test-nofralloc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-test-nofralloc.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-test-nofralloc.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/asm-test-nofralloc.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL begin radar 4187164 */ /* { dg-do run { target powerpc*-*-darwin* } } */ /* This testcase isn't 64-bit safe. */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-fasm-blocks" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-5992047.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-5992047.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-5992047.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-5992047.c Mon Nov 3 02:35:57 2008 @@ -1,11 +1,11 @@ -/* APPLE LOCAL file radar 5992047 */ +/* APPLE LOCAL file radar 5992047 - radar 6175959 */ /* Check that with a previous declaration of _Block_destroy, test case compiles with no error or ICE. */ /* { dg-options "-fblocks" } */ /* { dg-do compile { target *-*-darwin* } } */ #define Block_destroy(xxx) _Block_destroy((const void *)(xxx)) -void _Block_destroy(const void *aBlock); +void _Block_destroy(const void *aBlock, int isWeak); typedef struct dispatch_item_s *dispatch_item_t; typedef void (^completion_block_t)(void); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-6116917.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-6116917.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-6116917.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-6116917.c Mon Nov 3 02:35:57 2008 @@ -7,16 +7,25 @@ #include //#include +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ struct Block_basic { - void *isa; - int Block_flags; // int32_t - int Block_size; // XXX should be packed into Block_flags + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int Block_flags; + int reserved; void (*Block_invoke)(void *); - void (*Block_copy)(void *dst, void *src); - void (*Block_dispose)(void *); - //long params[0]; // generic space for const & byref hidden params, return value, variable on needs of course -}; + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int Block_size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *src); + } *descriptor; + + // imported variables +}; +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ void func(void (^b)(void)) @@ -51,6 +60,7 @@ bb = (void *)stage1; + /* APPLE LOCAL radar 5847213 - radar 6329245 */ bbi_addr = (long)bb->Block_invoke; bb_addr = (long)bb; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcglobal.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcglobal.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcglobal.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcglobal.c Mon Nov 3 02:35:57 2008 @@ -28,8 +28,8 @@ int main(char *argc, char *argv[]) { - int i = 0; + __block int i = 0; // assigning a Block into a global should elicit a global write-barrier under GC - GlobalVoidVoid = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + GlobalVoidVoid = ^ { ++i; }; return GlobalInt - 1; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcivar.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcivar.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcivar.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcivar.c Mon Nov 3 02:35:57 2008 @@ -45,10 +45,10 @@ int main(char *argc, char *argv[]) { - int i = 0; + __block int i = 0; TestObject *to = [[TestObject alloc] init]; // assigning a Block into an ivar should elicit a write-barrier under GC - to->ivarBlock = ^ { | i | ++i; }; // fails to gen write-barrier /* { dg-warning "has been deprecated in blocks" } */ + to->ivarBlock = ^ { ++i; }; // fails to gen write-barrier //to->x = to; // gens write-barrier return GlobalInt - 1; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcstrongcast.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcstrongcast.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcstrongcast.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assigngcstrongcast.c Mon Nov 3 02:35:57 2008 @@ -35,8 +35,8 @@ int main(char *argc, char *argv[]) { StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*)); - int i = 10; + __block int i = 10; // assigning a Block into an struct slot should elicit a write-barrier under GC - swbp->ivarBlock = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + swbp->ivarBlock = ^ { ++i; }; return GlobalInt - 1; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc-1.c Mon Nov 3 02:35:57 2008 @@ -25,9 +25,9 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - int i = 0; + __block int i = 0; void (^local)(void); - Henry = ^ { | i | ++i; return &i; }; /* { dg-warning "has been deprecated in blocks" } */ + Henry = ^ { ++i; return &i; }; if (GlobalInt == 1) { printf("%s: success\n", argv[0]); exit(0); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgc.c Mon Nov 3 02:35:57 2008 @@ -25,9 +25,9 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - int i = 0; + __block int i = 0; void (^local)(void); - Henry = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + Henry = ^ { ++i; }; if (GlobalInt == 1) { printf("%s: success\n", argv[0]); exit(0); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgcivar.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgcivar.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgcivar.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-assignweakgcivar.c Mon Nov 3 02:35:57 2008 @@ -33,10 +33,10 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - int i = 0; + __block int i = 0; void (^local)(void); Foo *foo = [[Foo alloc] init]; - foo->ivar = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + foo->ivar = ^ { ++i; }; if (GlobalInt == 1) { printf("%s: success\n", argv[0]); exit(0); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-attributes-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-attributes-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-attributes-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-attributes-1.c Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6237713 */ +/* APPLE LOCAL file radar 6237713 - modified for radar 6230297 */ /* Test for using attributes on blocks. */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ /* { dg-do compile } */ @@ -11,10 +11,10 @@ { void (^a)(void) __attribute__((noreturn)) = ^ (void) __attribute__((noreturn)) { exit (0); }; // OK; - ^ (int i) __attribute__((noreturn)) { return i; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ + int (^b)(int) __attribute__((noreturn)) = ^ (int i) __attribute__((noreturn)) { return i; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ /* { dg-warning "\\'noreturn\\' function does return" "" { target *-*-* } 14 } */ - ^ __attribute__((noreturn)) { return 100; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ + int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; /* { dg-warning "function declared \\'noreturn\\' has a \\'return\\' statement" } */ /* { dg-warning "\\'noreturn\\' function does return" "" { target *-*-* } 17 } */ a = ^ (void) __attribute__((noreturn)) { exit (0); }; // OK Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-block-property-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-block-property-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-block-property-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-block-property-2.c Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 5831920 */ +/* APPLE LOCAL file radar 5831920 - modified for radar 6255671 */ #import /* Test a property with block type. */ /* { dg-do run } */ @@ -12,8 +12,8 @@ int (^getIntRetain)(void); } - at property int (^getIntCopy)(void); - at property int (^getIntRetain)(void); + at property (assign) int (^getIntCopy)(void); + at property (assign) int (^getIntRetain)(void); @end @implementation TestObject @@ -31,9 +31,9 @@ int main(char *argc, char *argv[]) { int count; - int val = 0; + __block int val = 0; TestObject *to = [[TestObject alloc] init]; - to.getIntRetain = ^ { | val| printf("\n Hello(%d)\n", val); return ++val; }; /* { dg-warning "has been deprecated in blocks" } */ + to.getIntRetain = ^ { printf("\n Hello(%d)\n", val); return ++val; }; to.getIntCopy = to.getIntRetain; count = DoBlock (to.getIntCopy); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-1.c Mon Nov 3 02:35:57 2008 @@ -2,14 +2,14 @@ /* { dg-options "-fblocks" } */ /* { dg-do compile } */ -__byref int X; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ +__block int X; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ -int foo(__byref int param) { /* { dg-warning "byref attribute can be specified on variables only - ignored" } */ - __byref int OK = 1; +int foo(__block int param) { /* { dg-warning "__block attribute can be specified on variables only - ignored" } */ + __block int OK = 1; - extern __byref double extern_var; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ + extern __block double extern_var; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ if (X) { - static __byref char * pch; /* { dg-warning "__byref attribute is only allowed on local variables - ignored" } */ + static __block char * pch; /* { dg-warning "__block attribute is only allowed on local variables - ignored" } */ } return OK - 1; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-2.c Mon Nov 3 02:35:57 2008 @@ -6,8 +6,8 @@ void _Block_byref_release(void*src){} int main() { - __byref int X = 1234; - __byref const char * message = "HELLO"; + __block int X = 1234; + __block const char * message = "HELLO"; X = X - 1234; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-3.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-3.c Mon Nov 3 02:35:57 2008 @@ -6,8 +6,8 @@ void _Block_byref_release(void*src){} int main() { - __byref int X = 1234; - __byref const char * message = "HELLO\n"; + __block int X = 1234; + __block const char * message = "HELLO\n"; X = X - 1234; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-4.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-4.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-4.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-4.c Mon Nov 3 02:35:57 2008 @@ -8,9 +8,9 @@ void _Block_byref_release(void*src){} int main() { - __byref int X = 1234; + __block int X = 1234; - int (^CP)(void) = ^{ |X| X = X+1; return X; }; /* { dg-warning "has been deprecated in blocks" } */ + int (^CP)(void) = ^{ X = X+1; return X; }; CP(); printf ("X = %d\n", X); return X - 1235; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-5.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-5.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-5.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-5.c Mon Nov 3 02:35:57 2008 @@ -17,10 +17,10 @@ int main() { int x = 1; - __byref int y = 2; - __byref br_x; + __block int y = 2; + __block br_x; int y1; - double res = test(^(int z){|y| y = x+z; return (double)x; }); /* { dg-warning "has been deprecated in blocks" } */ + double res = test(^(int z){y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 1 || y != 43) exit(1); @@ -28,7 +28,7 @@ br_x = x; y1 = y; - res = test(^(int z){|br_x| br_x = br_x+z; return (double)y1; }); /* { dg-warning "has been deprecated in blocks" } */ + res = test(^(int z){br_x = br_x+z; return (double)y1; }); printf("result = %f br_x = %d y1 = %d\n", res, br_x, y1); if (br_x != 43 || y1 != 43) exit(1); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-6.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-6.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-6.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-6.c Mon Nov 3 02:35:57 2008 @@ -16,14 +16,14 @@ } int main() { - __byref int x = 1; - __byref int y = 2; - double res = test(^(int z){|y| y = x+z; return (double)x; }); /* { dg-warning "has been deprecated in blocks" } */ + __block int x = 1; + __block int y = 2; + double res = test(^(int z){y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 1 || y != 43) exit(1); - res = test(^(int z){|x| x = x+z; return (double)y; }); /* { dg-warning "has been deprecated in blocks" } */ + res = test(^(int z){x = x+z; return (double)y; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 43 || y != 43) exit(1); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-7.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-7.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-7.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-7.c Mon Nov 3 02:35:57 2008 @@ -12,28 +12,28 @@ int i; int foo() { - __byref id FFFFFF; - __byref id Q; - ^{ |FFFFFF| FFFFFF = 0; }; /* { dg-warning "has been deprecated in blocks" } */ + __block id FFFFFF; + __block id Q; + ^{ FFFFFF = 0; }; if (i) { - __byref id FFFFFF; - __byref id Q; - ^{ |FFFFFF| FFFFFF = 0; }; /* { dg-warning "has been deprecated in blocks" } */ + __block id FFFFFF; + __block id Q; + ^{ FFFFFF = 0; }; } } int main() { - __byref id X; - __byref id X1; - ^{ |X| X = 0; }; /* { dg-warning "has been deprecated in blocks" } */ + __block id X; + __block id X1; + ^{ X = 0; }; if (i) { - __byref id X; - __byref id X1; - ^{ |X| X = 0; }; /* { dg-warning "has been deprecated in blocks" } */ + __block id X; + __block id X1; + ^{ X = 0; }; } return 0; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-8.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-8.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-8.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-blocks-test-8.c Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Test the __byreg runtime features. */ /* { dg-options "-mmacosx-version-min=10.5 -ObjC -framework Foundation" { target i?86-*-darwin* } } */ /* { dg-do run { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #import @@ -49,15 +49,26 @@ BLOCK_IS_GC = (1 << 27), }; +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ struct Block_basic { - void *isa; - int Block_flags; // int32_t - int Block_size; // XXX should be packed into Block_flags + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int Block_flags; + int reserved; void (*Block_invoke)(void *); - void (*Block_copy)(void *dst, void *src); - void (*Block_dispose)(void *); - //long params[0]; // generic space for const & byref hidden params, return value, variable on needs of course + + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int Block_size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *src); + } *descriptor; + + // imported variables }; +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ + struct Block_byref { void* isa; struct Block_byref *forwarding; @@ -90,8 +101,8 @@ } int main(int argc, char *argv[]) { - id __byref dumbo = newDumbObject(); //[DumbObject new]; - void (^dummy)(void) = ^{ | dumbo | /* { dg-warning "has been deprecated in blocks" } */ + id __block dumbo = newDumbObject(); //[DumbObject new]; + void (^dummy)(void) = ^{ [dumbo self]; }; @@ -102,8 +113,8 @@ } char result[200]; - printf("calling out to copy support helper at %p\n", aBlock->Block_copy); - (*aBlock->Block_copy)(result, aBlock); // do fixup + printf("calling out to copy support helper at %p\n", aBlock->descriptor->Block_copy); + (*aBlock->descriptor->Block_copy)(result, aBlock); // do fixup // The copy/destroy helper should have had a callout to _Block_byref_assign_copy for its byref block if (! ByrefAssignCopy) { @@ -117,7 +128,7 @@ return 1; } - (*aBlock->Block_dispose)(aBlock); + (*aBlock->descriptor->Block_dispose)(aBlock); return 0; } Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-2.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-2.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-2.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,35 @@ +/* APPLE LOCAL file radar 6237616 */ +/* { dg-do compile } */ +/* { dg-options "-g -O3 -dA -mmacosx-version-min=10.6" }*/ +/* { dg-final { scan-assembler "DW_OP_breg\[0-9a-f]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x0+\[ \t]+\[#;@]\[ \t]sleb128 0+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x6+\[ \t]+\[#;@]\[ \t]DW_OP_deref+\[ \t\n]+\[ \t]\\.byte+\[ \t]\[0x6;0x23]+\[ \t]+\[#;@]\[ \t]\[DW_OP_deref;DW_OP_plus_uconst]"} } */ +/* { dg-final { scan-assembler-not "DW_OP_reg\[0-9a-f]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x6+\[ \t]+\[#;@]\[ \t]DW_OP_deref"} } */ + +#include + +int +main () +{ + int val_1, val_2; + + int (^my_block) (int); + + if (1) + { + __block int use_by_ref = 1; + int use_by_value = 0xfefefefe; + + my_block = ^ (int in_value) { + use_by_ref++; + printf ("Block function has: %d %d %d.\n", in_value, use_by_value, use_by_ref); + return in_value + use_by_ref + use_by_value; + }; + use_by_ref++; + val_1 = my_block (10); + } + + val_1 = my_block (20); + val_2 = my_block (30); + printf ("Got: %d and %d.\n", val_1, val_2); + + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-3.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-3.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-3.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,35 @@ +/* APPLE LOCAL file radar 6237616 */ +/* { dg-do compile } */ +/* { dg-options "-g -O0 -dA -mmacosx-version-min=10.6" }*/ +/* { dg-final { scan-assembler "line 15+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x0+\[ \t]+\[#;@]\[ \t]DW_LNE_set_address+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x\[0-9a-f]+\[ \t]+\[#;@]\[ \t]uleb128 0x\[0-9a-f]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x2+\[ \t\n]+\[ \t]\[\\.long;\\.quad]+\[ \t]LM\[0-9]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x\[0-9a-f]+\[ \t]+\[#;@]\[ \t]line 16"} } */ +/* { dg-final { scan-assembler-not "line 15+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x0+\[ \t]+\[#;@]\[ \t]DW_LNE_set_address+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x\[0-9a-f]+\[ \t]+\[#;@]\[ \t]uleb128 0x\[0-9a-f]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x2+\[ \t\n]+\[ \t]\[\\.long;\\.quad]+\[ \t]LM\[0-9]+\[ \t\n]+\[ \t]\\.byte+\[ \t]0x\[0-9a-f]+\[ \t]+\[#;@]\[ \t]DW_LNS_copy" } } */ + +#include +#line 3 +int +main () +{ + int val_1, val_2; + + int (^my_block) (int); + + if (1) + { + __block int use_by_ref = 1; + int use_by_value = 0xfefefefe; + + my_block = ^ (int in_value) { + use_by_ref++; + printf ("Block function has: %d %d %d.\n", in_value, use_by_value, use_by_ref); + return in_value + use_by_ref + use_by_value; + }; + use_by_ref++; + val_1 = my_block (10); + } + + val_1 = my_block (20); + val_2 = my_block (30); + printf ("Got: %d and %d.\n", val_1, val_2); + + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-attribute.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-attribute.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-attribute.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref-attribute.c Mon Nov 3 02:35:57 2008 @@ -1,11 +1,11 @@ /* APPLE LOCAL file radar 6096219 */ -/* Test that __byref attribute can be used directly. */ +/* Test that __block attribute can be used directly. */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ /* { dg-do compile } */ int main() { - __byref int JJJJ; + __block int JJJJ; __attribute__((__blocks__(byref))) int III; int (^XXX)(void) = ^{ return III+JJJJ; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-byref.c Mon Nov 3 02:35:57 2008 @@ -4,38 +4,26 @@ /* { dg-options "-fblocks" } */ int main() { + __block int a; + __block int b; int x, y; ^{ }; - ^{|x|}; /* { dg-warning "has been deprecated in blocks" } */ + ^{}; - ^{ |x,y| int r; return x+y+r; }; /* { dg-warning "has been deprecated in blocks" } */ - ^{ |x,y|; int r; return x+y+r; }; /* { dg-warning "has been deprecated in blocks" } */ + ^{ int r; return x+y+r; }; + ^{ int r; return x+y+r; }; - ^{ |x,y|; int r; return x+y+r; /* { dg-warning "has been deprecated in blocks" } */ + ^{ int r; return x+y+r; ^{ - |x,y|; int r; return x+y; /* { dg-warning "has been deprecated in blocks" } */ + int r; return x+y; }; }; - ^{ |x,y|; int r; return x+y+r; /* { dg-warning "has been deprecated in blocks" } */ - ^{ - { |x,y|; int r; return x+y; }; /* { dg-error "expected expression before" } */ - }; - }; + ^{a = 1;}; - ^ { int r; - |x, y| /* { dg-error "expected expression before" } */ - }; - - ^{| /* { dg-warning "has been deprecated in blocks" } */ - main()|}; /* { dg-error "only a visible variable may be used in a block byref declaration" } */ - - /* Assigning to byref variables. */ - ^{|x| x = 1;}; /* { dg-warning "has been deprecated in blocks" } */ - - ^{ |x,y| /* { dg-warning "has been deprecated in blocks" } */ - if (x != y) - x = y = 100; + ^{ + if (a != b) + a = b = 100; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-codegen-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-codegen-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-codegen-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-codegen-1.c Mon Nov 3 02:35:57 2008 @@ -14,14 +14,14 @@ } int main() { - int x = 1; - int y = 2; - double res = test(^(int z){|y| y = x+z; return (double)x; }); /* { dg-warning "has been deprecated in blocks" } */ + __block int x = 1; + __block int y = 2; + double res = test(^(int z){y = x+z; return (double)x; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 1 || y != 43) exit(1); - res = test(^(int z){|x| x = x+z; return (double)y; }); /* { dg-warning "has been deprecated in blocks" } */ + res = test(^(int z){x = x+z; return (double)y; }); printf("result = %f x = %d y = %d\n", res, x, y); if (x != 43 || y != 43) exit(1); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-complicated-type.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-complicated-type.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-complicated-type.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-complicated-type.c Mon Nov 3 02:35:57 2008 @@ -15,6 +15,8 @@ int (^(^block)(double x))(char, short); void foo() { - block = ^(double x){ return ^(char c, short y) { return (int)c + y; };}; /* { dg-error "returning block that lives on the local stack" } */ + int one = 1; + /* APPLE LOCAL radar 6230297 */ + block = ^(double x){ return ^(char c, short y) { return one + (int)c + y; };}; /* { dg-error "returning block that lives on the local stack" } */ } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-copy-destroy.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-copy-destroy.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-copy-destroy.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-copy-destroy.c Mon Nov 3 02:35:57 2008 @@ -12,10 +12,11 @@ @implementation Root - (void)example { - int y, x; + int x; + __block int y; NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSAutoreleasePool *relpool = [NSAutoreleasePool new]; - bar(^(int z){ |y| y = x+z; [pool drain]; if (y) y++; [relpool release]; return y+2.0; }); /* { dg-warning "has been deprecated in blocks" } */ + bar(^(int z){ y = x+z; [pool drain]; if (y) y++; [relpool release]; return y+2.0; }); } @end Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-1.c Mon Nov 3 02:35:57 2008 @@ -4,7 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-g -O0 -fblocks -dA" } */ -/* { dg-final { scan-assembler "invoke_impl.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_descriptor.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_literal_generic.*DW_AT_name" } } */ struct inStruct { void (^genericBlockPtr)(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-debug-2.c Mon Nov 3 02:35:57 2008 @@ -4,7 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-g -O0 -fblocks -dA" } */ -/* { dg-final { scan-assembler "invoke_impl.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_descriptor.*DW_AT_name" } } */ +/* { dg-final { scan-assembler "__block_literal_generic.*DW_AT_name" } } */ void (^os)(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-dup-invoke_impl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-dup-invoke_impl.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-dup-invoke_impl.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-dup-invoke_impl.c Mon Nov 3 02:35:57 2008 @@ -23,13 +23,13 @@ } int main() { - enum numbers x = one; - enum numbers y = two; + __block enum numbers x = one; + __block enum numbers y = two; myblock CL = ^(enum numbers z) - {|y| y = z; /* { dg-warning "has been deprecated in blocks" } */ + {y = z; test ( - ^ (enum numbers z) { |x| /* { dg-warning "has been deprecated in blocks" } */ + ^ (enum numbers z) { x = z; return (enum numbers) four; } Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-duplicate-err.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-duplicate-err.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-duplicate-err.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-duplicate-err.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file radar 6310599 */ +/* Check that internal fields do not conflict with user names. */ +/* { dg-options "-fblocks" } */ +/* { dg-do compile } */ + +int main() +{ + __block int flags; + __block void *isa; + + ^{ flags=1; isa = (void *)isa; }; + return 0; +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-enum.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-enum.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-enum.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-enum.c Mon Nov 3 02:35:57 2008 @@ -20,15 +20,15 @@ } int main() { - enum numbers x = one; - enum numbers y = two; + __block enum numbers x = one; + __block enum numbers y = two; - enum numbers res = test(^(enum numbers z){|y| y = z; return x; }); /* { dg-warning "has been deprecated in blocks" } */ + enum numbers res = test(^(enum numbers z){y = z; return x; }); if (x != one || y != three || res != one) exit(1); - res = test(^(enum numbers z){|x| x = z; return x; }); /* { dg-warning "has been deprecated in blocks" } */ + res = test(^(enum numbers z){x = z; return x; }); if (x != three || res != three) exit(1); return 0; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-error-global-byref.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-error-global-byref.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-error-global-byref.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-error-global-byref.c Mon Nov 3 02:35:57 2008 @@ -16,7 +16,7 @@ static int static_local = 10; int local; CallBlock( ^ {++glob; - CallBlock(^ { |glob, static_local| /* { dg-warning "has been deprecated in blocks" } */ + CallBlock(^ { ++glob; stat++; ++static_local; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-do.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-do.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-do.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-do.c Mon Nov 3 02:35:57 2008 @@ -13,22 +13,20 @@ } int main() { - __byref int O1; - int p = 0; - do - { - __byref int I1; - do - { - __byref int J1; - if (p == 2) - break; - } - while ( ++p < 3); + { + __block int O1; + int p = 0; + do { + __block int I1; + do { + __block int J1; + if (p == 2) + break; + } while ( ++p < 3); if (p == 4) break; - } - while (++p != 5); + } while (++p != 5); + } return count-7; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for.c Mon Nov 3 02:35:57 2008 @@ -7,19 +7,19 @@ static int count; static void _Block_byref_release(void * arg) { - ++count; + ++count; } -int main() -{ - __byref int O1; +int main() { + { + __block int O1; int i; for (i = 1; i <= 5; i++) - { - __byref int I1; - } + { + __block int I1; + } if (count != 5) - abort(); - return count - 6; + abort(); + } + return count - 6; } - Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-for1.c Mon Nov 3 02:35:57 2008 @@ -14,18 +14,20 @@ } int main() { - __byref int O1; + { + __block int O1; int i; int p; for (i = 1; i <= 5; i++) { - __byref int I1; + __block int I1; p = 0; while (p != 10) { - __byref int II1; + __block int II1; if (p == 2) break; ++p; } } + } return count-21; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-goto.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-goto.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-goto.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-goto.c Mon Nov 3 02:35:57 2008 @@ -2,25 +2,21 @@ /* { dg-options "-fblocks" } */ /* { dg-do compile } */ - -int foo(int p) -{ - __byref int O1; - int i; - LOUT: ; - for (i = 1; i < 100; i++) - { - __byref int I1; - while (p < 0) - { - __byref int II1; - if (p == 100) - goto LOUT; /* { dg-error "local byref variable II1 is in the scope of this goto" } */ - ++p; - if (p == 2345) - break; - } +int main(int p) { + p = -5; + __block int O1; + int i; + LOUT: ; + for (i = 1; i < 100; i++) { + __block int I1; + while (p < 0) { + __block int II1; + if (p == 100) + goto LOUT; + ++p; + if (p == 2345) + break; } - return 0; + } + return 0; } - Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-nested-while.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-nested-while.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-nested-while.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-nested-while.c Mon Nov 3 02:35:57 2008 @@ -16,8 +16,8 @@ void objc_get_type_qualifiers (int flag, int type) { while (flag--) while (type++ < 4) { - __byref int W1; - __byref int W2; + __block int W1; + __block int W2; if (type == 2) break; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return.c Mon Nov 3 02:35:57 2008 @@ -15,12 +15,17 @@ } -int main() { - __byref int X = 1234; +int main1() { + __block int X = 1234; if (X) { - __byref int local_BYREF = 100; + __block int local_BYREF = 100; X += 100 + local_BYREF; return count-2; } return -1; } + +int main() { + main1(); + return count-2; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-return1.c Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6083129 byref escapes */ +/* APPLE LOCAL file radar 6083129 block escapes */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -17,13 +17,13 @@ void *_NSConcreteStackBlock; void FOO(int arg) { - __byref int X = 1234; + __block int X = 1234; if (arg) { - __byref int local_BYREF = 100; + __block int local_BYREF = 100; X += 100 + local_BYREF; return; } - ^{ |X| X++; }; /* { dg-warning "has been deprecated in blocks" } */ + ^{ X++; }; X = 1000; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-switch.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-switch.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-switch.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-switch.c Mon Nov 3 02:35:57 2008 @@ -15,33 +15,33 @@ } int foo(int p, int q) { - __byref int O1; + __block int O1; switch (p) { case 1: { - __byref int I1; + __block int I1; I1 += 1; break; } case 10: { - __byref int J1; + __block int J1; break; } default : { - __byref int D1; - __byref int D2; + __block int D1; + __block int D2; switch (q) { case 11: { - __byref int Q1; + __block int Q1; break; } default: { - __byref int ID1; - __byref int ID2; + __block int ID1; + __block int ID2; } }; break; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-while.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-while.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-while.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-escape-while.c Mon Nov 3 02:35:57 2008 @@ -12,14 +12,16 @@ int main() { - __byref int O1; + { + __block int O1; int i = 0; while (++i != 5) { - __byref int I1; + __block int I1; } if (count != 4) abort(); + } return count - 5; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-explicit-return-type.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-explicit-return-type.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-explicit-return-type.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-explicit-return-type.c Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 6185344 */ +/* APPLE LOCAL file radar 6185344 - updated for radar 6230297 */ /* Test for blocks with explicit return type specified. */ /* { dg-options "-mmacosx-version-min=10.6 -ObjC" { target *-*-darwin* } } */ /* { dg-do compile } */ @@ -75,9 +75,10 @@ int (^(^block)(double x))(char, short); void foo() { - block = ^(double x){ return ^int(char c, short y) { return c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ + int one = 1; + block = ^(double x){ return ^int(char c, short y) { return one + c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ // or: - block = ^(double x){ return ^(char c, short y) { return (int)c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ + block = ^(double x){ return ^(char c, short y) { return one + (int)c + y; };}; /* { dg-warning "returning block that lives on the local stack" } */ } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-1.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file radar 5803005 */ -/* Test that all global variables referenced in blocks are treated as 'byref' as default. */ +/* Test that all global variables referenced in blocks are treated as 'block' as default. */ /* { dg-do run } */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ @@ -15,8 +15,8 @@ int foo() { static int local = 10; - CallBlock( ^ {| local| ++glob; ++stat; ++local; /* { dg-warning "has been deprecated in blocks" } */ - CallBlock(^ { |local| ++glob; ++stat; ++local; }); /* { dg-warning "has been deprecated in blocks" } */ + CallBlock( ^ {++glob; ++stat; ++local; + CallBlock(^ { ++glob; ++stat; ++local; }); ++glob; ++stat; ++local; }); if (glob != 13 || stat != 13 || local != 13) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref-2.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file radar 6014138 */ -/* Test use of __byref on locals which will be used as 'byref' variables in blocks. */ +/* Test use of __block on locals which will be used as 'byref' variables in blocks. */ /* { dg-do run } */ /* { dg-options "-mmacosx-version-min=10.5 -fblocks" { target *-*-darwin* } } */ @@ -14,9 +14,9 @@ int foo() { - __byref int local_byref_1 = 10; - __byref int local_byref_2 = 10; - __byref int local_byref_3 = 10; + __block int local_byref_1 = 10; + __block int local_byref_2 = 10; + __block int local_byref_3 = 10; CallBlock( ^ { ++local_byref_1; ++local_byref_2; ++local_byref_3; CallBlock(^ { ++local_byref_1; ++local_byref_2; ++local_byref_3; }); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-global-byref.c Mon Nov 3 02:35:57 2008 @@ -15,8 +15,8 @@ int foo() { static int local = 10; - CallBlock( ^ {| glob, stat, local| ++glob; ++stat; ++local; /* { dg-warning "has been deprecated in blocks" } */ - CallBlock(^ { |glob, stat, local| ++glob; ++stat; ++local; }); /* { dg-warning "has been deprecated in blocks" } */ + CallBlock( ^ {++glob; ++stat; ++local; + CallBlock(^ { ++glob; ++stat; ++local; }); ++glob; ++stat; ++local; }); if (glob != 13 || stat != 13 || local != 13) Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-in-foreach-header.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-in-foreach-header.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-in-foreach-header.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-in-foreach-header.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,57 @@ +/* APPLE LOCAL file radar 6268817 */ +/* Testing use of block literal expression in ObjC's enumeration foreach-statement loop header. */ +/* { dg-options "-mmacosx-version-min=10.6 -ObjC -framework Foundation" { target *-*-darwin* } } */ +/* { dg-do run } */ + +#import + + at interface TargetSymbol : NSObject { + NSString * _symbolName; +} + at property (copy) NSString *name; + at end + + at implementation TargetSymbol + at synthesize name = _symbolName; + at end + +static void Looper(NSArray *symbols) { + // 1. Block literal assigned to a block pointer, which is used in loop: build succeeds + NSComparator comparator = ^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}; + + for (id symbol in [symbols sortedArrayUsingComparator:comparator]) { + // Do something + } + + // 2. Block expression literal used, but still outside loop: build succeeds + NSArray *sortedSymbols = [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]; + + for (id symbol in sortedSymbols) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } + + // 3. Block expression literal used directly in loop: build fails + for (id symbol in [symbols sortedArrayUsingComparator:^(id target1, id target2){return [((TargetSymbol *)target1).name compare:((TargetSymbol *)target2).name];}]) { + // Do something + } +} + + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + // insert code here... + NSLog(@"Hello, World!"); + [pool drain]; + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-literal.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-literal.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-literal.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-literal.c Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file radar 5732232, 6034839 - blocks */ +/* APPLE LOCAL file radar 5732232, 6034839, 6230297 - blocks */ /* { dg-do compile } */ /* { dg-options "-fblocks" } */ @@ -27,7 +27,7 @@ /* { dg-error "blocks require" "" { target *-*-* } 26 } */ ; /* { dg-error "argument list is required for block expression literals" } */ - return ^{printf("\nBlock\n"); }; /* { dg-error "returning block that lives on the local stack" } */ + return ^{printf("\nBlock\n"); }; } void test2() { @@ -44,7 +44,8 @@ } void (^test3())(void) { - return ^{}; /* { dg-error "returning block that lives on the local stack" } */ + /* APPLE LOCAL radar 6230297 */ + return ^{}; } void test4() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-stack.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-stack.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-stack.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-stack.c Mon Nov 3 02:35:57 2008 @@ -1,8 +1,9 @@ -/* APPLE LOCAL file radar 5732232 - blocks */ +/* APPLE LOCAL file radar 5732232 - radar 6230297 - blocks */ /* { dg-do compile } */ /* { dg-options "-fblocks" } */ void (^test3())(void) { - return ^{}; /* { dg-error "returning block that lives on the local stack" } */ + __block int i; + return ^{i = 1; }; /* { dg-error "returning block that lives on the local stack" } */ } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-static-test.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-static-test.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-static-test.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-local-static-test.c Mon Nov 3 02:35:57 2008 @@ -2,6 +2,7 @@ /* local statics need be treated same as file static (byref). */ /* { dg-options "-mmacosx-version-min=10.6" { target *-*-darwin* } } */ /* { dg-do run } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-localisglobal.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-localisglobal.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-localisglobal.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-localisglobal.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,42 @@ +/* APPLE LOCAL file radar 6230297 */ +/* { dg-options "-mmacosx-version-min=10.6" { target *-*-darwin* } } */ +/* { dg-do run } */ + +/* + * localisglobal.c + * testObjects + * + * Created by Blaine Garst on 9/29/08. + * Copyright 2008 __MyCompanyName__. All rights reserved. + * + * works in all configurations + * CONFIG + * rdar://6230297 + */ + +#include + +void (^global)(void) = ^{ printf("hello world\n"); }; + +int aresame(void *first, void *second) { + long *f = (long *)first; + long *s = (long *)second; + return *f == *s; +} +int main(int argc, char *argv[]) { + int i = 10; + void (^local)(void) = ^ { printf("hi %d\n", i); }; + void (^localisglobal)(void) = ^ { printf("hi\n"); }; + + if (aresame(local, localisglobal)) { + printf("local block could be global, but isn't\n"); + return 1; + } + if (!aresame(global, localisglobal)) { + printf("local block is not global, not stack, what is it??\n"); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; + +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nested-block-var.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nested-block-var.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nested-block-var.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nested-block-var.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,32 @@ +/* APPLE LOCAL file radar 6225809 - radar 5847213 */ +/* __block var used in a nested block neeb be implicitly declared in + each intervening block. */ +/* { dg-options "-mmacosx-version-min=10.6 " { target *-*-darwin* } } */ +/* { dg-do run } */ + +#include + +static void Block_copy (void (^I)(void)) +{ + I(); +} + +int main(int argc, char *argv[]) { + __block int a = 42; + int save_a = a; // just to keep the address on the stack. + + void (^b)(void) = ^{ + Block_copy(^{ + a = 2; + }); + }; + + Block_copy(b); + + if(a == save_a) { + printf("**** __block heap storage should have been created at this point\n"); + return 1; + } + printf("%s: Success (old %d new %d)\n", argv[0], save_a, a); + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-no-block-def.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-no-block-def.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-no-block-def.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-no-block-def.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,7 @@ +/* APPLE LOCAL radar 6230656 */ +/* { dg-options "-fno-blocks" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +#if __block +#error +#endif Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ /* Test for generation of escape _Block_byref_release call when a local - __byref variable is copied in. */ + __block variable is copied in. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -13,7 +13,7 @@ static int count; static void _Block_byref_release(void * arg) { - ++count; + ++count; } void junk(void (^block)(void)) { @@ -21,16 +21,16 @@ } int test() { - int __byref i = 10; - void (^dummy)(void) = ^{ printf("i = %d\n", i); }; - junk(dummy); + { + int __block i = 10; + void (^dummy)(void) = ^{ printf("i = %d\n", i); }; + junk(dummy); + } return count; } -int main() -{ - if ( test() != 1) - abort(); - return 0; +int main() { + if ( test() != 1) + abort(); + return 0; } - Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-2.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ /* Test for generation of escape _Block_byref_release call when a local - __byref variable is copied in and block has a return statement. */ + __block variable is copied in and block has a return statement. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -21,9 +21,11 @@ } int test() { - int __byref i = 10; + { + int __block i = 10; int (^dummy)(void) = ^{ printf("i = %d\n", i); return i; }; junk(dummy); + } return count; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-3.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper-3.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,5 @@ /* APPLE LOCAL file radar 6083129 byref escapes */ -/* Test for generation of escape _Block_byref_release call when a __byref +/* Test for generation of escape _Block_byref_release call when a __block variable inside a block is declared and used. */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ @@ -21,7 +21,7 @@ } int test() { - void (^dummy)(void) = ^{ int __byref i = 10; printf("i = %d\n", i); }; + void (^dummy)(void) = ^{ int __block i = 10; printf("i = %d\n", i); }; junk(dummy); return count; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-noescape-helper.c Mon Nov 3 02:35:57 2008 @@ -19,9 +19,11 @@ } int test() { - int __byref i = 10; - void (^dummy)(void) = ^{ | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + { + int __block i = 10; + void (^dummy)(void) = ^{ ++i; }; junk(dummy); + } return count; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nullblockisa.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nullblockisa.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nullblockisa.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-nullblockisa.c Mon Nov 3 02:35:57 2008 @@ -5,13 +5,9 @@ #include #include -#define HASISA 1 - void check(void *ptr) { struct inner { -#if HASISA void* isa; // should be zero -#endif long forwarding; int flags; int size; @@ -19,20 +15,29 @@ // long disposehelper not needed int i; // }; +/* APPLE LOCAL begin radar 5847213 - radar 6329245 */ struct block_with_blocki { - long isa; - int flags; - int size; - long impl; - long copyhelper; - long destroyhelper; - struct inner *blocki; + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int Block_flags; + int reserved; + void *FuncPtr; + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + + // optional helper functions + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *src); + } *descriptor; + struct inner *blocki; } *block = (struct block_with_blocki *)ptr; +/* APPLE LOCAL end radar 5847213 - radar 6329245 */ + // sanity checks - if (block->size != sizeof(struct block_with_blocki)) { + if (block->descriptor->size != sizeof(struct block_with_blocki)) { // layout funny printf("layout is funny, struct size is %d vs runtime size %ld\n", - block->size, + (int)block->descriptor->size, sizeof(struct block_with_blocki)); exit(1); } @@ -41,12 +46,10 @@ block->blocki->size); exit(1); } -#if HASISA if (block->blocki->isa != (void*)NULL) { printf("not a NULL __block isa\n"); exit(1); } -#endif return; } Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-objectassign.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-objectassign.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-objectassign.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-objectassign.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,79 @@ +/* APPLE LOCAL file radar 6175959 */ +/* Test for generation of two new APIs; _Block_object_assign and _Block_object_dispose */ +/* { dg-options "-mmacosx-version-min=10.6 -fblocks" { target *-*-darwin* } } */ +/* { dg-do run } */ + +#include + +#define BLOCK_HAS_DESCRIPTOR (1 << 29) +#define BLOCK_HAS_COPY_DISPOSE (1 << 25) + +struct Block_descriptor { + unsigned long int reserved; + unsigned long int size; + void (*copy)(void *dst, void *src); + void (*dispose)(void *); +}; + +struct Block_layout { + void *isa; + int flags; + int reserved; + void (*invoke)(void *, ...); + struct Block_descriptor *descriptor; + // imported variables +}; + +int AssignCalled = 0; +int DisposeCalled = 0; + +// local copy instead of libSystem.B.dylib copy +void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { + printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); + AssignCalled = 1; +} + +void _Block_object_dispose(const void *object, const int isWeak) { + printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); + DisposeCalled = 1; +} + +struct MyStruct { + long isa; + long field; +}; + +typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; + +int main(int argc, char *argv[]) { + // create a block + struct MyStruct X; + MyStruct_t xp = (MyStruct_t)&X; + xp->field = 10; + void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; + // should be a copy helper generated with a calls to above routines + // Lets find out! + struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; + if ((bl->flags & BLOCK_HAS_DESCRIPTOR) != BLOCK_HAS_DESCRIPTOR) { + printf("using old runtime layout!\n"); + return 1; + } + if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { + printf("no copy dispose!!!!\n"); + return 1; + } + // call helper routines directly. These will, in turn, we hope, call the stubs above + long destBuffer[256]; + printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); + bl->descriptor->copy(destBuffer, bl); + bl->descriptor->dispose(bl); + if (AssignCalled == 0) { + printf("did not call assign helper!\n"); + return 1; + } + if (DisposeCalled == 0) { + printf("did not call dispose helper\n"); + return 1; + } + return 0; +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-printf-attribute-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-printf-attribute-1.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-printf-attribute-1.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-printf-attribute-1.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,15 @@ +/* APPLE LOCAL file radar 6246527 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +int main() +{ + void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = /* { dg-error "format string argument not a string type" } */ + ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; /* { dg-error "format string argument not a string type" } */ + void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {}; + + z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */ + z(1, "%s", "HELLO"); + +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgc.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgc.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgc.c Mon Nov 3 02:35:57 2008 @@ -25,8 +25,8 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block void (^local)(void); - int i = 10; - Henry = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + __block int i = 10; + Henry = ^ { ++i; }; local = Henry; if (GlobalInt2 == 1) { printf("%s: success\n", argv[0]); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgcivar.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgcivar.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgcivar.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-readweakgcivar.c Mon Nov 3 02:35:57 2008 @@ -30,10 +30,10 @@ int main(char *argc, char *argv[]) { // an object should not be retained within a stack Block - int i = 0; + __block int i = 0; void (^local)(void); Foo *foo = [[Foo alloc] init]; - foo->ivar = ^ { | i | ++i; }; /* { dg-warning "has been deprecated in blocks" } */ + foo->ivar = ^ { ++i; }; local = foo->ivar; if (GlobalInt2 == 1) { printf("%s: success\n", argv[0]); Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-sentinel-attribute.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-sentinel-attribute.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-sentinel-attribute.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-sentinel-attribute.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,28 @@ +/* APPLE LOCAL file radar 6246527 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ +#include + +void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1))); +void (^e1) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1, 3))); /* { dg-error "wrong number of arguments" "sentinel" } */ + +int main() +{ + void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = + ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {}; + void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; + + + void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; + + b(1, "%s", NULL); // OK + b(1, "%s", 0); /* { dg-warning "missing sentinel in function call" } */ + z(1, "%s",4 ,1,0); /* { dg-warning "missing sentinel in function call" } */ + z(1, "%s", NULL, 1, 0); // OK + + y(1, "%s", 1,2,3,4,5,6,7); /* { dg-warning "missing sentinel in function call" } */ + + y(1, "%s", NULL,3,4,5,6,7); // OK + +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-parameter.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-parameter.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-parameter.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-parameter.c Mon Nov 3 02:35:57 2008 @@ -5,8 +5,8 @@ int main() { - int i = 1; - ^ { |i| i = 1; return i; }; /* { dg-warning "has been deprecated in blocks" } */ + __block int i = 1; + ^ { i = 1; return i; }; return 0; } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-warn.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-warn.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-warn.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/block-unused-warn.c Mon Nov 3 02:35:57 2008 @@ -5,10 +5,10 @@ int main() { -int x = 10; +__block int x = 10; int y = 1; -int (^myBlock)(void) = ^{ |x| return x+y; }; /* { dg-warning "has been deprecated in blocks" } */ +int (^myBlock)(void) = ^{ return x+y; }; myBlock(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* Developed by Ziemowit Laski . */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-fconstant-cfstrings" } */ typedef const struct __CFString *CFStringRef; Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,35 @@ +/* APPLE LOCAL file, Radar 6275985 */ +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-options "-g -dA -save-temps -mmacosx-version-min=10.6" } */ +/* { dg-final { scan-assembler "__debug_inlined" } } */ +/* { dg-final { scan-assembler "\[#;@]\[ \t]+MIPS linkage name: \"getData\"" } } */ +/* { dg-final { scan-assembler "\[#;@]\[ \t]+Function name: \"getData\"" } } */ +/* { dg-final { scan-assembler "\[#;@]\[ \t]+MIPS linkage name: \"get_length\"" } } */ +/* { dg-final { scan-assembler "\[#;@]\[ \t]+Function name: \"get_length\"" } } */ + +#include +#include + +struct mystruct { + int data; +}; + +int globl; + +static __inline__ __attribute__((always_inline)) getData (struct mystruct *a) { + return a->data * globl; +} + +#include "debug-inlined-section.h" + + +main (int argc, char **argv) +{ + struct mystruct c; + c.data = argc; + globl = c.data; +// globl = getData (&c); + int b = get_length (&c); + printf ("%d\n", b); + return (c.data); +} Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.h?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.h (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/debug-inlined-section.h Mon Nov 3 02:35:57 2008 @@ -0,0 +1,15 @@ +/* APPLE LOCAL file, Radar 6275985 */ + +extern int globl; + +static __inline__ __attribute__((always_inline)) get_length (struct mystruct *d) { + if (globl && malloc (globl)) + { + return getData (d) + globl; + } + else + return getData (d) * globl; +} + +extern int globl; + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-1.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* Test default cpu type */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* This test doesn't make sense on 64-bit */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mmacosx-version-min=10.5" } */ int main() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-cpu-2.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* Test default cpu type */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* This test doesn't make sense on 64-bit darwin. */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mmacosx-version-min=10.4" } */ int main() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-x86_32-sse3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-x86_32-sse3.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-x86_32-sse3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/default-x86_32-sse3.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4515157 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } } */ +/* { dg-require-effective-target ilp32 } */ /* Ensure that 32-bit x86 does not imply -msse3 on Darwin/x86. */ #ifdef __SSE3__ #error "SSE3 should be disabled by default for x86 -m32" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/dynamic-no-pic-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/dynamic-no-pic-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/dynamic-no-pic-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/dynamic-no-pic-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file Radar 4010664 */ /* { dg-do compile { target i?86*-*-darwin* } } */ -/* { dg-skip-if "" { i?86*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mdynamic-no-pic -march=pentium4" } */ /* { dg-final { scan-assembler-not "86.get_pc_thunk" } } */ #define TEST_STRING "test string %d" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-att-stub-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-att-stub-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-att-stub-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-att-stub-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file Radar 4164563 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL axe stubs 5571540 */ /* { dg-options "-matt-stubs -mmacosx-version-min=10.4" } */ /* { dg-final { scan-assembler "hlt" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,8 @@ /* APPLE LOCAL file radar 4645709 */ /* { dg-do compile { target "i?86-*-*" } } */ /* { dg-options "-O2" } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ +/* LLVM LOCAL */ /* { dg-final { scan-assembler "and.*(0xffffff00|4294967040)" } } */ unsigned char lut[256]; /* LLVM LOCAL make these global */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-deep-branch-predict-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-deep-branch-predict-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-deep-branch-predict-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-deep-branch-predict-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file Radar 4010498 et. al. */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-march=pentium4 -fPIC" } */ /* { dg-final { scan-assembler "86.get_pc_thunk" } } */ #define TEST_STRING "test string %d" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-regparmandstackparm-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-regparmandstackparm-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-regparmandstackparm-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-regparmandstackparm-1.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 420513 */ /* { dg-do compile { target i?86-*-* } } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O2" } */ /* Look for both entry points to the regparmandstackparm function. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-ssetype-6.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-ssetype-6.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-ssetype-6.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-ssetype-6.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4099020 */ /* { dg-do compile { target i?86-*-* } } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O2 -msse2 -march=pentium4" } */ /* { dg-final { scan-assembler-times "movq\[^\\n\]*" 3} } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-unaligned-movaps.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-unaligned-movaps.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-unaligned-movaps.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-unaligned-movaps.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL begin radar 4614623 */ /* { dg-do run { target i?86-*-* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O -mmmx -fomit-frame-pointer -march=pentium-m" } */ #include extern void abort (void); Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/longcall-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/longcall-2.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/longcall-2.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/longcall-2.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,27 @@ +/* Verify that switch tables aren't fundamentally broken with + -mlongcall. */ +/* { dg-options "-mlongcall" } */ +/* { dg-do run } */ + +int val = 3; + +int main (void) +{ + switch (val) + { + case 0: + return 1; + case 1: + return 2; + case 2: + return 4; + case 3: + return 0; + case 4: + return 8; + case 5: + return 16; + } + return 32; +} + Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/no-nested-deprecated-warn.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/no-nested-deprecated-warn.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/no-nested-deprecated-warn.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/no-nested-deprecated-warn.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,19 @@ +/* APPLE LOCAL file radar 4746503 */ +/* Don't issue 'deprecated' warning in a function which itself is deprecated. */ + +extern void foo() __attribute__((deprecated)); +extern void bar() __attribute__((deprecated)); + +void foo() {} + +void bar() { + foo(); +} + + +void gorf() { + foo(); /* { dg-warning "\\'foo\\' is deprecated" } */ + bar(); /* { dg-warning "\\'bar\\' is deprecated" } */ +} + + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/opt-size-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/opt-size-2.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/opt-size-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/opt-size-2.c Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file 4231773 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-Oz -static" } */ /* { dg-final { scan-assembler "\tincl?\[ \]*_?global_x" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/r6292557.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/r6292557.c?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/r6292557.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/r6292557.c Mon Nov 3 02:35:57 2008 @@ -0,0 +1,73 @@ +/* APPLE LOCAL begin radar 6292557 (copied from gcc.dg/i386-lshiftrt-1.c) */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-g -O2 -msse" } */ +/* { dg-final { scan-assembler "__debug_inlined" } } */ + +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +typedef __v2di __m128i; +typedef __v2df __m128d; + +static inline __m128i __attribute__((__always_inline__, __nodebug__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); +} + + +static inline __m128i __attribute__((__always_inline__, __nodebug__)) +_mm_load_si128 (__m128i const *__P) +{ + return *__P; +} + +static inline __m128i __attribute__((__always_inline__, __nodebug__)) +_mm_or_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); +} +static inline __m128i __attribute__((__always_inline__, __nodebug__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); +} +static inline int __attribute__((__always_inline__, __nodebug__)) +_mm_cvtsi128_si32 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0); +} +void FUNC( unsigned char const* pixPtr) +{ + + __m128i vu16YPredictionHi, vu16YPredictionLo; + + __m128i vu16YPrediction3; + __m128i vtemp0, vtemp1, vtemp2, vtemp3; + + vtemp2 = ((__m128i)__builtin_ia32_pslldqi128 (vu16YPrediction3, (4) * 8)); + vtemp2 = ((__m128i)__builtin_ia32_psrldqi128 (vtemp2, (8) * 8)); + vtemp3 = ((__m128i)__builtin_ia32_psrldqi128 (vu16YPrediction3, (6) * 8)); + vtemp3 = ((__m128i)__builtin_ia32_pslldqi128 (vtemp3, (8) * 8)); + + vu16YPredictionLo = _mm_or_si128(vtemp2, vtemp3); + + __m128i vs16YResidualHi, vs16YResidualLo, vs16YResultHi, vs16YResultLo; + __m128i vu8YResult; + unsigned int itemp0, itemp1, itemp2, itemp3; + vs16YResultHi = _mm_add_epi16(vu16YPredictionHi, vs16YResidualHi); + vs16YResultLo = _mm_add_epi16(vu16YPredictionLo, vs16YResidualLo); + vu8YResult = _mm_packus_epi16(vs16YResultHi, vs16YResultLo); + itemp0 = _mm_cvtsi128_si32(vu8YResult); + vu8YResult = ((__m128i)__builtin_ia32_psrldqi128 (vu8YResult, (4) * 8)); + itemp1 = _mm_cvtsi128_si32(vu8YResult); + vu8YResult = ((__m128i)__builtin_ia32_psrldqi128 (vu8YResult, (4) * 8)); + itemp2 = _mm_cvtsi128_si32(vu8YResult); + vu8YResult = ((__m128i)__builtin_ia32_psrldqi128 (vu8YResult, (4) * 8)); + itemp3 = _mm_cvtsi128_si32(vu8YResult); + *(unsigned int*)pixPtr = itemp0; +} +/* APPLE LOCAL end radar 4266982 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/_Pragma3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/_Pragma3.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/_Pragma3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/_Pragma3.c Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-do preprocess } */ /* Pragma buffers have a NULL "inc" member, which we would dereference - when getting a file's date and time. + when getting a file's date and time. Based on PR 7526. 14 Aug 2002. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/4891561.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/4891561.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/4891561.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/4891561.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* APPLE LOCAL file radar 4891561 */ /* { dg-do compile { target i?86-*-darwin* } } */ /* { dg-options "-O1 -std=gnu99 -fno-inline -fschedule-insns -mtune=pentium-m" } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ static inline unsigned char ceq (unsigned char a, unsigned char b) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/reload-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/reload-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/reload-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/reload-1.c Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-options "-O3 -msse2 -fdump-rtl-csa" } */ /* LLVM LOCAL fdump not supported */ /* { dg-require-fdump "" } */ -/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-final { scan-rtl-dump "deleted 5 dead insns" "csa" } }*/ #include typedef __SIZE_TYPE__ size_t; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/stack-prot-kernel.c Mon Nov 3 02:35:57 2008 @@ -1,5 +1,6 @@ /* { dg-do compile { target lp64 } } */ -/* { dg-skip-if "darwin x86_64 is pic" { *-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL 64 bit default */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-O2 -fstack-protector-all -mcmodel=kernel" } */ void test1 (int x) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c Mon Nov 3 02:35:57 2008 @@ -1,7 +1,8 @@ /* Check that sizeof(bool) is 4 if we don't use special options. */ /* Matt Austern */ /* { dg-do run { target powerpc*-*-darwin* } } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL 64 bit default */ +/* { dg-require-effective-target ilp32 } */ int dummy1[sizeof(_Bool) - 3]; int dummy2[5 - sizeof(_Bool)]; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c Mon Nov 3 02:35:57 2008 @@ -233,7 +233,7 @@ D(600) /* LLVM LOCAL */ D(601) D(602) - if (num_failed) + if (num_failed) abort (); return 0; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/bitfield-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-1.mm Mon Nov 3 02:35:57 2008 @@ -8,7 +8,7 @@ /* { dg-options "-Wpadded -Wabi" } */ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM objc2 */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/bitfield-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/bitfield-4.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-lobjc -Wpadded" } */ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM objc2 */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cond-expr-warn.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/cond-expr-warn.mm?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cond-expr-warn.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cond-expr-warn.mm Mon Nov 3 02:35:57 2008 @@ -0,0 +1,10 @@ +/* APPLE LOCAL file radar 6231433 */ +/* { dg-do compile } */ + + at interface NSKey @end + at interface UpdatesList @end + +void foo (int i, NSKey *NSKeyValueCoding_NullValue, UpdatesList *nukedUpdatesList) +{ + i ? NSKeyValueCoding_NullValue : nukedUpdatesList; /* { dg-warning "conditional expression" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-cfstring-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-cfstring-4.mm Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fconstant-cfstrings" } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ typedef const struct __CFString * CFStringRef; CFStringRef appKey = (CFStringRef) @"com.apple.soundpref"; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-10.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-10.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-11.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-11.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -fconstant-string-class=XStr" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-12.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-12.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-12.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-12.mm Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fno-constant-cfstrings -fconstant-string-class=Foo" } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-13.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-13.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-13.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-13.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-fno-constant-cfstrings -fwritable-strings -fconstant-string-class=Foo -mmacosx-version-min=10.4" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fno-constant-cfstrings -fwritable-strings -fconstant-string-class=Foo" { target arm*-*-darwin* } } */ /* { dg-do run { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/const-str-9.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/const-str-9.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ /* APPLE LOCAL ARM radar 5804096 */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/cxx-ivars-3.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ // APPLE LOCAL radar 4842158 // { dg-options "-fnext-runtime -mmacosx-version-min=10.3" } /* APPLE LOCAL radar 4280641 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/debug-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* Tesst debug info for virtual base class. */ /* { dg-do compile } */ /* { dg-options "-gstabs+ -gfull" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* LLVM LOCAL llvm doesn't currently support stabs. */ /* { dg-require-stabs "" } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/defs-warn-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs-warn-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-options "-lobjc -Wobjc2" } */ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM objc2 */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/defs.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/defs.mm Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-lobjc" } */ /* { dg-do run } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM objc2 */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/layout-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/layout-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/layout-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/layout-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-Wpadded -Wpacked -Wabi" } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/method-11.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-11.mm Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fnext-runtime" } */ /* { dg-do compile } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM objc2 */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-type-attribute.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/method-type-attribute.mm?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-type-attribute.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/method-type-attribute.mm Mon Nov 3 02:35:57 2008 @@ -0,0 +1,12 @@ +/* APPLE LOCAL file radar 6261630 */ +/* Test use of trailing attribute in a method return type. */ +/* { dg-options "-fobjc-gc" } */ +/* { dg-do compile { target *-*-darwin* } } */ + + at interface INTF +- (const char * __attribute__((objc_gc(strong))))encoding; +- (id __strong)encoding1; +- (const char * __weak)encoding2; +- (const char ** __strong)encoding3; + at end + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-fast-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wassign-intercept" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-fast-2.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-2.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-fast-3.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-3.mm Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-fast-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fast-4.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ with -O0, so the sibcall case cannot occur. */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-O0 -fobjc-direct-dispatch" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fpret-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-fpret-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fpret-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-fpret-1.mm Mon Nov 3 02:35:57 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL begin radar 4280641 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* APPLE LOCAL 64 bit default */ +/* { dg-require-effective-target ilp32 } */ #include @interface Example : Object Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-1.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* A compile-only test for insertion of write barriers. */ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -Wassign-intercept" } */ /* { dg-require-effective-target objc_gc } */ #ifndef __OBJC_GC__ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-2.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-2.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* A compile-only test for insertion of write barriers. */ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -Wassign-intercept" } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-4.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-do run { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -mmacosx-version-min=10.3" } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-8.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-8.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-8.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-8.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Do _not_ generate write barriers for global function pointers, even ones returning 'id'. */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -Wassign-intercept" } */ /* { dg-require-effective-target objc_gc } */ /* APPLE LOCAL radar 4894756 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-section-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ with flag of 0 */ /* { dg-do compile } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ @interface INTF Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-section-2.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-section-2.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Check that -fobjc-gc-only option produces a 110 flag in objc section. */ /* { dg-options "-fobjc-gc-only" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ @interface INTF Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-weak-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-gc-weak-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-weak-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-gc-weak-1.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* A run-time test for insertion of write barriers for __weak objects. */ /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign" } */ /* { dg-require-effective-target objc_gc } */ #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-property-enumtype.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-property-enumtype.mm?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-property-enumtype.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-property-enumtype.mm Mon Nov 3 02:35:57 2008 @@ -0,0 +1,62 @@ +/* APPLE LOCAL file radar 6264448 */ +/* Test that property of enum types don't cause error + when setter call is generated. */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-options "-framework Foundation -Werror" } */ + +#import + +enum TimeType { + TimeTypeZero = 0, + TimeTypeOne = 1, + TimeTypeTwo = 2 +}; + +typedef enum TimeType TimeType; + + + at interface A : NSObject { + TimeType tt; +} + + at property (nonatomic) TimeType tt; + + at end + + at interface B : NSObject { + TimeType tt; +} + + at property (nonatomic) TimeType tt; + + at end + + at implementation A + + at synthesize tt; + + at end + + at implementation B + + at synthesize tt; + + at end + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + A* a = [[A alloc] init]; + B* b = [[B alloc] init]; + + a.tt = TimeTypeOne; + // failure here: + b.tt = a.tt; + + b.tt = [a tt]; + + [b setTt: [a tt]]; + + [pool drain]; + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-stret-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-stret-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-stret-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-stret-1.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ that is memory bound, we still generate objc_msgSend_stret for all platforms. */ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4492976 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ @interface Joiner { } Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc-visibility-hidden-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Test for visibility 'hidden' flag inserted in 32bit objc class's meta-data. */ /* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ __attribute__((visibility("hidden"))) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-protocol-1.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-1.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Protocol meta-data for protocol used in @protocol expression must be generated. */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -15,6 +15,6 @@ return (long) @protocol(Proto1); } /* LLVM LOCAL begin accept llvm syntax */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ /* { dg-final { scan-assembler-not ".*_OBJC_PROTOCOL_\\\$_Proto2" } } */ -/* LLVM LOCAL end */ \ No newline at end of file +/* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-protocol-2.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-2.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Check for generation of protocol meta-data */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -12,6 +12,6 @@ @interface Super { id isa; } @end @implementation Super @end /* LLVM LOCAL begin llvm syntax */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ /* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-protocol-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-4.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 5465109 */ +/* APPLE LOCAL file 5465109 - modified for radar 6255913 */ /* The following test program should emit metadata for _OBJC_PROTOCOL_$_Proto2 and _OBJC_PROTOCOL_$__Proto1. This root emits both protocols and puts them both in __protocol_list. @@ -21,6 +21,6 @@ return (long)@protocol(Proto2); } /* LLVM LOCAL begin llvm syntax */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ /* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-5.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-protocol-5.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-5.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-5.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -14,4 +14,4 @@ return (long) @protocol(Proto1); } /* LLVM LOCAL llvm syntax */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-9.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-protocol-9.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-9.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-protocol-9.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Cechk that both protocols metadata generated for them. */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -19,6 +19,6 @@ @implementation Foo (Category) @end /* LLVM LOCAL begin accept llvm syntax */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_.*OBJC_PROTOCOL_\\\$_Proto2:" } } */ /* LLVM LOCAL end */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-missing-comma.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-missing-comma.mm?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-missing-comma.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-missing-comma.mm Mon Nov 3 02:35:57 2008 @@ -0,0 +1,16 @@ +/* APPLE LOCAL file radar 6302949 */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ +/* { dg-do compile } */ + + at interface BadPropClass // : NSObject +{ + int _awesome; +} + + at property (readonly) int hello; + at property (nonatomic readonly, getter=isAwesome) int _awesome; /* { dg-warning " property attributes must be separated by a comma" } */ + at property (nonatomic, readonly, getter=isAwesome) int _anew; + at property (nonatomic, readonly, getter=isAwesome) int _anew1; + + at end + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-neg-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-neg-3.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-neg-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-neg-3.mm Mon Nov 3 02:35:57 2008 @@ -1,8 +1,6 @@ /* APPLE LOCAL file radar 4436866 */ /* Check for proper declaration of @property. */ -/* APPLE LOCAL radar 4899595 */ -/* { dg-options "-fno-objc-new-property -mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fno-objc-new-property" { target arm*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.5" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @interface Bar Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/sync-objc-exception.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/sync-objc-exception.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/sync-objc-exception.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/sync-objc-exception.mm Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fobjc-exceptions -Os -Wextra -Werror" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ struct MyPoint { int x; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-7.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/syntax-error-7.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-7.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-7.mm Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL begin radar 4290840 */ +/* APPLE LOCAL file radar 4290840 - Modified for radar 6271728 */ /* { dg-do compile } */ @interface Foo @@ -8,7 +8,7 @@ @implementation Foo -(void) -(void) someMethod /* { dg-error "expected before .-." } */ + /* { dg-error "expected" "" { target *-*-* } 10 } */ { } @end -/* APPLE LOCAL end radar 4290840 */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-9.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/syntax-error-9.mm?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-9.mm (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/syntax-error-9.mm Mon Nov 3 02:35:57 2008 @@ -0,0 +1,9 @@ +/* APPLE LOCAL file radar 6271728 */ +/* Check for error reporting of bad method definition. */ + at interface MyClass + at end + + + at implementation MyClass +- (void) ni + at end /* { dg-error "expected `\{' before \\'end\\'" } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/template-4.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/template-4.mm Mon Nov 3 02:35:57 2008 @@ -6,7 +6,7 @@ /* APPLE LOCAL Radar 5706927 */ /* { dg-do run { target powerpc*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/try-catch-20.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/try-catch-20.mm?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/try-catch-20.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/try-catch-20.mm Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ all uncaught exceptions. */ /* { dg-options "-fobjc-exceptions" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-do run } */ extern "C" void abort (void); Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6255801.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6255801.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6255801.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6255801.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,6 @@ +/* APPLE LOCAL file 6255801 */ +/* { dg-do compile { target *-*-darwin* } } */ + at interface Foo @end + at implementation Foo @end +/* Any alignment above ".align 3" (=64-bit) is too much. */ +/* { dg-final { scan-assembler-not "\.align\[\t \]+\[4-9\]" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6311054.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6311054.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6311054.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6311054.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,16 @@ +/* APPLE LOCAL file 6311054 */ +/* { dg-do compile } */ +/* { dg-options { -fPIC -quiet -mfix-and-continue -m64 -mmacosx-version-min=10.5 } } */ +typedef unsigned char uint8_t; +typedef unsigned int uint32_t; +static const uint8_t kObfuscationKey[] = { + 0x7d, 0x89, 0x52, 0x23, 0xd2, 0xbc, 0xdd, 0xea, 0xa3, 0xb9, 0x1f }; +void obfuscate( void *buffer, uint32_t bufferLength ) { + uint8_t *pBuf = (uint8_t *) buffer; + const uint8_t *pKey = kObfuscationKey, *eKey = pKey + sizeof( kObfuscationKey ); + while ( bufferLength-- ) { + *pBuf = *pBuf ^ *pKey; + ++pKey; + if ( pKey == eKey ) pKey = kObfuscationKey; + } +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-3.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-lobjc -Wpadded" } */ /* { dg-do run } */ /* APPLE LOCAL begin objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL end objc2 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/bitfield-5.m Mon Nov 3 02:35:57 2008 @@ -7,7 +7,7 @@ /* { dg-options "-Wpadded" } */ /* { dg-do run } */ /* APPLE LOCAL begin objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL end objc2 */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/cond-expr-warn.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/cond-expr-warn.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/cond-expr-warn.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/cond-expr-warn.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,10 @@ +/* APPLE LOCAL file radar 6231433 */ +/* { dg-do compile } */ + + at interface NSKey @end + at interface UpdatesList @end + +void foo (int i, NSKey *NSKeyValueCoding_NullValue, UpdatesList *nukedUpdatesList) +{ + i ? NSKeyValueCoding_NullValue : nukedUpdatesList; /* { dg-warning "conditional expression" } */ +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-4.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-cfstring-4.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fconstant-cfstrings" } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ typedef const struct __CFString * CFStringRef; static CFStringRef appKey = (CFStringRef) @"com.apple.soundpref"; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-10.m Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* APPLE LOCAL file 4149909 */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-11.m Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* APPLE LOCAL file 4149909 */ /* { dg-options "-fnext-runtime -fno-constant-cfstrings -fconstant-string-class=XStr" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-12.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-12.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-12.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-12.m Mon Nov 3 02:35:57 2008 @@ -1,7 +1,7 @@ /* { dg-options "-Wall -funit-at-a-time -fgnu-runtime" } */ /* { dg-do compile } */ /* APPLE LOCAL objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* PR objc/27438, make sure that the decl produced by the front-end does not cause a warning to be produced. */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-13.m Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ /* { dg-options "-fno-constant-cfstrings -fwritable-strings -fconstant-string-class=Foo -mmacosx-version-min=10.4" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fno-constant-cfstrings -fwritable-strings -fconstant-string-class=Foo" { target arm*-*-darwin* } } */ /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-6.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-6.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-6.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/const-str-6.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fno-constant-cfstrings -fconstant-string-class=MyConstantString" } */ /* { dg-do compile } */ /* APPLE LOCAL objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ @interface MyBase { char p; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs-warn-1.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Issue warning wherevr @defs is used. */ /* { dg-options "-lobjc -Wobjc2" } */ /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/defs.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-lobjc" } */ /* { dg-do run } */ /* APPLE LOCAL begin objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL end objc2 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7a.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7a.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7a.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/encode-7a.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-do run { target *-*-darwin* } } */ /* { dg-options "-fnext-runtime" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/image-info.m Mon Nov 3 02:35:57 2008 @@ -6,7 +6,7 @@ /* APPLE LOCAL ARM objc2 */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #ifndef __NEXT_RUNTIME__ #error Feature not currently supported by the GNU runtime Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/layout-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/layout-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/layout-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/layout-1.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-Wpadded -Wpacked" } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/method-4.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* { dg-options "-fnext-runtime" } */ /* { dg-do compile } */ /* APPLE LOCAL begin objc2 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ /* APPLE LOCAL end objc2 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/next-runtime-1.m Mon Nov 3 02:35:57 2008 @@ -7,7 +7,7 @@ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fnext-runtime" } */ /* APPLE LOCAL 64-bit 4492976 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-dir-dispatch.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-dir-dispatch.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-dir-dispatch.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-dir-dispatch.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ -mmacosx-version-min=10.4. */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-mmacosx-version-min=10.4" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-1.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wassign-intercept" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-2.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-3.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-3.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-4.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fast-4.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* APPLE LOCAL ObjC direct dispatch */ /* { dg-options "-O0 -fobjc-direct-dispatch -fnext-runtime" } */ -/* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* Radar 4015820 */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-1.m Mon Nov 3 02:35:57 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL begin radar 4280641 */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include @interface Example : Object Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-fpret-2.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" } */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ @interface Test @end @implementation Test Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-1.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* A compile-only test for insertion of write barriers. */ /* Developed by Ziemowit Laski */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -Wassign-intercept" } */ /* { dg-require-effective-target objc_gc } */ #ifndef __OBJC_GC__ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-2.m Mon Nov 3 02:35:57 2008 @@ -2,9 +2,9 @@ /* A run-time test for insertion of write barriers. */ /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc" } */ -/* { dg-options "-fnext-runtime -fobjc-gc -mmacosx-version-min=10.3" { target powerpc*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -mmacosx-version-min=10.3" { target powerpc*-*-darwin* } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-7.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-7.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-7.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-7.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Do _not_ generate write barriers for global function pointers, even ones returning 'id'. */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign -Wassign-intercept" } */ /* { dg-require-effective-target objc_gc } */ /* APPLE LOCAL radar 4894756 */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-lvalue-cast-warn.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-lvalue-cast-warn.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-lvalue-cast-warn.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-lvalue-cast-warn.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,11 @@ +/* APPLE LOCAL file radar 6269491 */ +/* Test that lvalue cast with -fobjc-gc also results in a warning. */ +/* { dg-options "-fobjc-gc" } */ + + at interface I @end + +void foo(I* pI) +{ + (id) pI = 0; /* { dg-warning "target of assignment not really an lvalue" } */ +} + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-1.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ with flag of 0 */ /* { dg-do compile } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ @interface INTF Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-section-2.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Check that -fobjc-gc-only option produces a 110 flag in objc section. */ /* { dg-options "-fobjc-gc-only" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target objc_gc } */ @interface INTF Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-weak-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-weak-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-weak-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-gc-weak-1.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* A run-time test for insertion of write barriers for __weak objects. */ /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-options "-fnext-runtime -fobjc-gc" } */ +/* { dg-options "-fnext-runtime -fobjc-gc -Wno-non-lvalue-assign" } */ /* { dg-require-effective-target objc_gc } */ #include Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-property-enumtype.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-property-enumtype.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-property-enumtype.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-property-enumtype.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,62 @@ +/* APPLE LOCAL file radar 6264448 */ +/* Test that property of enum types don't cause error + when setter call is generated. */ +/* { dg-do run { target *-*-darwin* } } */ +/* { dg-options "-framework Foundation -Werror" } */ + +#import + +enum TimeType { + TimeTypeZero = 0, + TimeTypeOne = 1, + TimeTypeTwo = 2 +}; + +typedef enum TimeType TimeType; + + + at interface A : NSObject { + TimeType tt; +} + + at property (nonatomic) TimeType tt; + + at end + + at interface B : NSObject { + TimeType tt; +} + + at property (nonatomic) TimeType tt; + + at end + + at implementation A + + at synthesize tt; + + at end + + at implementation B + + at synthesize tt; + + at end + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + A* a = [[A alloc] init]; + B* b = [[B alloc] init]; + + a.tt = TimeTypeOne; + // failure here: + b.tt = a.tt; + + b.tt = [a tt]; + + [b setTt: [a tt]]; + + [pool drain]; + return 0; +} Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Test for visibility 'hidden' flag inserted in 32bit objc class's meta-data. */ /* { dg-options "-mmacosx-version-min=10.5" } */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ __attribute__((visibility("hidden"))) @interface Foo { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-alignment-test-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-alignment-test-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-alignment-test-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-alignment-test-1.m Mon Nov 3 02:35:57 2008 @@ -2,7 +2,7 @@ /* Test that alignment of __class_list sections, among others, are at their 'natural' alignment on x86. */ /* { dg-do compile { target i?86-*-darwin* } } */ -/* { dg-skip-if "" { i?86-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" } */ @interface c1 @end @@ -39,4 +39,4 @@ /* LLVM LOCAL begin accept llvm syntax */ /* { dg-final { scan-assembler "\t.align( |\t)2\nL_OBJC_LABEL_CLASS_\\\$:" } } */ /* { dg-final { scan-assembler "\t.align( |\t)2\nL_OBJC_LABEL_NONLAZY_CLASS_\\\$:" } } */ -/* LLVM LOCAL end */ \ No newline at end of file +/* LLVM LOCAL end */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-newmetadata-sections.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-newmetadata-sections.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-newmetadata-sections.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-newmetadata-sections.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,12 @@ +/* APPLE LOCAL file radar 6255595 */ +/* Check for generation of new sections for objc2 meta-data. */ +/* { dg-options "-fobjc-abi-version=2 -mmacosx-version-min=10.6" } */ +/* { dg-do compile */ + at protocol PROTO + at end + + at interface INTF @end + + at implementation INTF @end +/* { dg-final { scan-assembler ".section __DATA, __objc_const" } } */ +/* { dg-final { scan-assembler ".section __DATA, __objc_data" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-property-typedefprotocol.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-property-typedefprotocol.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-property-typedefprotocol.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-property-typedefprotocol.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,10 @@ +/* APPLE LOCAL file radar 6267049 */ +typedef int MyTypedef; + + at interface MyClass + + at property MyTypedef myProperty; /* { dg-error "qualified type is not a valid object" } */ + /* { dg-error "cannot find protocol declaration for \\'Gobbledygook\\'" "" { target *-*-* } 6 } */ + + at end + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-1.m Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Protocol meta-data for protocol used in @protocol expression must be generated. */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -14,5 +14,5 @@ int main() { return (long) @protocol(Proto1); } -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto1:" } } */ /* { dg-final { scan-assembler-not "_OBJC_PROTOCOL_\\\$_Proto2" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-2.m Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Check for generation of protocol meta-data */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -11,5 +11,5 @@ @interface Super { id isa; } @end @implementation Super @end -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto2:" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-4.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-4.m Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 5465109 */ +/* APPLE LOCAL file 5465109 - modified for radar 6255913 */ /* The following test program should emit metadata for _OBJC_PROTOCOL_$_Proto2 and _OBJC_PROTOCOL_$__Proto1. This root emits both protocols and puts them both in __protocol_list. @@ -20,5 +20,5 @@ { return (long)@protocol(Proto2); } -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto2:" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-5.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-5.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-5.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-5.m Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -13,4 +13,4 @@ int main() { return (long) @protocol(Proto1); } -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto1:" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-9.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-9.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-9.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-protocol-9.m Mon Nov 3 02:35:57 2008 @@ -1,4 +1,4 @@ -/* APPLE LOCAL file 4695109 */ +/* APPLE LOCAL file 4695109 - modified for radar 6255913 */ /* Cechk that both protocols metadata generated for them. */ /* { dg-options "-mmacosx-version-min=10.5 -fobjc-abi-version=2" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ @@ -18,5 +18,5 @@ @implementation Foo (Category) @end -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto1:" } } */ -/* { dg-final { scan-assembler "L_OBJC_PROTOCOL_\\\$_Proto2:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto1:" } } */ +/* { dg-final { scan-assembler "l_OBJC_PROTOCOL_\\\$_Proto2:" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-sendsuper_msg.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-sendsuper_msg.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-sendsuper_msg.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/objc2-sendsuper_msg.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,14 @@ +/* APPLE LOCAL file radar 6252174 */ +/* { dg-options "-m64 -mmacosx-version-min=10.6" } */ +/* { dg-do compile { target *-*-darwin* } } */ + + at interface NSObject +-method; + at end + + at interface Sub : NSObject @end + + at implementation Sub +-method { [super method]; } + at end +/* { dg-final { scan-assembler-not ".section __DATA, __objc_msgrefs, coalesced\n\t.align 4\n\tl_objc_msgSendSuper2_fixup_method" } } */ Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-missing-comma.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-missing-comma.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-missing-comma.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-missing-comma.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,19 @@ +/* APPLE LOCAL file radar 6302949 */ +/* { dg-options "-mmacosx-version-min=10.5" { target *-*-darwin* } } */ +/* { dg-do compile } */ + + at interface BadPropClass // : NSObject +{ + int _awesome; +} + + at property (readonly) int hello; + at property (nonatomic readonly /* { dg-warning " property attributes must be separated by a comma" } */ + getter=isAwesome) int _awesome; /* { dg-warning " property attributes must be separated by a comma" } */ + at property (nonatomic, readonly, + getter=isAwesome) int _anew; + at property (nonatomic, readonly, + getter=isAwesome) int _anew1; + + at end + Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/selector-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/selector-3.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/selector-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/selector-3.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-options "-Wselector -fgnu-runtime" } */ /* { dg-do compile } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ typedef struct objc_object { struct objc_class *class_pointer; } *id; typedef const struct objc_selector *SEL; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/special/unclaimed-category-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/special/unclaimed-category-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/special/unclaimed-category-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/special/unclaimed-category-1.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ #include #include /* APPLE LOCAL radar file 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ extern void abort (void); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stret-2.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* Contributed by Ziemowit Laski . */ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4492976 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/symtab-1.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-options "-fnext-runtime" } */ /* { dg-do compile { target *-*-darwin* } } */ /* APPLE LOCAL radar 4492976 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* APPLE LOCAL ARM not available on arm-darwin targets */ /* { dg-skip-if "" { arm*-*-darwin* } { "*" } { "" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/sync-objc-exception.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/sync-objc-exception.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/sync-objc-exception.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/sync-objc-exception.m Mon Nov 3 02:35:57 2008 @@ -5,7 +5,7 @@ */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-fobjc-exceptions -Os -Wextra -Werror" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ struct MyPoint { int x; }; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-15.m Mon Nov 3 02:35:57 2008 @@ -6,7 +6,7 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* APPLE LOCAL begin radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include "../objc/execute/Object2.h" /* APPLE LOCAL end radar 4894756 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-17.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-17.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-17.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/try-catch-17.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ all uncaught exceptions. */ /* { dg-options "-fobjc-exceptions" } */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ /* { dg-do run } */ #include "../objc/execute/Object2.h" Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/unimplemented-anon-category.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/unimplemented-anon-category.m?rev=58601&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/unimplemented-anon-category.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/unimplemented-anon-category.m Mon Nov 3 02:35:57 2008 @@ -0,0 +1,18 @@ +/* APPLE LOCAL file radar 6017984 */ +/* Warn if @implementation does not implement methods declared + in anonymous category's protocol list. */ +/* { dg-do compile { target *-*-darwin* } } */ + + at protocol Bar +- (void) baz; + at end + + at interface Foo + at end + + at interface Foo () + at end + + at implementation Foo + at end /* { dg-warning "incomplete implementation of class 'Foo'" } */ + /* { dg-warning "method definition for '-baz' not found" "" { target *-*-* } 17 } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/volatile-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/volatile-1.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/volatile-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/volatile-1.m Mon Nov 3 02:35:57 2008 @@ -3,7 +3,7 @@ /* { dg-options "-O2" } */ /* Contributed by Ziemowit Laski */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ @interface Test -(void) test2: (volatile int) a; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m?rev=58601&r1=58600&r2=58601&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/zero-link-2.m Mon Nov 3 02:35:57 2008 @@ -4,7 +4,7 @@ /* APPLE LOCAL ARM objc2 */ /* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* APPLE LOCAL radar 4894756 */ -/* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* { dg-require-effective-target ilp32 } */ #include #include From clattner at apple.com Mon Nov 3 03:40:58 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 3 Nov 2008 01:40:58 -0800 Subject: [llvm-commits] patch: flush raw_ostream after AsmPrinting function In-Reply-To: <6a8523d60811020107v619688f4v8bc19ae71bea91b7@mail.gmail.com> References: <1225471329.28395.19.camel@Remington> <6a8523d60811020107v619688f4v8bc19ae71bea91b7@mail.gmail.com> Message-ID: <62938304-1204-43E3-9448-0737ADF0682C@apple.com> On Nov 2, 2008, at 1:07 AM, Daniel Dunbar wrote: > I agree with Dan, this is unfortunate. > > Is an extra branch in the write routine really a performance issue > here? The performance metric in this case is "time clang -E INPUTS/Cocoa.h - o /dev/null" with a release-asserts build. If that doesn't regress, I'm happy. :) However, performance of output to stderr is not very important (to me at least). Maybe we could do a little hack where the size of the buffer is 0 or 1 bytes, causing every write to go into the overflow case. Handling the flushing in the overflow case would be perfectly acceptable to me. Clang uses a very large output buffer for -E, so it wouldn't affect it significantly. -Chris From matthijs at stdin.nl Mon Nov 3 05:16:44 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Mon, 03 Nov 2008 11:16:44 -0000 Subject: [llvm-commits] [llvm] r58606 - /llvm/trunk/lib/CodeGen/MachineFunction.cpp Message-ID: <200811031116.mA3BGiq2026027@zion.cs.uiuc.edu> Author: matthijs Date: Mon Nov 3 05:16:43 2008 New Revision: 58606 URL: http://llvm.org/viewvc/llvm-project?rev=58606&view=rev Log: Make MachineFrameInfo::print not crash when no TargetFrameInfo is available. Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=58606&r1=58605&r2=58606&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Nov 3 05:16:43 2008 @@ -396,7 +396,8 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{ - int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea(); + const TargetFrameInfo *FI = MF.getTarget().getFrameInfo(); + int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0); for (unsigned i = 0, e = Objects.size(); i != e; ++i) { const StackObject &SO = Objects[i]; From baldrick at free.fr Mon Nov 3 05:51:12 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 03 Nov 2008 11:51:12 -0000 Subject: [llvm-commits] [llvm] r58608 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/2008-11-03-F80VAARG.ll Message-ID: <200811031151.mA3BpCVM027144@zion.cs.uiuc.edu> Author: baldrick Date: Mon Nov 3 05:51:11 2008 New Revision: 58608 URL: http://llvm.org/viewvc/llvm-project?rev=58608&view=rev Log: Make VAARG work with x86 long double (which is 10 bytes long, but is passed in 12/16 bytes). Added: llvm/trunk/test/CodeGen/X86/2008-11-03-F80VAARG.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=58608&r1=58607&r2=58608&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 3 05:51:11 2008 @@ -3438,9 +3438,9 @@ const Value *V = cast(Node->getOperand(2))->getValue(); SDValue VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0); // Increment the pointer, VAList, to the next vaarg - Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, - DAG.getConstant(VT.getSizeInBits()/8, - TLI.getPointerTy())); + Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, + DAG.getConstant(TLI.getTargetData()->getABITypeSize(VT.getTypeForMVT()), + TLI.getPointerTy())); // Store the incremented VAList to the legalized pointer Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0); // Load the actual argument out of the pointer VAList Added: llvm/trunk/test/CodeGen/X86/2008-11-03-F80VAARG.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-11-03-F80VAARG.ll?rev=58608&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-11-03-F80VAARG.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-11-03-F80VAARG.ll Mon Nov 3 05:51:11 2008 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llc -march=x86 -o - | not grep 10 + +declare void @llvm.va_start(i8*) nounwind + +declare void @llvm.va_copy(i8*, i8*) nounwind + +declare void @llvm.va_end(i8*) nounwind + +define x86_fp80 @test(...) nounwind { + %ap = alloca i8* ; [#uses=3] + %v1 = bitcast i8** %ap to i8* ; [#uses=1] + call void @llvm.va_start(i8* %v1) + %t1 = va_arg i8** %ap, x86_fp80 ; [#uses=1] + %t2 = va_arg i8** %ap, x86_fp80 ; [#uses=1] + %t = add x86_fp80 %t1, %t2 ; [#uses=1] + ret x86_fp80 %t +} From clattner at apple.com Mon Nov 3 06:11:46 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 3 Nov 2008 04:11:46 -0800 Subject: [llvm-commits] Recent apple changes broke the Ada build In-Reply-To: <200811030930.20704.duncan.sands@math.u-psud.fr> References: <200811030930.20704.duncan.sands@math.u-psud.fr> Message-ID: <04263C73-375B-4CEE-88E8-40E4281139A9@apple.com> On Nov 3, 2008, at 12:30 AM, Duncan Sands wrote: > Hi Bill, I'm getting these errors when building Ada: Fariborz, can you please investigate genericizing, #ifdef'ing, or stubbing these? Thanks, -Chris > > > libbackend.a(dwarf2out.o): In function `add_type_attribute': > gcc/dwarf2out.c:11732: undefined reference to > `generic_block_literal_struct_type' > libbackend.a(gtype-desc.o):(.rodata+0x9f8): undefined reference to > `generic_block_literal_struct_type' > libbackend.a(tree.o): In function `build_block_pointer_type': > gcc/tree.c:5112: undefined reference to > `generic_block_literal_struct_type' > gcc/tree.c:5113: undefined reference to > `build_generic_block_struct_type' > gcc/tree.c:5113: undefined reference to > `generic_block_literal_struct_type' > > Can you please take care of it. I understand that you can't > reasonably > try to build Ada before committing, but maybe in the future you can > check > that Fortran builds (both languages usually fail to build when Apple > changes > put C stuff in non-C places): it should just be a matter of adding > "fortran" > to --enable-languages=. Since Fortran is (hopefully) going to be > included in > the next release, it would anyway be good to regularly test Fortran. > > Ciao, > > Duncan. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From asl at math.spbu.ru Mon Nov 3 08:21:40 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 03 Nov 2008 14:21:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58610 - /llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Message-ID: <200811031421.mA3ELfqO001982@zion.cs.uiuc.edu> Author: asl Date: Mon Nov 3 08:21:40 2008 New Revision: 58610 URL: http://llvm.org/viewvc/llvm-project?rev=58610&view=rev Log: Fix weird fallout from partial backport of cmdline option handling: llvm-gcc forgot all subtarget-specific flags if there was explicit target selection via -march option. As a result we ended with 4-byte aligned long doubles on x86-64/linux. Darwin was suddenly ok, because they override the whole subtarget options, on just 64-bit ones. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=58610&r1=58609&r2=58610&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Mon Nov 3 08:21:40 2008 @@ -2020,13 +2020,15 @@ error ("-mstackrealign not supported in the 64bit mode"); /* APPLE LOCAL end radar 4877693 */ + target_flags |= TARGET_SUBTARGET64_DEFAULT & ~target_flags_explicit; + /* Enable by default the SSE and MMX builtins. Do allow the user to explicitly disable any of these. In particular, disabling SSE and MMX for kernel code is extremely useful. */ if (!ix86_arch_specified) target_flags - |= ((MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE - | TARGET_SUBTARGET64_DEFAULT) & ~target_flags_explicit); + |= ((MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE) + & ~target_flags_explicit); /* APPLE LOCAL begin mainline candidate */ /* Disable the red zone for kernel compilation. ??? Why aren't we using -mcmodel=kernel? */ From asl at math.spbu.ru Mon Nov 3 08:43:31 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 03 Nov 2008 14:43:31 -0000 Subject: [llvm-commits] [llvm] r58611 - /llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90 Message-ID: <200811031443.mA3EhVP1003453@zion.cs.uiuc.edu> Author: asl Date: Mon Nov 3 08:43:31 2008 New Revision: 58611 URL: http://llvm.org/viewvc/llvm-project?rev=58611&view=rev Log: Testcase for recent llvm-gcc fix Added: llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90 Added: llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90 URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90?rev=58611&view=auto ============================================================================== --- llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90 (added) +++ llvm/trunk/test/FrontendFortran/2008-11-03-OptionOverride.f90 Mon Nov 3 08:43:31 2008 @@ -0,0 +1,3 @@ +! RUN: %llvmgcc -c %s -march=k8 +! Note: this file intentionally left blank, the problem itself is in +! frontend initialization routines and march flag! \ No newline at end of file From criswell at uiuc.edu Mon Nov 3 10:03:12 2008 From: criswell at uiuc.edu (John Criswell) Date: Mon, 03 Nov 2008 16:03:12 -0000 Subject: [llvm-commits] [poolalloc] r58614 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200811031603.mA3G3Clc009257@zion.cs.uiuc.edu> Author: criswell Date: Mon Nov 3 10:03:12 2008 New Revision: 58614 URL: http://llvm.org/viewvc/llvm-project?rev=58614&view=rev Log: When replacing references to an original function with a reference to a cloned function, do not do replacements for call or invoke instructions in original functions. All cases where such replacement can properly pass pool descriptors has already been done; any further replacement incorrect replaces a call to an original function with an incorrect call to a cloned function. Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=58614&r1=58613&r2=58614&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Nov 3 10:03:12 2008 @@ -129,6 +129,7 @@ if (!I->isDeclaration() && Graphs->hasDSGraph(*I)) FindFunctionPoolArgs(*I); + // Map that maps an original function to its clone std::map FuncMap; // Now clone a function using the pool arg list obtained in the previous @@ -156,11 +157,41 @@ ProcessFunctionBody(*I, FI != FuncMap.end() ? *FI->second : *I); } } - // Replace all uses of original functions with the transformed function. + + // + // Replace any remaining uses of original functions with the transformed + // function i.e., the cloned function. + // for (std::map::iterator I = FuncMap.begin(), - E = FuncMap.end(); I != E; ++I) { + E = FuncMap.end(); + I != E; ++I) { Function *F = I->first; - F->replaceAllUsesWith(ConstantExpr::getPointerCast(I->second, F->getType())); + + // + // Scan through all uses of the original function. Replace it as long as + // the use is not a Call or Invoke instruction that + // o) is within an original function (all such call instructions should + // have been transformed already), and + // o) the called function is the function that we're replacing + // + for (Function::use_iterator User = F->use_begin(); + User != F->use_end(); + ++User) { + if (CallInst * CI = dyn_cast(User)) { + if (CI->getCalledFunction() == F) + if ((FuncMap.find(CI->getParent()->getParent())) != FuncMap.end()) + continue; + } + + if (InvokeInst * CI = dyn_cast(User)) { + if (CI->getCalledFunction() == F) + if ((FuncMap.find(CI->getParent()->getParent())) != FuncMap.end()) + continue; + } + + User->replaceUsesOfWith (F, ConstantExpr::getPointerCast(I->second, + F->getType())); + } } if (CurHeuristic->IsRealHeuristic()) From alenhar2 at cs.uiuc.edu Mon Nov 3 10:05:35 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 03 Nov 2008 16:05:35 -0000 Subject: [llvm-commits] [llvm] r58615 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Message-ID: <200811031605.mA3G5amA009446@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Nov 3 10:05:35 2008 New Revision: 58615 URL: http://llvm.org/viewvc/llvm-project?rev=58615&view=rev Log: Ensure that we are checking only calls to the function we are interested in specializing Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=58615&r1=58614&r2=58615&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Mon Nov 3 10:05:35 2008 @@ -165,14 +165,16 @@ } } +/// scanDistribution - Construct a histogram of constants for arg of F at arg int PartSpec::scanDistribution(Function& F, int arg, std::map& dist) { bool hasIndirect = false; int total = 0; for(Value::use_iterator ii = F.use_begin(), ee = F.use_end(); ii != ee; ++ii) - if (CallInst* CI = dyn_cast(ii)) { - ++dist[dyn_cast(CI->getOperand(arg + 1))]; + if ((isa(ii) || isa(ii)) + && ii->getOperand(0) == &F) { + ++dist[dyn_cast(ii->getOperand(arg + 1))]; ++total; } else hasIndirect = true; From criswell at uiuc.edu Mon Nov 3 10:09:30 2008 From: criswell at uiuc.edu (John Criswell) Date: Mon, 03 Nov 2008 16:09:30 -0000 Subject: [llvm-commits] [poolalloc] r58616 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200811031609.mA3G9Uph009750@zion.cs.uiuc.edu> Author: criswell Date: Mon Nov 3 10:09:30 2008 New Revision: 58616 URL: http://llvm.org/viewvc/llvm-project?rev=58616&view=rev Log: Formatting improvements. No functionality changes. Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=58616&r1=58615&r2=58616&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Nov 3 10:09:30 2008 @@ -108,10 +108,15 @@ if (M.begin() == M.end()) return false; CurModule = &M; + // + // Get references to the DSA information. For SAFECode, we need Top-Down + // DSA. For Automatic Pool Allocation only, we need Bottom-Up DSA. In all + // cases, we need to use the Equivalence-Class version of DSA. + // if (SAFECodeEnabled) - Graphs = &getAnalysis(); // folded inlined CBU graphs - else - Graphs = &getAnalysis(); // folded inlined CBU graphs + Graphs = &getAnalysis(); + else + Graphs = &getAnalysis(); CurHeuristic = Heuristic::create(); CurHeuristic->Initialize(M, Graphs->getGlobalsGraph(), *this); @@ -446,6 +451,7 @@ for (std::map::iterator I = FI.ValueMap.begin(), E = FI.ValueMap.end(); I != E; ++I) ValueMap.insert(std::make_pair(I->first, I->second)); + for (Function::arg_iterator I = F.arg_begin(); NI != New->arg_end(); ++I, ++NI) { ValueMap[I] = NI; From gohman at apple.com Mon Nov 3 11:00:26 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 3 Nov 2008 09:00:26 -0800 (PST) Subject: [llvm-commits] [llvm] r58517 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.td In-Reply-To: <200810311652.m9VGqw6S010172@zion.cs.uiuc.edu> References: <200810311652.m9VGqw6S010172@zion.cs.uiuc.edu> Message-ID: On Fri, October 31, 2008 8:52 am, Evan Cheng wrote: > Author: evancheng > Date: Fri Oct 31 11:52:57 2008 > New Revision: 58517 > > URL: http://llvm.org/viewvc/llvm-project?rev=58517&view=rev > Log: > Change x86 register allocation ordering to match that of gcc. Otherwise > some tools get confused by prologue generated by llvm. What tools depend on the order that compilers allocate registers? > def GR64 : RegisterClass<"X86", [i64], 64, > [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, > - RBX, R14, R15, R12, R13, RBP, RSP]> { > + RBX, R12, R13, R14, R15, RBP, RSP]> { Registers %r13 and %rbp are special and require some instructions to be encoded differently. It's desirable to allocate them last. For example, instructions like this: leaq (%r13,%rax),%rax must be encoded with a displacement immediate field when the base register is %r13 or %rbp, but it doesn't require one for other registers. Dan From gohman at apple.com Mon Nov 3 11:10:24 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 17:10:24 -0000 Subject: [llvm-commits] [llvm] r58620 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h Message-ID: <200811031710.mA3HAPnl014114@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 11:10:24 2008 New Revision: 58620 URL: http://llvm.org/viewvc/llvm-project?rev=58620&view=rev Log: Remove redundant inline keywords from functions defined within class definitions. Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=58620&r1=58619&r2=58620&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Mon Nov 3 11:10:24 2008 @@ -139,13 +139,13 @@ MVT() {} MVT(SimpleValueType S) : V(S) {} - inline bool operator== (const MVT VT) const { return V == VT.V; } - inline bool operator!= (const MVT VT) const { return V != VT.V; } + bool operator== (const MVT VT) const { return V == VT.V; } + bool operator!= (const MVT VT) const { return V != VT.V; } /// getFloatingPointVT - Returns the MVT that represents a floating point /// type with the given number of bits. There are two floating point types /// with 128 bits - this returns f128 rather than ppcf128. - static inline MVT getFloatingPointVT(unsigned BitWidth) { + static MVT getFloatingPointVT(unsigned BitWidth) { switch (BitWidth) { default: assert(false && "Bad bit width!"); @@ -162,7 +162,7 @@ /// getIntegerVT - Returns the MVT that represents an integer with the given /// number of bits. - static inline MVT getIntegerVT(unsigned BitWidth) { + static MVT getIntegerVT(unsigned BitWidth) { switch (BitWidth) { default: break; @@ -187,7 +187,7 @@ /// getVectorVT - Returns the MVT that represents a vector NumElements in /// length, where each element is of type VT. - static inline MVT getVectorVT(MVT VT, unsigned NumElements) { + static MVT getVectorVT(MVT VT, unsigned NumElements) { switch (VT.V) { default: break; @@ -228,7 +228,7 @@ /// getIntVectorWithNumElements - Return any integer vector type that has /// the specified number of elements. - static inline MVT getIntVectorWithNumElements(unsigned NumElts) { + static MVT getIntVectorWithNumElements(unsigned NumElts) { switch (NumElts) { default: return getVectorVT(i8, NumElts); case 1: return v1i64; @@ -243,90 +243,90 @@ /// isSimple - Test if the given MVT is simple (as opposed to being /// extended). - inline bool isSimple() const { + bool isSimple() const { return V <= SimpleTypeMask; } /// isExtended - Test if the given MVT is extended (as opposed to /// being simple). - inline bool isExtended() const { + bool isExtended() const { return !isSimple(); } /// isFloatingPoint - Return true if this is a FP, or a vector FP type. - inline bool isFloatingPoint() const { + bool isFloatingPoint() const { uint32_t SVT = V & SimpleTypeMask; return (SVT >= f32 && SVT <= ppcf128) || (SVT >= v2f32 && SVT <= v2f64); } /// isInteger - Return true if this is an integer, or a vector integer type. - inline bool isInteger() const { + bool isInteger() const { uint32_t SVT = V & SimpleTypeMask; return (SVT >= FIRST_INTEGER_VALUETYPE && SVT <= LAST_INTEGER_VALUETYPE) || (SVT >= v8i8 && SVT <= v2i64) || (SVT == iAny && (V & PrecisionMask)); } /// isVector - Return true if this is a vector value type. - inline bool isVector() const { + bool isVector() const { return (V >= FIRST_VECTOR_VALUETYPE && V <= LAST_VECTOR_VALUETYPE) || (V & VectorMask); } /// is64BitVector - Return true if this is a 64-bit vector type. - inline bool is64BitVector() const { + bool is64BitVector() const { return (V==v8i8 || V==v4i16 || V==v2i32 || V==v1i64 || V==v2f32 || (isExtended() && isVector() && getSizeInBits()==64)); } /// is128BitVector - Return true if this is a 128-bit vector type. - inline bool is128BitVector() const { + bool is128BitVector() const { return (V==v16i8 || V==v8i16 || V==v4i32 || V==v2i64 || V==v4f32 || V==v2f64 || (isExtended() && isVector() && getSizeInBits()==128)); } /// isByteSized - Return true if the bit size is a multiple of 8. - inline bool isByteSized() const { + bool isByteSized() const { return (getSizeInBits() & 7) == 0; } /// isRound - Return true if the size is a power-of-two number of bytes. - inline bool isRound() const { + bool isRound() const { unsigned BitSize = getSizeInBits(); return BitSize >= 8 && !(BitSize & (BitSize - 1)); } /// bitsGT - Return true if this has more bits than VT. - inline bool bitsGT(MVT VT) const { + bool bitsGT(MVT VT) const { return getSizeInBits() > VT.getSizeInBits(); } /// bitsGE - Return true if this has no less bits than VT. - inline bool bitsGE(MVT VT) const { + bool bitsGE(MVT VT) const { return getSizeInBits() >= VT.getSizeInBits(); } /// bitsLT - Return true if this has less bits than VT. - inline bool bitsLT(MVT VT) const { + bool bitsLT(MVT VT) const { return getSizeInBits() < VT.getSizeInBits(); } /// bitsLE - Return true if this has no more bits than VT. - inline bool bitsLE(MVT VT) const { + bool bitsLE(MVT VT) const { return getSizeInBits() <= VT.getSizeInBits(); } /// getSimpleVT - Return the SimpleValueType held in the specified /// simple MVT. - inline SimpleValueType getSimpleVT() const { + SimpleValueType getSimpleVT() const { assert(isSimple() && "Expected a SimpleValueType!"); return (SimpleValueType)V; } /// getVectorElementType - Given a vector type, return the type of /// each element. - inline MVT getVectorElementType() const { + MVT getVectorElementType() const { assert(isVector() && "Invalid vector type!"); switch (V) { default: { @@ -353,7 +353,7 @@ /// getVectorNumElements - Given a vector type, return the number of /// elements it contains. - inline unsigned getVectorNumElements() const { + unsigned getVectorNumElements() const { assert(isVector() && "Invalid vector type!"); switch (V) { default: @@ -376,7 +376,7 @@ } /// getSizeInBits - Return the size of the specified value type in bits. - inline unsigned getSizeInBits() const { + unsigned getSizeInBits() const { switch (V) { default: assert(isExtended() && "MVT has no known size!"); @@ -415,14 +415,14 @@ /// getStoreSizeInBits - Return the number of bits overwritten by a store /// of the specified value type. - inline unsigned getStoreSizeInBits() const { + unsigned getStoreSizeInBits() const { return (getSizeInBits() + 7)/8*8; } /// getRoundIntegerType - Rounds the bit-width of the given integer MVT up /// to the nearest power of two (and at least to eight), and returns the /// integer MVT with that number of bits. - inline MVT getRoundIntegerType() const { + MVT getRoundIntegerType() const { assert(isInteger() && !isVector() && "Invalid integer type!"); unsigned BitWidth = getSizeInBits(); if (BitWidth <= 8) @@ -433,7 +433,7 @@ /// getIntegerVTBitMask - Return an integer with 1's every place there are /// bits in the specified integer value type. FIXME: Should return an apint. - inline uint64_t getIntegerVTBitMask() const { + uint64_t getIntegerVTBitMask() const { assert(isInteger() && !isVector() && "Only applies to int scalars!"); return ~uint64_t(0UL) >> (64-getSizeInBits()); } @@ -441,7 +441,7 @@ /// getIntegerVTSignBit - Return an integer with a 1 in the position of the /// sign bit for the specified integer value type. FIXME: Should return an /// apint. - inline uint64_t getIntegerVTSignBit() const { + uint64_t getIntegerVTSignBit() const { assert(isInteger() && !isVector() && "Only applies to int scalars!"); return uint64_t(1UL) << (getSizeInBits()-1); } From daniel at zuster.org Mon Nov 3 11:33:36 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 03 Nov 2008 17:33:36 -0000 Subject: [llvm-commits] [llvm] r58621 - /llvm/trunk/Makefile.rules Message-ID: <200811031733.mA3HXaFZ015724@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Nov 3 11:33:36 2008 New Revision: 58621 URL: http://llvm.org/viewvc/llvm-project?rev=58621&view=rev Log: Comment fix. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=58621&r1=58620&r2=58621&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Mon Nov 3 11:33:36 2008 @@ -1302,7 +1302,7 @@ # INCFiles rule: All of the tblgen generated files are emitted to # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows # us to only "touch" the real file if the contents of it change. IOW, if -# tblgen is modified, all of the .inc.tmp files are regereated, but no +# tblgen is modified, all of the .inc.tmp files are regenerated, but no # dependencies of the .inc files are, unless the contents of the .inc file # changes. $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp From gohman at apple.com Mon Nov 3 11:56:27 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 17:56:27 -0000 Subject: [llvm-commits] [llvm] r58623 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h lib/VMCore/ValueTypes.cpp test/CodeGen/X86/i2k.ll utils/TableGen/CMakeLists.txt utils/TableGen/TGValueTypes.cpp Message-ID: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 11:56:27 2008 New Revision: 58623 URL: http://llvm.org/viewvc/llvm-project?rev=58623&view=rev Log: Change how extended types are represented in MVTs. Instead of fiddling bits, use a union of a SimpleValueType enum and a regular Type*. This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits. In most cases, this doesn't add significant overhead. There are places in codegen that use arrays of MVTs, so these are now larger, but they're small in common cases. This eliminates restrictions on the size of integer types and vector types that can be represented in codegen. As the included testcase demonstrates, it's now possible to codegen very large add operations. There are still some complications with using very large types. PR2880 is still open so they can't be used as return values on normal targets, there are no libcalls defined for very large integers so operations like multiply and divide aren't supported. This also introduces a minimal tablgen Type library, capable of handling IntegerType and VectorType. This will allow parts of TableGen that don't depend on using SimpleValueType values to handle arbitrary integer and vector types. Added: llvm/trunk/test/CodeGen/X86/i2k.ll llvm/trunk/utils/TableGen/TGValueTypes.cpp Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h llvm/trunk/lib/VMCore/ValueTypes.cpp llvm/trunk/utils/TableGen/CMakeLists.txt Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=58623&r1=58622&r2=58623&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Mon Nov 3 11:56:27 2008 @@ -26,7 +26,6 @@ struct MVT { // MVT = Machine Value Type public: - enum SimpleValueType { // If you change this numbering, you must change the values in // ValueTypes.td as well! @@ -87,10 +86,14 @@ // iPTR - An int value the size of the pointer of the current // target. This should only be used internal to tblgen! - iPTR = 255 + iPTR = 255, + + // LastSimpleValueType - The greatest valid SimpleValueType value. + LastSimpleValueType = 255 }; - /// MVT - This type holds low-level value types. Valid values include any of + private: + /// This union holds low-level value types. Valid values include any of /// the values in the SimpleValueType enum, or any value returned from one /// of the MVT methods. Any value type equal to one of the SimpleValueType /// enum values is a "simple" value type. All others are "extended". @@ -99,48 +102,22 @@ /// All legal value types must be simple, but often there are some simple /// value types that are not legal. /// - /// @internal - /// Extended types are either vector types or arbitrary precision integers. - /// Arbitrary precision integers have iAny in the first SimpleTypeBits bits, - /// and the bit-width in the next PrecisionBits bits, offset by minus one. - /// Vector types are encoded by having the first - /// SimpleTypeBits+PrecisionBits bits encode the vector element type - /// (which must be a scalar type, possibly an arbitrary precision integer) - /// and the remaining VectorBits upper bits encode the vector length, offset - /// by one. - /// - /// 32--------------16-----------8-------------0 - /// | Vector length | Precision | Simple type | - /// | | Vector element | - /// - - private: - - static const int SimpleTypeBits = 8; - static const int PrecisionBits = 8; - static const int VectorBits = 32 - SimpleTypeBits - PrecisionBits; - - static const uint32_t SimpleTypeMask = - (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits); - - static const uint32_t PrecisionMask = - ((~uint32_t(0) << VectorBits) >> (32 - PrecisionBits)) << SimpleTypeBits; - - static const uint32_t VectorMask = - (~uint32_t(0) >> (32 - VectorBits)) << (32 - VectorBits); - - static const uint32_t ElementMask = - (~uint32_t(0) << VectorBits) >> VectorBits; - - uint32_t V; + union { + uintptr_t V; + SimpleValueType SimpleTy; + const Type *LLVMTy; + }; public: - MVT() {} MVT(SimpleValueType S) : V(S) {} - bool operator== (const MVT VT) const { return V == VT.V; } - bool operator!= (const MVT VT) const { return V != VT.V; } + bool operator==(const MVT VT) const { + return getRawBits() == VT.getRawBits(); + } + bool operator!=(const MVT VT) const { + return getRawBits() != VT.getRawBits(); + } /// getFloatingPointVT - Returns the MVT that represents a floating point /// type with the given number of bits. There are two floating point types @@ -179,10 +156,7 @@ case 128: return i128; } - MVT VT; - VT.V = iAny | (((BitWidth - 1) << SimpleTypeBits) & PrecisionMask); - assert(VT.getSizeInBits() == BitWidth && "Bad bit width!"); - return VT; + return getExtendedIntegerVT(BitWidth); } /// getVectorVT - Returns the MVT that represents a vector NumElements in @@ -217,13 +191,7 @@ if (NumElements == 2) return v2f64; break; } - MVT Result; - Result.V = VT.V | ((NumElements + 1) << (32 - VectorBits)); - assert(Result.getVectorElementType() == VT && - "Bad vector element type!"); - assert(Result.getVectorNumElements() == NumElements && - "Bad vector length!"); - return Result; + return getExtendedVectorVT(VT, NumElements); } /// getIntVectorWithNumElements - Return any integer vector type that has @@ -240,11 +208,10 @@ } } - /// isSimple - Test if the given MVT is simple (as opposed to being /// extended). bool isSimple() const { - return V <= SimpleTypeMask; + return V <= LastSimpleValueType; } /// isExtended - Test if the given MVT is extended (as opposed to @@ -255,34 +222,43 @@ /// isFloatingPoint - Return true if this is a FP, or a vector FP type. bool isFloatingPoint() const { - uint32_t SVT = V & SimpleTypeMask; - return (SVT >= f32 && SVT <= ppcf128) || (SVT >= v2f32 && SVT <= v2f64); + return isSimple() ? + ((SimpleTy >= f32 && SimpleTy <= ppcf128) || + (SimpleTy >= v2f32 && SimpleTy <= v2f64)) : + isExtendedFloatingPoint(); } /// isInteger - Return true if this is an integer, or a vector integer type. bool isInteger() const { - uint32_t SVT = V & SimpleTypeMask; - return (SVT >= FIRST_INTEGER_VALUETYPE && SVT <= LAST_INTEGER_VALUETYPE) || - (SVT >= v8i8 && SVT <= v2i64) || (SVT == iAny && (V & PrecisionMask)); + return isSimple() ? + ((SimpleTy >= FIRST_INTEGER_VALUETYPE && + SimpleTy <= LAST_INTEGER_VALUETYPE) || + (SimpleTy >= v8i8 && SimpleTy <= v2i64)) : + isExtendedInteger(); } /// isVector - Return true if this is a vector value type. bool isVector() const { - return (V >= FIRST_VECTOR_VALUETYPE && V <= LAST_VECTOR_VALUETYPE) || - (V & VectorMask); + return isSimple() ? + (SimpleTy >= FIRST_VECTOR_VALUETYPE && + SimpleTy <= LAST_VECTOR_VALUETYPE) : + isExtendedVector(); } /// is64BitVector - Return true if this is a 64-bit vector type. bool is64BitVector() const { - return (V==v8i8 || V==v4i16 || V==v2i32 || V==v1i64 || V==v2f32 || - (isExtended() && isVector() && getSizeInBits()==64)); + return isSimple() ? + (SimpleTy==v8i8 || SimpleTy==v4i16 || SimpleTy==v2i32 || + SimpleTy==v1i64 || SimpleTy==v2f32) : + isExtended64BitVector(); } /// is128BitVector - Return true if this is a 128-bit vector type. bool is128BitVector() const { - return (V==v16i8 || V==v8i16 || V==v4i32 || V==v2i64 || - V==v4f32 || V==v2f64 || - (isExtended() && isVector() && getSizeInBits()==128)); + return isSimple() ? + (SimpleTy==v16i8 || SimpleTy==v8i16 || SimpleTy==v4i32 || + SimpleTy==v2i64 || SimpleTy==v4f32 || SimpleTy==v2f64) : + isExtended128BitVector(); } /// isByteSized - Return true if the bit size is a multiple of 8. @@ -321,7 +297,7 @@ /// simple MVT. SimpleValueType getSimpleVT() const { assert(isSimple() && "Expected a SimpleValueType!"); - return (SimpleValueType)V; + return SimpleTy; } /// getVectorElementType - Given a vector type, return the type of @@ -329,12 +305,8 @@ MVT getVectorElementType() const { assert(isVector() && "Invalid vector type!"); switch (V) { - default: { - assert(isExtended() && "Unknown simple vector type!"); - MVT VT; - VT.V = V & ElementMask; - return VT; - } + default: + return getExtendedVectorElementType(); case v8i8 : case v16i8: return i8; case v4i16: @@ -357,8 +329,7 @@ assert(isVector() && "Invalid vector type!"); switch (V) { default: - assert(isExtended() && "Unknown simple vector type!"); - return ((V & VectorMask) >> (32 - VectorBits)) - 1; + return getExtendedVectorNumElements(); case v16i8: return 16; case v8i8 : case v8i16: return 8; @@ -379,13 +350,7 @@ unsigned getSizeInBits() const { switch (V) { default: - assert(isExtended() && "MVT has no known size!"); - if (isVector()) - return getVectorElementType().getSizeInBits()*getVectorNumElements(); - if (isInteger()) - return ((V & PrecisionMask) >> SimpleTypeBits) + 1; - assert(false && "Unknown value type!"); - return 0; + return getExtendedSizeInBits(); case i1 : return 1; case i8 : return 8; case i16 : return 16; @@ -410,6 +375,12 @@ case v2i64: case v4f32: case v2f64: return 128; + case iPTR: + assert(false && "Value type size is target-dependent. Ask TLI."); + case iPTRAny: + case iAny: + case fAny: + assert(false && "Value type is overloaded."); } } @@ -461,7 +432,7 @@ static MVT getMVT(const Type *Ty, bool HandleUnknown = false); /// getRawBits - Represent the type as a bunch of bits. - uint32_t getRawBits() const { return V; } + uintptr_t getRawBits() const { return V; } /// compareRawBits - A meaningless but well-behaved order, useful for /// constructing containers. @@ -470,6 +441,21 @@ return L.getRawBits() < R.getRawBits(); } }; + + private: + // Methods for handling the Extended-type case in functions above. + // These are all out-of-line to prevent users of this header file + // from having a dependency on Type.h. + static MVT getExtendedIntegerVT(unsigned BitWidth); + static MVT getExtendedVectorVT(MVT VT, unsigned NumElements); + bool isExtendedFloatingPoint() const; + bool isExtendedInteger() const; + bool isExtendedVector() const; + bool isExtended64BitVector() const; + bool isExtended128BitVector() const; + MVT getExtendedVectorElementType() const; + unsigned getExtendedVectorNumElements() const; + unsigned getExtendedSizeInBits() const; }; } // End llvm namespace Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=58623&r1=58622&r2=58623&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original) +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Mon Nov 3 11:56:27 2008 @@ -17,6 +17,60 @@ #include "llvm/DerivedTypes.h" using namespace llvm; +MVT MVT::getExtendedIntegerVT(unsigned BitWidth) { + MVT VT; + VT.LLVMTy = IntegerType::get(BitWidth); + return VT; +} + +MVT MVT::getExtendedVectorVT(MVT VT, unsigned NumElements) { + MVT ResultVT; + ResultVT.LLVMTy = VectorType::get(VT.getTypeForMVT(), NumElements); + return ResultVT; +} + +bool MVT::isExtendedFloatingPoint() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isFPOrFPVector(); +} + +bool MVT::isExtendedInteger() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isIntOrIntVector(); +} + +bool MVT::isExtendedVector() const { + assert(isExtended() && "Type is not extended!"); + return isa(LLVMTy); +} + +bool MVT::isExtended64BitVector() const { + return isExtendedVector() && getSizeInBits() == 64; +} + +bool MVT::isExtended128BitVector() const { + return isExtendedVector() && getSizeInBits() == 128; +} + +MVT MVT::getExtendedVectorElementType() const { + assert(isExtended() && "Type is not extended!"); + return MVT::getMVT(cast(LLVMTy)->getElementType()); +} + +unsigned MVT::getExtendedVectorNumElements() const { + assert(isExtended() && "Type is not extended!"); + return cast(LLVMTy)->getNumElements(); +} + +unsigned MVT::getExtendedSizeInBits() const { + assert(isExtended() && "Type is not extended!"); + if (const IntegerType *ITy = dyn_cast(LLVMTy)) + return ITy->getBitWidth(); + if (const VectorType *VTy = dyn_cast(LLVMTy)) + return VTy->getBitWidth(); + assert(false && "Unrecognized extended type!"); +} + /// getMVTString - This function returns value type as a string, e.g. "i32". std::string MVT::getMVTString() const { switch (V) { Added: llvm/trunk/test/CodeGen/X86/i2k.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/i2k.ll?rev=58623&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/i2k.ll (added) +++ llvm/trunk/test/CodeGen/X86/i2k.ll Mon Nov 3 11:56:27 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define void @foo(i2011* %x, i2011* %y, i2011* %p) nounwind { + %a = load i2011* %x + %b = load i2011* %y + %c = add i2011 %a, %b + store i2011 %c, i2011* %p + ret void +} Modified: llvm/trunk/utils/TableGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=58623&r1=58622&r2=58623&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CMakeLists.txt (original) +++ llvm/trunk/utils/TableGen/CMakeLists.txt Mon Nov 3 11:56:27 2008 @@ -15,6 +15,7 @@ SubtargetEmitter.cpp TGLexer.cpp TGParser.cpp + TGValueTypes.cpp TableGen.cpp TableGenBackend.cpp FastISelEmitter.cpp Added: llvm/trunk/utils/TableGen/TGValueTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGValueTypes.cpp?rev=58623&view=auto ============================================================================== --- llvm/trunk/utils/TableGen/TGValueTypes.cpp (added) +++ llvm/trunk/utils/TableGen/TGValueTypes.cpp Mon Nov 3 11:56:27 2008 @@ -0,0 +1,123 @@ +//===- ValueTypes.cpp - Tablegen extended ValueType implementation --------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// The MVT type is used by tablegen as well as in LLVM. In order to handle +// extended types, the MVT type uses support functions that call into +// LLVM's type system code. These aren't accessible in tablegen, so this +// file provides simple replacements. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/ValueTypes.h" +#include "llvm/Support/Streams.h" +#include +#include +using namespace llvm; + +namespace llvm { + +class Type { +public: + virtual unsigned getSizeInBits() const = 0; +}; + +} + +class ExtendedIntegerType : public Type { + unsigned BitWidth; +public: + explicit ExtendedIntegerType(unsigned bits) + : BitWidth(bits) {} + unsigned getSizeInBits() const { + return getBitWidth(); + } + unsigned getBitWidth() const { + return BitWidth; + } +}; + +class ExtendedVectorType : public Type { + MVT ElementType; + unsigned NumElements; +public: + ExtendedVectorType(MVT elty, unsigned num) + : ElementType(elty), NumElements(num) {} + unsigned getSizeInBits() const { + return getNumElements() * getElementType().getSizeInBits(); + } + MVT getElementType() const { + return ElementType; + } + unsigned getNumElements() const { + return NumElements; + } +}; + +static std::map + ExtendedIntegerTypeMap; +static std::map, const Type *> + ExtendedVectorTypeMap; + +MVT MVT::getExtendedIntegerVT(unsigned BitWidth) { + const Type *&ET = ExtendedIntegerTypeMap[BitWidth]; + if (!ET) ET = new ExtendedIntegerType(BitWidth); + MVT VT; + VT.LLVMTy = ET; + return VT; +} + +MVT MVT::getExtendedVectorVT(MVT VT, unsigned NumElements) { + const Type *&ET = ExtendedVectorTypeMap[std::make_pair(VT.getRawBits(), + NumElements)]; + if (!ET) ET = new ExtendedVectorType(VT, NumElements); + MVT ResultVT; + ResultVT.LLVMTy = ET; + return ResultVT; +} + +bool MVT::isExtendedFloatingPoint() const { + assert(isExtended() && "Type is not extended!"); + // Extended floating-point types are not supported yet. + return false; +} + +bool MVT::isExtendedInteger() const { + assert(isExtended() && "Type is not extended!"); + return dynamic_cast(LLVMTy) != 0; +} + +bool MVT::isExtendedVector() const { + assert(isExtended() && "Type is not extended!"); + return dynamic_cast(LLVMTy) != 0; +} + +bool MVT::isExtended64BitVector() const { + assert(isExtended() && "Type is not extended!"); + return isExtendedVector() && getSizeInBits() == 64; +} + +bool MVT::isExtended128BitVector() const { + assert(isExtended() && "Type is not extended!"); + return isExtendedVector() && getSizeInBits() == 128; +} + +MVT MVT::getExtendedVectorElementType() const { + assert(isExtendedVector() && "Type is not an extended vector!"); + return static_cast(LLVMTy)->getElementType(); +} + +unsigned MVT::getExtendedVectorNumElements() const { + assert(isExtendedVector() && "Type is not an extended vector!"); + return static_cast(LLVMTy)->getNumElements(); +} + +unsigned MVT::getExtendedSizeInBits() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->getSizeInBits(); +} From wangmp at apple.com Mon Nov 3 12:17:18 2008 From: wangmp at apple.com (Mon Ping Wang) Date: Mon, 3 Nov 2008 10:17:18 -0800 Subject: [llvm-commits] Patch: generalize vector shuffle In-Reply-To: References: <7C812DE7-E002-4767-A0AE-192738C25237@apple.com> <00BEE636-9DBF-40CE-A322-1A50F2D6BEE3@apple.com> Message-ID: Hi Evan, There are a few functions that duplicated between LegalizeTypes and LegalizeDAG. I wasn't sure if the right thing to do here. If LegalizeType will remain optional for sometime, I would have the two use the same function and have them shared (I don't think there is such a case today). If LegalizeType was be required soon, I thought it would be easier to duplicate the two and delete it from LegalizeDAG as it wouldn't be necessary anymore. However, it seems that I made a mistake of doing the 2nd way as this would cause some maintenance headaches until LegalizeType is required as well as making the patch more painful to digest. I'll look for a place to house these utilities functions so they can be shared. I'll clean up the early exit stuff and try to factor out more of SplitVecRes_VECTOR_SHUFFLE stuff. Thanks, -- Mon Ping On Nov 2, 2008, at 11:47 PM, Evan Cheng wrote: > Hi Mon Ping, > > Thanks for doing this. It's an important improvement. > > However, this patch is hard (at least for me) to digest. It's just a > lot of code. :-) Some of the functions have become so big that it's > hard to follow. For example, SplitVecRes_VECTOR_SHUFFLE. Is it > possible to factor some stuff out? > > Also, some of code seems to be replicated in several functions (please > correct me if that's not the case). For example, the code that > determines how an element is used. > > A stylistic nitpick: > > + if (VT1NumElems*2 == NumElems && SequentialMask(Mask, 0)) { > + setValue(&I, DAG.getNode(ISD::CONCAT_VECTORS, VT, V1, V2)); > + return; > + } > + else { > > The else { } isn't needed because of the early exit. Same issue here: > > + if (VT1NumElems == NumElems && SequentialMask(Mask,0)) { > + setValue(&I, V1); > + return; > + } else if (VT1NumElems == NumElems && > SequentialMask(Mask,NumElems)) { > + setValue(&I, V2); > + return; > + } else { > + // Analyze the access pattern of the vector to see if we can > extract > + // two subvectors and do the shuffle. > > Don't forget to end comment sentences with periods. :-) > > Evan > > On Oct 31, 2008, at 7:56 PM, Mon Ping Wang wrote: > >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Nov 3 12:22:43 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 18:22:43 -0000 Subject: [llvm-commits] [llvm] r58624 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h include/llvm/Target/ELFTargetAsmInfo.h include/llvm/Target/TargetAsmInfo.h lib/Target/ARM/ARMTargetAsmInfo.cpp lib/Target/Alpha/AlphaTargetAsmInfo.cpp lib/Target/CellSPU/SPUTargetAsmInfo.cpp lib/Target/DarwinTargetAsmInfo.cpp lib/Target/ELFTargetAsmInfo.cpp lib/Target/Mips/MipsTargetAsmInfo.cpp lib/Target/PIC16/PIC16TargetAsmInfo.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.h Message-ID: <200811031822.mA3IMikV018785@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 12:22:42 2008 New Revision: 58624 URL: http://llvm.org/viewvc/llvm-project?rev=58624&view=rev Log: Refactor various TargetAsmInfo subclasses' TargetMachine members away adding a TargetMachine member to the base TargetAsmInfo class instead. Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h llvm/trunk/include/llvm/Target/TargetAsmInfo.h llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp llvm/trunk/lib/Target/TargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Mon Nov 3 12:22:42 2008 @@ -44,8 +44,6 @@ const Section* MergeableConstSection(const Type *Ty) const; const Section* MergeableStringSection(const GlobalVariable *GV) const; const Section* SelectSectionForMachineConst(const Type *Ty) const; - protected: - const TargetMachine* DTM; }; } Modified: llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/ELFTargetAsmInfo.h Mon Nov 3 12:22:42 2008 @@ -33,8 +33,6 @@ const Section* MergeableStringSection(const GlobalVariable *GV) const; virtual const Section* SelectSectionForMachineConst(const Type *Ty) const; - protected: - const TargetMachine* ETM; }; } Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Nov 3 12:22:42 2008 @@ -126,6 +126,9 @@ mutable SectionFlags::FlagsStringsMapType FlagsStrings; void fillDefaultValues(); protected: + /// TM - The current TargetMachine. + const TargetMachine &TM; + //===------------------------------------------------------------------===// // Properties to be set by the target writer, used to configure asm printer. // @@ -510,8 +513,7 @@ const char *const *AsmTransCBE; // Defaults to empty public: - TargetAsmInfo(); - TargetAsmInfo(const TargetMachine &TM); + explicit TargetAsmInfo(const TargetMachine &TM); virtual ~TargetAsmInfo(); const Section* getNamedSection(const char *Name, Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -45,7 +45,7 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM): ARMTargetAsmInfo(TM) { - Subtarget = &DTM->getSubtarget(); + Subtarget = &TM.getSubtarget(); GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; @@ -93,7 +93,7 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM): ARMTargetAsmInfo(TM) { - Subtarget = &ETM->getSubtarget(); + Subtarget = &TM.getSubtarget(); NeedsSet = false; HasLEB128 = true; Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -11,11 +11,13 @@ // //===----------------------------------------------------------------------===// +#include "AlphaTargetMachine.h" #include "AlphaTargetAsmInfo.h" using namespace llvm; -AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) { +AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) + : TargetAsmInfo(TM) { AlignmentIsInBytes = false; PrivateGlobalPrefix = "$"; JumpTableDirective = ".gprel32"; Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -16,7 +16,8 @@ #include "llvm/Function.h" using namespace llvm; -SPUTargetAsmInfo::SPUTargetAsmInfo(const SPUTargetMachine &TM) { +SPUTargetAsmInfo::SPUTargetAsmInfo(const SPUTargetMachine &TM) + : TargetAsmInfo(TM) { PCSymbol = "."; CommentString = "#"; GlobalPrefix = ""; Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -24,8 +24,8 @@ using namespace llvm; -DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) { - DTM = &TM; +DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) + : TargetAsmInfo(TM) { CStringSection_ = getUnnamedSection("\t.cstring", SectionFlags::Mergeable | SectionFlags::Strings); @@ -76,7 +76,7 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); bool isWeak = GV->mayBeOverridden(); - bool isNonStatic = (DTM->getRelocationModel() != Reloc::Static); + bool isNonStatic = TM.getRelocationModel() != Reloc::Static; switch (Kind) { case SectionKind::Text: @@ -112,13 +112,12 @@ const Section* DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { - const TargetData *TD = DTM->getTargetData(); + const TargetData *TD = TM.getTargetData(); Constant *C = cast(GV)->getInitializer(); const Type *Type = cast(C)->getType()->getElementType(); unsigned Size = TD->getABITypeSize(Type); if (Size) { - const TargetData *TD = DTM->getTargetData(); unsigned Align = TD->getPreferredAlignment(GV); if (Align <= 32) return getCStringSection_(); @@ -136,7 +135,7 @@ inline const Section* DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const { - const TargetData *TD = DTM->getTargetData(); + const TargetData *TD = TM.getTargetData(); unsigned Size = TD->getABITypeSize(Ty); if (Size == 4) @@ -155,7 +154,7 @@ // Handle weird special case, when compiling PIC stuff. if (S == getReadOnlySection() && - DTM->getRelocationModel() != Reloc::Static) + TM.getRelocationModel() != Reloc::Static) return ConstDataSection; return S; Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -24,8 +24,8 @@ using namespace llvm; -ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) { - ETM = &TM; +ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) + : TargetAsmInfo(TM) { BSSSection_ = getUnnamedSection("\t.bss", SectionFlags::Writeable | SectionFlags::BSS); @@ -102,7 +102,7 @@ inline const Section* ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = TM.getTargetData(); // FIXME: string here is temporary, until stuff will fully land in. // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's @@ -121,7 +121,7 @@ const Section* ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = TM.getTargetData(); Constant *C = cast(GV)->getInitializer(); const ConstantArray *CVA = cast(C); const Type *Ty = CVA->getType()->getElementType(); @@ -131,7 +131,6 @@ assert(getCStringSection() && "Should have string section prefix"); // We also need alignment here - const TargetData *TD = ETM->getTargetData(); unsigned Align = TD->getPrefTypeAlignment(Ty); if (Align < Size) Align = Size; Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -65,7 +65,7 @@ return K; if (isa(GV)) { - const TargetData *TD = ETM->getTargetData(); + const TargetData *TD = TM.getTargetData(); unsigned Size = TD->getABITypeSize(GV->getType()->getElementType()); unsigned Threshold = Subtarget->getSSectionThreshold(); Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -12,12 +12,13 @@ //===----------------------------------------------------------------------===// #include "PIC16TargetAsmInfo.h" +#include "PIC16TargetMachine.h" using namespace llvm; PIC16TargetAsmInfo:: -PIC16TargetAsmInfo(const PIC16TargetMachine &TM) -{ +PIC16TargetAsmInfo(const PIC16TargetMachine &TM) + : TargetAsmInfo(TM) { Data16bitsDirective = "\t.half\t"; Data32bitsDirective = "\t.word\t"; CommentString = ";"; Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -119,11 +119,8 @@ DataSection = getUnnamedSection("\t.data", SectionFlags::Writeable); } -TargetAsmInfo::TargetAsmInfo() { - fillDefaultValues(); -} - -TargetAsmInfo::TargetAsmInfo(const TargetMachine &TM) { +TargetAsmInfo::TargetAsmInfo(const TargetMachine &tm) + : TM(tm) { fillDefaultValues(); } Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Nov 3 12:22:42 2008 @@ -39,7 +39,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): X86TargetAsmInfo(TM) { - const X86Subtarget* Subtarget = &DTM->getSubtarget(); + const X86Subtarget* Subtarget = &TM.getSubtarget(); bool is64Bit = Subtarget->is64Bit(); AlignmentIsInBytes = false; @@ -52,7 +52,7 @@ LessPrivateGlobalPrefix = "l"; // Marker for some ObjC metadata BSSSection = 0; // no BSS section. ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill - if (DTM->getRelocationModel() != Reloc::Static) + if (TM.getRelocationModel() != Reloc::Static) ConstantPoolSection = "\t.const_data"; else ConstantPoolSection = "\t.const\n"; @@ -171,17 +171,17 @@ DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; // On Linux we must declare when we can use a non-executable stack. - if (ETM->getSubtarget().isLinux()) + if (TM.getSubtarget().isLinux()) NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\", at progbits"; } unsigned X86ELFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const { - CodeModel::Model CM = ETM->getCodeModel(); - bool is64Bit = ETM->getSubtarget().is64Bit(); + CodeModel::Model CM = TM.getCodeModel(); + bool is64Bit = TM.getSubtarget().is64Bit(); - if (ETM->getRelocationModel() == Reloc::PIC_) { + if (TM.getRelocationModel() == Reloc::PIC_) { unsigned Format = 0; if (!is64Bit) @@ -216,7 +216,6 @@ X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM): X86GenericTargetAsmInfo(TM) { - X86TM = &TM; GlobalPrefix = "_"; LCOMMDirective = "\t.lcomm\t"; @@ -251,10 +250,10 @@ unsigned X86COFFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const { - CodeModel::Model CM = X86TM->getCodeModel(); - bool is64Bit = X86TM->getSubtarget().is64Bit(); + CodeModel::Model CM = TM.getCodeModel(); + bool is64Bit = TM.getSubtarget().is64Bit(); - if (X86TM->getRelocationModel() == Reloc::PIC_) { + if (TM.getRelocationModel() == Reloc::PIC_) { unsigned Format = 0; if (!is64Bit) Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=58624&r1=58623&r2=58624&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Mon Nov 3 12:22:42 2008 @@ -63,8 +63,6 @@ virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, SectionKind::Kind kind) const; virtual std::string printSectionFlags(unsigned flags) const; - protected: - const X86TargetMachine *X86TM; }; struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo { From dpatel at apple.com Mon Nov 3 12:32:19 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 03 Nov 2008 18:32:19 -0000 Subject: [llvm-commits] [llvm] r58625 - in /llvm/trunk: lib/Transforms/Scalar/IndVarSimplify.cpp test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll Message-ID: <200811031832.mA3IWJL2019277@zion.cs.uiuc.edu> Author: dpatel Date: Mon Nov 3 12:32:19 2008 New Revision: 58625 URL: http://llvm.org/viewvc/llvm-project?rev=58625&view=rev Log: Turn floating point IVs into integer IVs where possible. This allows SCEV users to effectively calculate trip count. LSR later on transforms back integer IVs to floating point IVs later on to avoid int-to-float casts inside the loop. Added: llvm/trunk/test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=58625&r1=58624&r2=58625&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Nov 3 12:32:19 2008 @@ -95,6 +95,7 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); void OptimizeCanonicalIVType(Loop *L); + void HandleFloatingPointIV(Loop *L); }; } @@ -466,6 +467,7 @@ // auxillary induction variables. std::vector > IndVars; + HandleFloatingPointIV(L); for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { PHINode *PN = cast(I); if (PN->getType()->isInteger()) { // FIXME: when we have fast-math, enable! @@ -718,3 +720,151 @@ Incr->eraseFromParent(); } +/// HandleFloatingPointIV - If the loop has floating induction variable +/// then insert corresponding integer induction variable if possible. +void IndVarSimplify::HandleFloatingPointIV(Loop *L) { + BasicBlock *Header = L->getHeader(); + SmallVector FPHIs; + Instruction *NonPHIInsn = NULL; + + // Collect all floating point IVs first. + BasicBlock::iterator I = Header->begin(); + while(true) { + if (!isa(I)) { + NonPHIInsn = I; + break; + } + PHINode *PH = cast(I); + if (PH->getType()->isFloatingPoint()) + FPHIs.push_back(PH); + ++I; + } + + for (SmallVector::iterator I = FPHIs.begin(), E = FPHIs.end(); + I != E; ++I) { + PHINode *PH = *I; + unsigned IncomingEdge = L->contains(PH->getIncomingBlock(0)); + unsigned BackEdge = IncomingEdge^1; + + // Check incoming value. + ConstantFP *CZ = dyn_cast(PH->getIncomingValue(IncomingEdge)); + if (!CZ) continue; + APFloat PHInit = CZ->getValueAPF(); + if (!PHInit.isPosZero()) continue; + + // Check IV increment. + BinaryOperator *Incr = + dyn_cast(PH->getIncomingValue(BackEdge)); + if (!Incr) continue; + if (Incr->getOpcode() != Instruction::Add) continue; + ConstantFP *IncrValue = NULL; + unsigned IncrVIndex = 1; + if (Incr->getOperand(1) == PH) + IncrVIndex = 0; + IncrValue = dyn_cast(Incr->getOperand(IncrVIndex)); + if (!IncrValue) continue; + APFloat IVAPF = IncrValue->getValueAPF(); + APFloat One = APFloat(IVAPF.getSemantics(), 1); + if (!IVAPF.bitwiseIsEqual(One)) continue; + + // Check Incr uses. + Value::use_iterator IncrUse = Incr->use_begin(); + Instruction *U1 = cast(IncrUse++); + if (IncrUse == Incr->use_end()) continue; + Instruction *U2 = cast(IncrUse++); + if (IncrUse != Incr->use_end()) continue; + + // Find exict condition. + FCmpInst *EC = dyn_cast(U1); + if (!EC) + EC = dyn_cast(U2); + if (!EC) continue; + bool skip = false; + Instruction *Terminator = EC->getParent()->getTerminator(); + for(Value::use_iterator ECUI = EC->use_begin(), ECUE = EC->use_end(); + ECUI != ECUE; ++ECUI) { + Instruction *U = cast(ECUI); + if (U != Terminator) { + skip = true; + break; + } + } + if (skip) continue; + + // Find exit value. + ConstantFP *EV = NULL; + unsigned EVIndex = 1; + if (EC->getOperand(1) == Incr) + EVIndex = 0; + EV = dyn_cast(EC->getOperand(EVIndex)); + if (!EV) continue; + APFloat EVAPF = EV->getValueAPF(); + if (EVAPF.isNegative()) continue; + + // Find corresponding integer exit value. + uint64_t integerVal = Type::Int32Ty->getPrimitiveSizeInBits(); + bool isExact = false; + if (EVAPF.convertToInteger(&integerVal, 32, false, APFloat::rmTowardZero, &isExact) + != APFloat::opOK) + continue; + if (!isExact) continue; + + // Find new predicate for integer comparison. + CmpInst::Predicate NewPred = CmpInst::BAD_ICMP_PREDICATE; + switch (EC->getPredicate()) { + case CmpInst::FCMP_OEQ: + case CmpInst::FCMP_UEQ: + NewPred = CmpInst::ICMP_EQ; + break; + case CmpInst::FCMP_OGT: + case CmpInst::FCMP_UGT: + NewPred = CmpInst::ICMP_UGT; + break; + case CmpInst::FCMP_OGE: + case CmpInst::FCMP_UGE: + NewPred = CmpInst::ICMP_UGE; + break; + case CmpInst::FCMP_OLT: + case CmpInst::FCMP_ULT: + NewPred = CmpInst::ICMP_ULT; + break; + case CmpInst::FCMP_OLE: + case CmpInst::FCMP_ULE: + NewPred = CmpInst::ICMP_ULE; + break; + default: + break; + } + if (NewPred == CmpInst::BAD_ICMP_PREDICATE) continue; + + // Insert new integer induction variable. + SCEVExpander Rewriter(*SE, *LI); + PHINode *NewIV = + cast(Rewriter.getOrInsertCanonicalInductionVariable(L,Type::Int32Ty)); + ConstantInt *NewEV = ConstantInt::get(Type::Int32Ty, integerVal); + Value *LHS = (EVIndex == 1 ? NewIV->getIncomingValue(BackEdge) : NewEV); + Value *RHS = (EVIndex == 1 ? NewEV : NewIV->getIncomingValue(BackEdge)); + ICmpInst *NewEC = new ICmpInst(NewPred, LHS, RHS, EC->getNameStart(), + EC->getParent()->getTerminator()); + + // Delete old, floating point, exit comparision instruction. + SE->deleteValueFromRecords(EC); + EC->replaceAllUsesWith(NewEC); + EC->eraseFromParent(); + + // Delete old, floating point, increment instruction. + SE->deleteValueFromRecords(Incr); + Incr->replaceAllUsesWith(UndefValue::get(Incr->getType())); + Incr->eraseFromParent(); + + // Replace floating induction variable. + UIToFPInst *Conv = new UIToFPInst(NewIV, PH->getType(), "indvar.conv", + NonPHIInsn); + PH->replaceAllUsesWith(Conv); + + SE->deleteValueFromRecords(PH); + PH->removeIncomingValue((unsigned)0); + PH->removeIncomingValue((unsigned)0); + } +} + Added: llvm/trunk/test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll?rev=58625&view=auto ============================================================================== --- llvm/trunk/test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll (added) +++ llvm/trunk/test/Transforms/IndVarsSimplify/2008-11-03-Floating.ll Mon Nov 3 12:32:19 2008 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep icmp | count 1 +define void @bar() nounwind { +entry: + br label %bb + +bb: ; preds = %bb, %entry + %x.0.reg2mem.0 = phi double [ 0.000000e+00, %entry ], [ %1, %bb ] ; [#uses=2] + %0 = tail call i32 @foo(double %x.0.reg2mem.0) nounwind ; [#uses=0] + %1 = add double %x.0.reg2mem.0, 1.000000e+00 ; [#uses=2] + %2 = fcmp olt double %1, 1.000000e+04 ; [#uses=1] + br i1 %2, label %bb, label %return + +return: ; preds = %bb + ret void +} + +declare i32 @foo(double) From grosbach at apple.com Mon Nov 3 12:38:32 2008 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 03 Nov 2008 18:38:32 -0000 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td Message-ID: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> Author: grosbach Date: Mon Nov 3 12:38:31 2008 New Revision: 58626 URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev Log: Add binary encoding support for multiply instructions. Some blanks left to fill in, but the basics are there. Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.h llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 12:38:31 2008 @@ -82,8 +82,8 @@ const TargetInstrDesc &TID, const MachineOperand &MO); - unsigned getAddrMode1SBit(const MachineInstr &MI, - const TargetInstrDesc &TID) const; + unsigned getAddrModeSBit(const MachineInstr &MI, + const TargetInstrDesc &TID) const; unsigned getAddrMode1InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, @@ -97,6 +97,9 @@ unsigned getAddrMode4InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary); + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &TID, + unsigned Binary); /// getInstrBinary - Return binary encoding for the specified /// machine instruction. @@ -432,8 +435,8 @@ return Binary; } -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, - const TargetInstrDesc &TID) const { +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, + const TargetInstrDesc &TID) const { for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); i != e; --i){ const MachineOperand &MO = MI.getOperand(i-1); if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) @@ -449,7 +452,7 @@ Binary |= II->getPredicate(&MI) << 28; // Encode S bit if MI modifies CPSR. - Binary |= getAddrMode1SBit(MI, TID); + Binary |= getAddrModeSBit(MI, TID); // Encode register def if there is one. unsigned NumDefs = TID.getNumDefs(); @@ -618,6 +621,33 @@ return Binary; } +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &TID, + unsigned Binary) { + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; + + // Encode S bit if MI modifies CPSR. + Binary |= getAddrModeSBit(MI, TID); + + // 32x32->64bit operations have two destination registers. The number + // of register definitions will tell us if that's what we're dealing with. + int OpIdx = 0; + if (TID.getNumDefs() == 2) + Binary |= getMachineOpValue (MI, OpIdx++) << ARMII::RegRdLoShift; + + // Encode Rd + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRdHiShift; + + // Encode Rm + Binary |= getMachineOpValue(MI, OpIdx++); + + // Encode Rs + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; + + return Binary; +} + /// getInstrBinary - Return binary encoding for the specified /// machine instruction. unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { @@ -636,6 +666,8 @@ return getAddrMode3InstrBinary(MI, TID, Binary); case ARMII::AddrMode4: return getAddrMode4InstrBinary(MI, TID, Binary); + case ARMII::AddrMode6: + return getAddrMode6InstrBinary(MI, TID, Binary); } abort(); Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 12:38:31 2008 @@ -659,6 +659,28 @@ let Inst{27-25} = 0b100; } +// addrmode6 +// Unsigned multiply, multiply-accumulate instructions. +class AI6 opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I +{ + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) + let Inst{7-4} = 0b1001; + let Inst{27-24} = 0b0000; + let Inst{23-20} = opcod; +} +class AsI6 opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : sI +{ + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) + let Inst{7-4} = 0b1001; + let Inst{27-24} = 0b0000; + let Inst{23-20} = opcod; +} //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 2008 @@ -30,8 +30,7 @@ // Instruction Flags. //===------------------------------------------------------------------===// - // This three-bit field describes the addressing mode used. Zero is unused - // so that we can tell if we forgot to set a value. + // This four-bit field describes the addressing mode used. AddrModeMask = 0xf, AddrModeNone = 0, @@ -40,10 +39,11 @@ AddrMode3 = 3, AddrMode4 = 4, AddrMode5 = 5, - AddrModeT1 = 6, - AddrModeT2 = 7, - AddrModeT4 = 8, - AddrModeTs = 9, // i8 * 4 for pc and sp relative data + AddrMode6 = 6, + AddrModeT1 = 7, + AddrModeT2 = 8, + AddrModeT4 = 9, + AddrModeTs = 10, // i8 * 4 for pc and sp relative data // Size* - Flags to keep track of the size of an instruction. SizeShift = 4, @@ -115,15 +115,17 @@ // Field shifts - such shifts are used to set field while generating // machine instructions. - RotImmShift = 8, - RegRsShift = 8, - RegRdShift = 12, - RegRnShift = 16, - L_BitShift = 20, - S_BitShift = 20, - U_BitShift = 23, - IndexShift = 24, - I_BitShift = 25 + RotImmShift = 8, + RegRsShift = 8, + RegRdLoShift = 12, + RegRdShift = 12, + RegRdHiShift = 16, + RegRnShift = 16, + L_BitShift = 20, + S_BitShift = 20, + U_BitShift = 23, + IndexShift = 24, + I_BitShift = 25 }; } Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 2008 @@ -310,10 +310,11 @@ def AddrMode3 : AddrMode<3>; def AddrMode4 : AddrMode<4>; def AddrMode5 : AddrMode<5>; -def AddrModeT1 : AddrMode<6>; -def AddrModeT2 : AddrMode<7>; -def AddrModeT4 : AddrMode<8>; -def AddrModeTs : AddrMode<9>; +def AddrMode6 : AddrMode<6>; +def AddrModeT1 : AddrMode<7>; +def AddrModeT2 : AddrMode<8>; +def AddrModeT4 : AddrMode<9>; +def AddrModeTs : AddrMode<10>; // Instruction size. class SizeFlagVal val> { @@ -910,49 +911,53 @@ // Multiply Instructions. // -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, - "mul", " $dst, $a, $b", - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; - -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), - MulFrm, "mla", " $dst, $a, $b, $c", - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>; +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, + "mul", " $dst, $a, $b", + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; + +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), + MulFrm, "mla", " $dst, $a, $b, $c", + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>; // Extra precision multiplies with low / high results -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; // Multiply + accumulate -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), MulFrm, - "umaal", " $ldst, $hdst, $a, $b", []>, - Requires<[IsARM, HasV6]>; +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR:$b), + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, + Requires<[IsARM, HasV6]>; // Most significant word multiply +// FIXME: encoding def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, "smmul", " $dst, $a, $b", [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, Requires<[IsARM, HasV6]>; +// FIXME: encoding def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), MulFrm, "smmla", " $dst, $a, $b, $c", [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR:$c))]>, Requires<[IsARM, HasV6]>; +// FIXME: encoding def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), MulFrm, "smmls", " $dst, $a, $b, $c", [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR:$b)))]>, Requires<[IsARM, HasV6]>; +// FIXME: encoding multiclass AI_smul { def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, !strconcat(opc, "bb"), " $dst, $a, $b", @@ -992,6 +997,7 @@ } +// FIXME: encoding multiclass AI_smla { def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), MulSMLA, !strconcat(opc, "bb"), " $dst, $a, $b, $acc", @@ -1031,7 +1037,9 @@ Requires<[IsARM, HasV5TE]>; } +// FIXME: encoding defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>; +// FIXME: encoding defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>; // TODO: Halfword multiple accumulate long: SMLAL From evan.cheng at apple.com Mon Nov 3 12:39:14 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 3 Nov 2008 10:39:14 -0800 Subject: [llvm-commits] [llvm] r58591 - /llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp In-Reply-To: <200811030233.mA32XSLO031832@zion.cs.uiuc.edu> References: <200811030233.mA32XSLO031832@zion.cs.uiuc.edu> Message-ID: Thanks. Your check was overly restrictive. The proper check needs if any bb that's part of the live ranges defined by the val# can be reached from the def instruction and the restore instruction. I see one of the following solutions: 1. Walk the cfg from both def mbb and barrier mbb and look for new joins. This is potentially expensive so perhaps we can cache the information for live interval shrink wrapping? 2. Detect this during live interval shrink wrapping and introduce a new val# to define the joined portion and mark old and new val# as hasPHIKill. 3. Detect this during live interval shrink wrapping and undo all the changes? Seems to me #2 is the ideal solution unless #1 turns out to be relative cheap. Evan On Nov 2, 2008, at 6:33 PM, Owen Anderson wrote: > Author: resistor > Date: Sun Nov 2 20:33:28 2008 > New Revision: 58591 > > URL: http://llvm.org/viewvc/llvm-project?rev=58591&view=rev > Log: > Revert my last patch until I consult with Evan about it. > > Modified: > llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp > > Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=58591&r1=58590&r2=58591&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) > +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Sun Nov 2 20:33:28 > 2008 > @@ -89,8 +89,6 @@ > AU.addPreservedID(StrongPHIEliminationID); > else > AU.addPreservedID(PHIEliminationID); > - AU.addRequired(); > - AU.addPreserved(); > MachineFunctionPass::getAnalysisUsage(AU); > } > > @@ -635,14 +633,6 @@ > assert(0 && "Val# is defined by a dead def?"); > abort(); > } > - > - // Pre-splitting a vreg that does not have a PHI kill across a > barrier > - // that is within a loop can potentially create a join that was not > - // present before, which would make updating the live intervals > very > - // difficult. Bailout instead. > - MachineLoopInfo& MLI = getAnalysis(); > - if (!ValNo->hasPHIKill && MLI.getLoopFor(BarrierMBB)) > - return false; > > // FIXME: For now, if definition is rematerializable, do not split. > MachineInstr *DefMI = (ValNo->def != ~0U) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From kremenek at apple.com Mon Nov 3 12:53:22 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 03 Nov 2008 18:53:22 -0000 Subject: [llvm-commits] [llvm] r58627 - /llvm/tags/checker/checker-121/ Message-ID: <200811031853.mA3IrMDu020438@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 12:53:21 2008 New Revision: 58627 URL: http://llvm.org/viewvc/llvm-project?rev=58627&view=rev Log: Tagging checker-121. Added: llvm/tags/checker/checker-121/ - copied from r58626, llvm/trunk/ From wendling at apple.com Mon Nov 3 13:11:28 2008 From: wendling at apple.com (Bill Wendling) Date: Mon, 3 Nov 2008 11:11:28 -0800 Subject: [llvm-commits] Recent apple changes broke the Ada build In-Reply-To: <04263C73-375B-4CEE-88E8-40E4281139A9@apple.com> References: <200811030930.20704.duncan.sands@math.u-psud.fr> <04263C73-375B-4CEE-88E8-40E4281139A9@apple.com> Message-ID: <47C33C69-6490-4B1D-9595-8B0417FEB0EC@apple.com> Hi Duncan, Sorry about the breakage. We're trying to be more diligent about not breaking non-C-based languages. I'll look into this. -bw On Nov 3, 2008, at 4:11 AM, Chris Lattner wrote: > > On Nov 3, 2008, at 12:30 AM, Duncan Sands wrote: > >> Hi Bill, I'm getting these errors when building Ada: > > Fariborz, can you please investigate genericizing, #ifdef'ing, or > stubbing these? Thanks, > > -Chris > > >> >> >> libbackend.a(dwarf2out.o): In function `add_type_attribute': >> gcc/dwarf2out.c:11732: undefined reference to >> `generic_block_literal_struct_type' >> libbackend.a(gtype-desc.o):(.rodata+0x9f8): undefined reference to >> `generic_block_literal_struct_type' >> libbackend.a(tree.o): In function `build_block_pointer_type': >> gcc/tree.c:5112: undefined reference to >> `generic_block_literal_struct_type' >> gcc/tree.c:5113: undefined reference to >> `build_generic_block_struct_type' >> gcc/tree.c:5113: undefined reference to >> `generic_block_literal_struct_type' >> >> Can you please take care of it. I understand that you can't >> reasonably >> try to build Ada before committing, but maybe in the future you can >> check >> that Fortran builds (both languages usually fail to build when >> Apple changes >> put C stuff in non-C places): it should just be a matter of adding >> "fortran" >> to --enable-languages=. Since Fortran is (hopefully) going to be >> included in >> the next release, it would anyway be good to regularly test Fortran. >> >> Ciao, >> >> Duncan. >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From evan.cheng at apple.com Mon Nov 3 13:17:29 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 3 Nov 2008 11:17:29 -0800 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td In-Reply-To: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> References: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> Message-ID: Thanks. But is addrmode6 the right name? I don't see ARM manuals using that name. Evan On Nov 3, 2008, at 10:38 AM, Jim Grosbach wrote: > Author: grosbach > Date: Mon Nov 3 12:38:31 2008 > New Revision: 58626 > > URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev > Log: > Add binary encoding support for multiply instructions. Some blanks > left to fill in, but the basics are there. > > Modified: > llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp > llvm/trunk/lib/Target/ARM/ARMInstrFormats.td > llvm/trunk/lib/Target/ARM/ARMInstrInfo.h > llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > > Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 12:38:31 > 2008 > @@ -82,8 +82,8 @@ > const TargetInstrDesc &TID, > const MachineOperand &MO); > > - unsigned getAddrMode1SBit(const MachineInstr &MI, > - const TargetInstrDesc &TID) const; > + unsigned getAddrModeSBit(const MachineInstr &MI, > + const TargetInstrDesc &TID) const; > > unsigned getAddrMode1InstrBinary(const MachineInstr &MI, > const TargetInstrDesc &TID, > @@ -97,6 +97,9 @@ > unsigned getAddrMode4InstrBinary(const MachineInstr &MI, > const TargetInstrDesc &TID, > unsigned Binary); > + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, > + const TargetInstrDesc &TID, > + unsigned Binary); > > /// getInstrBinary - Return binary encoding for the specified > /// machine instruction. > @@ -432,8 +435,8 @@ > return Binary; > } > > -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, > - const TargetInstrDesc > &TID) const { > +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, > + const TargetInstrDesc > &TID) const { > for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); > i != e; --i){ > const MachineOperand &MO = MI.getOperand(i-1); > if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) > @@ -449,7 +452,7 @@ > Binary |= II->getPredicate(&MI) << 28; > > // Encode S bit if MI modifies CPSR. > - Binary |= getAddrMode1SBit(MI, TID); > + Binary |= getAddrModeSBit(MI, TID); > > // Encode register def if there is one. > unsigned NumDefs = TID.getNumDefs(); > @@ -618,6 +621,33 @@ > return Binary; > } > > +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const MachineInstr > &MI, > + const > TargetInstrDesc &TID, > + unsigned Binary) { > + // Set the conditional execution predicate > + Binary |= II->getPredicate(&MI) << 28; > + > + // Encode S bit if MI modifies CPSR. > + Binary |= getAddrModeSBit(MI, TID); > + > + // 32x32->64bit operations have two destination registers. The > number > + // of register definitions will tell us if that's what we're > dealing with. > + int OpIdx = 0; > + if (TID.getNumDefs() == 2) > + Binary |= getMachineOpValue (MI, OpIdx++) << ARMII::RegRdLoShift; > + > + // Encode Rd > + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRdHiShift; > + > + // Encode Rm > + Binary |= getMachineOpValue(MI, OpIdx++); > + > + // Encode Rs > + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; > + > + return Binary; > +} > + > /// getInstrBinary - Return binary encoding for the specified > /// machine instruction. > unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { > @@ -636,6 +666,8 @@ > return getAddrMode3InstrBinary(MI, TID, Binary); > case ARMII::AddrMode4: > return getAddrMode4InstrBinary(MI, TID, Binary); > + case ARMII::AddrMode6: > + return getAddrMode6InstrBinary(MI, TID, Binary); > } > > abort(); > > Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 12:38:31 > 2008 > @@ -659,6 +659,28 @@ > let Inst{27-25} = 0b100; > } > > +// addrmode6 > +// Unsigned multiply, multiply-accumulate instructions. > +class AI6 opcod, dag oops, dag iops, Format f, string opc, > + string asm, list pattern> > + : I opc, > + asm,"",pattern> > +{ > + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) > + let Inst{7-4} = 0b1001; > + let Inst{27-24} = 0b0000; > + let Inst{23-20} = opcod; > +} > +class AsI6 opcod, dag oops, dag iops, Format f, string opc, > + string asm, list pattern> > + : sI opc, > + asm,"",pattern> > +{ > + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) > + let Inst{7-4} = 0b1001; > + let Inst{27-24} = 0b0000; > + let Inst{23-20} = opcod; > +} > > // > = > = > = > ----------------------------------------------------------------------= > ==// > > > Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 2008 > @@ -30,8 +30,7 @@ > // Instruction Flags. > > // > ===------------------------------------------------------------------ > ===// > - // This three-bit field describes the addressing mode used. > Zero is unused > - // so that we can tell if we forgot to set a value. > + // This four-bit field describes the addressing mode used. > > AddrModeMask = 0xf, > AddrModeNone = 0, > @@ -40,10 +39,11 @@ > AddrMode3 = 3, > AddrMode4 = 4, > AddrMode5 = 5, > - AddrModeT1 = 6, > - AddrModeT2 = 7, > - AddrModeT4 = 8, > - AddrModeTs = 9, // i8 * 4 for pc and sp relative data > + AddrMode6 = 6, > + AddrModeT1 = 7, > + AddrModeT2 = 8, > + AddrModeT4 = 9, > + AddrModeTs = 10, // i8 * 4 for pc and sp relative data > > // Size* - Flags to keep track of the size of an instruction. > SizeShift = 4, > @@ -115,15 +115,17 @@ > > // Field shifts - such shifts are used to set field while > generating > // machine instructions. > - RotImmShift = 8, > - RegRsShift = 8, > - RegRdShift = 12, > - RegRnShift = 16, > - L_BitShift = 20, > - S_BitShift = 20, > - U_BitShift = 23, > - IndexShift = 24, > - I_BitShift = 25 > + RotImmShift = 8, > + RegRsShift = 8, > + RegRdLoShift = 12, > + RegRdShift = 12, > + RegRdHiShift = 16, > + RegRnShift = 16, > + L_BitShift = 20, > + S_BitShift = 20, > + U_BitShift = 23, > + IndexShift = 24, > + I_BitShift = 25 > }; > } > > > Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 2008 > @@ -310,10 +310,11 @@ > def AddrMode3 : AddrMode<3>; > def AddrMode4 : AddrMode<4>; > def AddrMode5 : AddrMode<5>; > -def AddrModeT1 : AddrMode<6>; > -def AddrModeT2 : AddrMode<7>; > -def AddrModeT4 : AddrMode<8>; > -def AddrModeTs : AddrMode<9>; > +def AddrMode6 : AddrMode<6>; > +def AddrModeT1 : AddrMode<7>; > +def AddrModeT2 : AddrMode<8>; > +def AddrModeT4 : AddrMode<9>; > +def AddrModeTs : AddrMode<10>; > > // Instruction size. > class SizeFlagVal val> { > @@ -910,49 +911,53 @@ > // Multiply Instructions. > // > > -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, > - "mul", " $dst, $a, $b", > - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; > - > -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), > - MulFrm, "mla", " $dst, $a, $b, $c", > - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>; > +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), > MulFrm, > + "mul", " $dst, $a, $b", > + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; > + > +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR: > $c), > + MulFrm, "mla", " $dst, $a, $b, $c", > + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: > $c))]>; > > // Extra precision multiplies with low / high results > -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: > $b), > - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; > +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, > GPR:$b), > + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; > > -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: > $b), > - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; > +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, > GPR:$b), > + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; > > // Multiply + accumulate > -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: > $b), > - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; > +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, > GPR:$b), > + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; > > -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: > $b), > - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; > +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, > GPR:$b), > + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; > > -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: > $b), MulFrm, > - "umaal", " $ldst, $hdst, $a, $b", []>, > - Requires<[IsARM, HasV6]>; > +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, > GPR:$b), > + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, > + Requires<[IsARM, HasV6]>; > > // Most significant word multiply > +// FIXME: encoding > def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, > "smmul", " $dst, $a, $b", > [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, > Requires<[IsARM, HasV6]>; > > +// FIXME: encoding > def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), > MulFrm, > "smmla", " $dst, $a, $b, $c", > [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR: > $c))]>, > Requires<[IsARM, HasV6]>; > > > +// FIXME: encoding > def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), > MulFrm, > "smmls", " $dst, $a, $b, $c", > [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR: > $b)))]>, > Requires<[IsARM, HasV6]>; > > +// FIXME: encoding > multiclass AI_smul { > def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, > !strconcat(opc, "bb"), " $dst, $a, $b", > @@ -992,6 +997,7 @@ > } > > > +// FIXME: encoding > multiclass AI_smla { > def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), > MulSMLA, > !strconcat(opc, "bb"), " $dst, $a, $b, $acc", > @@ -1031,7 +1037,9 @@ > Requires<[IsARM, HasV5TE]>; > } > > +// FIXME: encoding > defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>; > +// FIXME: encoding > defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>; > > // TODO: Halfword multiple accumulate long: SMLAL > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Mon Nov 3 13:25:40 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 3 Nov 2008 11:25:40 -0800 Subject: [llvm-commits] [llvm] r58615 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp In-Reply-To: <200811031605.mA3G5amA009446@zion.cs.uiuc.edu> References: <200811031605.mA3G5amA009446@zion.cs.uiuc.edu> Message-ID: <16e5fdf90811031125h3c26db92rd0b86dd98bc74ade@mail.gmail.com> On Mon, Nov 3, 2008 at 8:05 AM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Mon Nov 3 10:05:35 2008 > New Revision: 58615 > > URL: http://llvm.org/viewvc/llvm-project?rev=58615&view=rev > Log: > Ensure that we are checking only calls to the function we are interested in specializing > > Modified: > llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp > > Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=58615&r1=58614&r2=58615&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Mon Nov 3 10:05:35 2008 > @@ -165,14 +165,16 @@ > } > } > > +/// scanDistribution - Construct a histogram of constants for arg of F at arg Period at the end of the comment? ;-) -bw From andrewl at lenharth.org Mon Nov 3 13:28:24 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Mon, 3 Nov 2008 13:28:24 -0600 Subject: [llvm-commits] [llvm] r58615 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp In-Reply-To: <16e5fdf90811031125h3c26db92rd0b86dd98bc74ade@mail.gmail.com> References: <200811031605.mA3G5amA009446@zion.cs.uiuc.edu> <16e5fdf90811031125h3c26db92rd0b86dd98bc74ade@mail.gmail.com> Message-ID: <85dfcd7f0811031128h5510cc41j305c1c9f3d4d77d7@mail.gmail.com> On Mon, Nov 3, 2008 at 1:25 PM, Bill Wendling wrote: > Period at the end of the comment? ;-) As though that were a well formed sentence... ;) Andrew From alenhar2 at cs.uiuc.edu Mon Nov 3 13:29:30 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 03 Nov 2008 19:29:30 -0000 Subject: [llvm-commits] [llvm] r58630 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Message-ID: <200811031929.mA3JTUO7022609@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Nov 3 13:29:29 2008 New Revision: 58630 URL: http://llvm.org/viewvc/llvm-project?rev=58630&view=rev Log: add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy... Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=58630&r1=58629&r2=58630&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Mon Nov 3 13:29:29 2008 @@ -165,7 +165,7 @@ } } -/// scanDistribution - Construct a histogram of constants for arg of F at arg +/// scanDistribution - Construct a histogram of constants for arg of F at arg. int PartSpec::scanDistribution(Function& F, int arg, std::map& dist) { bool hasIndirect = false; From dpatel at apple.com Mon Nov 3 13:38:07 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 03 Nov 2008 19:38:07 -0000 Subject: [llvm-commits] [llvm] r58631 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnswitch.cpp test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll Message-ID: <200811031938.mA3Jc768023118@zion.cs.uiuc.edu> Author: dpatel Date: Mon Nov 3 13:38:07 2008 New Revision: 58631 URL: http://llvm.org/viewvc/llvm-project?rev=58631&view=rev Log: Ignore conditions that are outside the loop. Added: llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=58631&r1=58630&r2=58631&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Nov 3 13:38:07 2008 @@ -167,8 +167,10 @@ // TODO: Handle: br (VARIANT|INVARIANT). // TODO: Hoist simple expressions out of loops. - if (L->isLoopInvariant(Cond)) return Cond; - + if (Instruction *I = dyn_cast(Cond)) + if (!L->contains(I->getParent())) + return 0; + if (BinaryOperator *BO = dyn_cast(Cond)) if (BO->getOpcode() == Instruction::And || BO->getOpcode() == Instruction::Or) { Added: llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll?rev=58631&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll (added) +++ llvm/trunk/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll Mon Nov 3 13:38:07 2008 @@ -0,0 +1,47 @@ +; RUN: llvm-as < %s | opt -loop-unswitch -stats | not grep loop-unswitch + + +define void @test_fc_while_continue_or(float %x, float %y, float* %result) nounwind { +entry: + br label %bb2.outer + +bb: ; preds = %bb2 + %0 = add float %5, %z.0 ; [#uses=3] + %1 = fcmp oeq float %0, 0.000000e+00 ; [#uses=1] + br i1 %1, label %bb2, label %bb1 + +bb1: ; preds = %bb + %.lcssa = phi float [ %0, %bb ] ; [#uses=1] + %z.0.lcssa1 = phi float [ %z.0, %bb ] ; [#uses=0] + %2 = add float %x_addr.0.ph, 1.000000e+00 ; [#uses=1] + br label %bb2.outer + +bb2.outer: ; preds = %bb1, %entry + %z.0.ph = phi float [ 0.000000e+00, %entry ], [ %.lcssa, %bb1 ] ; [#uses=1] + %x_addr.0.ph = phi float [ %x, %entry ], [ %2, %bb1 ] ; [#uses=3] + %3 = fcmp une float %x_addr.0.ph, 0.000000e+00 ; [#uses=1] + %4 = fcmp une float %y, 0.000000e+00 ; [#uses=1] + %or.cond = or i1 %3, %4 ; [#uses=1] + %5 = mul float %x_addr.0.ph, %y ; [#uses=1] + br label %bb2 + +bb2: ; preds = %bb2.outer, %bb + %z.0 = phi float [ %0, %bb ], [ %z.0.ph, %bb2.outer ] ; [#uses=3] + br i1 %or.cond, label %bb, label %bb4 + +bb4: ; preds = %bb2 + %z.0.lcssa = phi float [ %z.0, %bb2 ] ; [#uses=1] + store float %z.0.lcssa, float* %result, align 4 + ret void +} + +define i32 @main() nounwind { +entry: + %z = alloca [10 x i32] ; <[10 x i32]*> [#uses=2] + %0 = call i32 (...)* @test_fc_while_or(i32 0, i32 0, [10 x i32]* %z) nounwind ; [#uses=0] + %1 = getelementptr [10 x i32]* %z, i32 0, i32 0 ; [#uses=1] + %2 = load i32* %1, align 4 ; [#uses=1] + ret i32 %2 +} + +declare i32 @test_fc_while_or(...) From gohman at apple.com Mon Nov 3 13:40:18 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 19:40:18 -0000 Subject: [llvm-commits] [llvm] r58632 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp Message-ID: <200811031940.mA3JeIIw023296@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 13:40:18 2008 New Revision: 58632 URL: http://llvm.org/viewvc/llvm-project?rev=58632&view=rev Log: Overload AddInteger on int/long/long long instead of on int/int64_t, to avoid overload ambiguities. This fixes build errors introduced by r58623. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h llvm/trunk/lib/Support/FoldingSet.cpp Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=58632&r1=58631&r2=58632&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Nov 3 13:40:18 2008 @@ -221,8 +221,10 @@ void AddPointer(const void *Ptr); void AddInteger(signed I); void AddInteger(unsigned I); - void AddInteger(int64_t I); - void AddInteger(uint64_t I); + void AddInteger(long I); + void AddInteger(unsigned long I); + void AddInteger(long long I); + void AddInteger(unsigned long long I); void AddFloat(float F); void AddDouble(double D); void AddString(const std::string &String); Modified: llvm/trunk/lib/Support/FoldingSet.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=58632&r1=58631&r2=58632&view=diff ============================================================================== --- llvm/trunk/lib/Support/FoldingSet.cpp (original) +++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Nov 3 13:40:18 2008 @@ -41,13 +41,23 @@ void FoldingSetNodeID::AddInteger(unsigned I) { Bits.push_back(I); } -void FoldingSetNodeID::AddInteger(int64_t I) { - AddInteger((uint64_t)I); +void FoldingSetNodeID::AddInteger(long I) { + AddInteger((unsigned long)I); } -void FoldingSetNodeID::AddInteger(uint64_t I) { - Bits.push_back(unsigned(I)); - - // If the integer is small, encode it just as 32-bits. +void FoldingSetNodeID::AddInteger(unsigned long I) { + if (sizeof(long) == sizeof(int)) + AddInteger(unsigned(I)); + else if (sizeof(long) == sizeof(long long)) { + AddInteger((unsigned long long)I); + } else { + assert(0 && "unexpected sizeof(long)"); + } +} +void FoldingSetNodeID::AddInteger(long long I) { + AddInteger((unsigned long long)I); +} +void FoldingSetNodeID::AddInteger(unsigned long long I) { + AddInteger(unsigned(I)); if ((uint64_t)(int)I != I) Bits.push_back(unsigned(I >> 32)); } From grosbach at apple.com Mon Nov 3 13:41:27 2008 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 3 Nov 2008 11:41:27 -0800 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td In-Reply-To: References: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> Message-ID: <11542DAB-355C-4414-87BE-13A31708DF6D@apple.com> I have no real preference for what name to use. I chose that to be consistent with the other operations doing similar things (choosing how to encode operands for a class of instructions). If there's an alternative nomenclature that's preferable, that's fine with me. On Nov 3, 2008, at 11:17 AM, Evan Cheng wrote: > Thanks. But is addrmode6 the right name? I don't see ARM manuals using > that name. > > Evan > > On Nov 3, 2008, at 10:38 AM, Jim Grosbach wrote: > >> Author: grosbach >> Date: Mon Nov 3 12:38:31 2008 >> New Revision: 58626 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev >> Log: >> Add binary encoding support for multiply instructions. Some blanks >> left to fill in, but the basics are there. >> >> Modified: >> llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >> llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >> llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >> llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >> >> Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 12:38:31 >> 2008 >> @@ -82,8 +82,8 @@ >> const TargetInstrDesc &TID, >> const MachineOperand &MO); >> >> - unsigned getAddrMode1SBit(const MachineInstr &MI, >> - const TargetInstrDesc &TID) const; >> + unsigned getAddrModeSBit(const MachineInstr &MI, >> + const TargetInstrDesc &TID) const; >> >> unsigned getAddrMode1InstrBinary(const MachineInstr &MI, >> const TargetInstrDesc &TID, >> @@ -97,6 +97,9 @@ >> unsigned getAddrMode4InstrBinary(const MachineInstr &MI, >> const TargetInstrDesc &TID, >> unsigned Binary); >> + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, >> + const TargetInstrDesc &TID, >> + unsigned Binary); >> >> /// getInstrBinary - Return binary encoding for the specified >> /// machine instruction. >> @@ -432,8 +435,8 @@ >> return Binary; >> } >> >> -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, >> - const TargetInstrDesc >> &TID) const { >> +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, >> + const TargetInstrDesc >> &TID) const { >> for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); >> i != e; --i){ >> const MachineOperand &MO = MI.getOperand(i-1); >> if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) >> @@ -449,7 +452,7 @@ >> Binary |= II->getPredicate(&MI) << 28; >> >> // Encode S bit if MI modifies CPSR. >> - Binary |= getAddrMode1SBit(MI, TID); >> + Binary |= getAddrModeSBit(MI, TID); >> >> // Encode register def if there is one. >> unsigned NumDefs = TID.getNumDefs(); >> @@ -618,6 +621,33 @@ >> return Binary; >> } >> >> +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const MachineInstr >> &MI, >> + const >> TargetInstrDesc &TID, >> + unsigned Binary) { >> + // Set the conditional execution predicate >> + Binary |= II->getPredicate(&MI) << 28; >> + >> + // Encode S bit if MI modifies CPSR. >> + Binary |= getAddrModeSBit(MI, TID); >> + >> + // 32x32->64bit operations have two destination registers. The >> number >> + // of register definitions will tell us if that's what we're >> dealing with. >> + int OpIdx = 0; >> + if (TID.getNumDefs() == 2) >> + Binary |= getMachineOpValue (MI, OpIdx++) << >> ARMII::RegRdLoShift; >> + >> + // Encode Rd >> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRdHiShift; >> + >> + // Encode Rm >> + Binary |= getMachineOpValue(MI, OpIdx++); >> + >> + // Encode Rs >> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; >> + >> + return Binary; >> +} >> + >> /// getInstrBinary - Return binary encoding for the specified >> /// machine instruction. >> unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { >> @@ -636,6 +666,8 @@ >> return getAddrMode3InstrBinary(MI, TID, Binary); >> case ARMII::AddrMode4: >> return getAddrMode4InstrBinary(MI, TID, Binary); >> + case ARMII::AddrMode6: >> + return getAddrMode6InstrBinary(MI, TID, Binary); >> } >> >> abort(); >> >> Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) >> +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 12:38:31 >> 2008 >> @@ -659,6 +659,28 @@ >> let Inst{27-25} = 0b100; >> } >> >> +// addrmode6 >> +// Unsigned multiply, multiply-accumulate instructions. >> +class AI6 opcod, dag oops, dag iops, Format f, string opc, >> + string asm, list pattern> >> + : I> opc, >> + asm,"",pattern> >> +{ >> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) >> + let Inst{7-4} = 0b1001; >> + let Inst{27-24} = 0b0000; >> + let Inst{23-20} = opcod; >> +} >> +class AsI6 opcod, dag oops, dag iops, Format f, string opc, >> + string asm, list pattern> >> + : sI> opc, >> + asm,"",pattern> >> +{ >> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) >> + let Inst{7-4} = 0b1001; >> + let Inst{27-24} = 0b0000; >> + let Inst{23-20} = opcod; >> +} >> >> // >> = >> = >> = >> ----------------------------------------------------------------------= >> ==// >> >> >> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 2008 >> @@ -30,8 +30,7 @@ >> // Instruction Flags. >> >> // >> ===------------------------------------------------------------------ >> ===// >> - // This three-bit field describes the addressing mode used. >> Zero is unused >> - // so that we can tell if we forgot to set a value. >> + // This four-bit field describes the addressing mode used. >> >> AddrModeMask = 0xf, >> AddrModeNone = 0, >> @@ -40,10 +39,11 @@ >> AddrMode3 = 3, >> AddrMode4 = 4, >> AddrMode5 = 5, >> - AddrModeT1 = 6, >> - AddrModeT2 = 7, >> - AddrModeT4 = 8, >> - AddrModeTs = 9, // i8 * 4 for pc and sp relative data >> + AddrMode6 = 6, >> + AddrModeT1 = 7, >> + AddrModeT2 = 8, >> + AddrModeT4 = 9, >> + AddrModeTs = 10, // i8 * 4 for pc and sp relative data >> >> // Size* - Flags to keep track of the size of an instruction. >> SizeShift = 4, >> @@ -115,15 +115,17 @@ >> >> // Field shifts - such shifts are used to set field while >> generating >> // machine instructions. >> - RotImmShift = 8, >> - RegRsShift = 8, >> - RegRdShift = 12, >> - RegRnShift = 16, >> - L_BitShift = 20, >> - S_BitShift = 20, >> - U_BitShift = 23, >> - IndexShift = 24, >> - I_BitShift = 25 >> + RotImmShift = 8, >> + RegRsShift = 8, >> + RegRdLoShift = 12, >> + RegRdShift = 12, >> + RegRdHiShift = 16, >> + RegRnShift = 16, >> + L_BitShift = 20, >> + S_BitShift = 20, >> + U_BitShift = 23, >> + IndexShift = 24, >> + I_BitShift = 25 >> }; >> } >> >> >> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) >> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 >> 2008 >> @@ -310,10 +310,11 @@ >> def AddrMode3 : AddrMode<3>; >> def AddrMode4 : AddrMode<4>; >> def AddrMode5 : AddrMode<5>; >> -def AddrModeT1 : AddrMode<6>; >> -def AddrModeT2 : AddrMode<7>; >> -def AddrModeT4 : AddrMode<8>; >> -def AddrModeTs : AddrMode<9>; >> +def AddrMode6 : AddrMode<6>; >> +def AddrModeT1 : AddrMode<7>; >> +def AddrModeT2 : AddrMode<8>; >> +def AddrModeT4 : AddrMode<9>; >> +def AddrModeTs : AddrMode<10>; >> >> // Instruction size. >> class SizeFlagVal val> { >> @@ -910,49 +911,53 @@ >> // Multiply Instructions. >> // >> >> -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >> - "mul", " $dst, $a, $b", >> - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >> - >> -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >> - MulFrm, "mla", " $dst, $a, $b, $c", >> - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >> $c))]>; >> +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), >> MulFrm, >> + "mul", " $dst, $a, $b", >> + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >> + >> +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR: >> $c), >> + MulFrm, "mla", " $dst, $a, $b, $c", >> + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >> $c))]>; >> >> // Extra precision multiplies with low / high results >> -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >> $b), >> - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >> +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >> GPR:$b), >> + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >> >> -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >> $b), >> - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >> +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >> GPR:$b), >> + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >> >> // Multiply + accumulate >> -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >> $b), >> - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >> +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >> GPR:$b), >> + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >> >> -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >> $b), >> - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >> +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >> GPR:$b), >> + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >> >> -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >> $b), MulFrm, >> - "umaal", " $ldst, $hdst, $a, $b", []>, >> - Requires<[IsARM, HasV6]>; >> +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >> GPR:$b), >> + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, >> + Requires<[IsARM, HasV6]>; >> >> // Most significant word multiply >> +// FIXME: encoding >> def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >> "smmul", " $dst, $a, $b", >> [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, >> Requires<[IsARM, HasV6]>; >> >> +// FIXME: encoding >> def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >> MulFrm, >> "smmla", " $dst, $a, $b, $c", >> [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR: >> $c))]>, >> Requires<[IsARM, HasV6]>; >> >> >> +// FIXME: encoding >> def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >> MulFrm, >> "smmls", " $dst, $a, $b, $c", >> [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR: >> $b)))]>, >> Requires<[IsARM, HasV6]>; >> >> +// FIXME: encoding >> multiclass AI_smul { >> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, >> !strconcat(opc, "bb"), " $dst, $a, $b", >> @@ -992,6 +997,7 @@ >> } >> >> >> +// FIXME: encoding >> multiclass AI_smla { >> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), >> MulSMLA, >> !strconcat(opc, "bb"), " $dst, $a, $b, $acc", >> @@ -1031,7 +1037,9 @@ >> Requires<[IsARM, HasV5TE]>; >> } >> >> +// FIXME: encoding >> defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >> +// FIXME: encoding >> defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >> >> // TODO: Halfword multiple accumulate long: SMLAL >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Mon Nov 3 13:44:36 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 03 Nov 2008 19:44:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c Message-ID: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 13:44:35 2008 New Revision: 58633 URL: http://llvm.org/viewvc/llvm-project?rev=58633&view=rev Log: * Move generic_block_literal_struct_type into the tree.c file. This isn't ideal, but it's used there and in dwarf2out.c only. It's not ideal because this is a C-family specific call. * Create a stub for build_generic_block_struct_type. Modified: llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/stub-c.c llvm-gcc-4.2/trunk/gcc/tree.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=58633&r1=58632&r2=58633&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Mon Nov 3 13:44:35 2008 @@ -201,8 +201,6 @@ tree saved_function_name_decls; */ -/* APPLE LOCAL radar 6300081 */ -tree generic_block_literal_struct_type = NULL; tree c_global_trees[CTI_MAX]; Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=58633&r1=58632&r2=58633&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Mon Nov 3 13:44:35 2008 @@ -180,3 +180,11 @@ { gcc_assert(0); } + +/* APPLE LOCAL begin radar 6300081 */ +tree +build_generic_block_struct_type (void) +{ + return NULL_TREE; +} +/* APPLE LOCAL end radar 6300081 */ Modified: llvm-gcc-4.2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=58633&r1=58632&r2=58633&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Nov 3 13:44:35 2008 @@ -71,6 +71,8 @@ /* obstack.[ch] explicitly declined to prototype this. */ extern int _obstack_allocated_p (struct obstack *h, void *obj); +/* APPLE LOCAL radar 6300081 */ +tree generic_block_literal_struct_type = NULL; #ifdef GATHER_STATISTICS /* Statistics-gathering stuff. */ From anton at korobeynikov.info Mon Nov 3 13:51:03 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 3 Nov 2008 22:51:03 +0300 Subject: [llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c In-Reply-To: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> References: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> Message-ID: Hi, Bill > +/* APPLE LOCAL begin radar 6300081 */ > +tree > +build_generic_block_struct_type (void) > +{ > + return NULL_TREE; > +} > +/* APPLE LOCAL end radar 6300081 */ Why don't gcc_assert(0) here? We shouldn't call this routine for non-C languages, thus this approach seems to be more "robust". -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Mon Nov 3 14:22:12 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 03 Nov 2008 20:22:12 -0000 Subject: [llvm-commits] [llvm] r58635 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Message-ID: <200811032022.mA3KMC1k025602@zion.cs.uiuc.edu> Author: baldrick Date: Mon Nov 3 14:22:12 2008 New Revision: 58635 URL: http://llvm.org/viewvc/llvm-project?rev=58635&view=rev Log: Make VAARG promotion work correctly with large funky sized integers like i129, and also reduce the number of assumptions made about how vaarg is implemented. This still doesn't work correctly for small integers like (eg) i1 on x86, since x86 passes each of them (essentially an i8) in a 4 byte stack slot, so the pointer needs to be advanced by 4 bytes not by 1 byte as now. But this is no longer a LegalizeTypes problem (it was also wrong in LT before): it is a bug in the operation expansion in LegalizeDAG: now LegalizeTypes turns an i1 vaarg into an i8 vaarg which would work fine if only the i8 vaarg was turned into correct code later. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=58635&r1=58634&r2=58635&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Mon Nov 3 14:22:12 2008 @@ -532,29 +532,37 @@ SDValue Ptr = N->getOperand(1); // Get the pointer. MVT VT = N->getValueType(0); - const Value *V = cast(N->getOperand(2))->getValue(); - SDValue VAList = DAG.getLoad(TLI.getPointerTy(), Chain, Ptr, V, 0); + MVT RegVT = TLI.getRegisterType(VT); + unsigned NumRegs = TLI.getNumRegisters(VT); + // The argument is passed as NumRegs registers of type RegVT. - // Increment the arg pointer, VAList, to the next vaarg - // FIXME: should the ABI size be used for the increment? Think of - // x86 long double (10 bytes long, but aligned on 4 or 8 bytes) or - // integers of unusual size (such MVT::i1, which gives an increment - // of zero here!). - unsigned Increment = VT.getSizeInBits() / 8; - SDValue Tmp = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, - DAG.getIntPtrConstant(Increment)); - - // Store the incremented VAList to the pointer. - Tmp = DAG.getStore(VAList.getValue(1), Tmp, Ptr, V, 0); - - // Load the actual argument out of the arg pointer VAList. - Tmp = DAG.getExtLoad(ISD::EXTLOAD, TLI.getTypeToTransformTo(VT), Tmp, - VAList, NULL, 0, VT); + SmallVector Parts(NumRegs); + for (unsigned i = 0; i < NumRegs; ++i) { + Parts[i] = DAG.getVAArg(RegVT, Chain, Ptr, N->getOperand(2)); + Chain = Parts[i].getValue(1); + } - // Legalized the chain result - switch anything that used the old chain to + // Handle endianness of the load. + if (TLI.isBigEndian()) + std::reverse(Parts.begin(), Parts.end()); + + // Assemble the parts in the promoted type. + MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDValue Res = DAG.getNode(ISD::ZERO_EXTEND, NVT, Parts[0]); + for (unsigned i = 1; i < NumRegs; ++i) { + SDValue Part = DAG.getNode(ISD::ZERO_EXTEND, NVT, Parts[i]); + // Shift it to the right position and "or" it in. + Part = DAG.getNode(ISD::SHL, NVT, Part, + DAG.getConstant(i * RegVT.getSizeInBits(), + TLI.getShiftAmountTy())); + Res = DAG.getNode(ISD::OR, NVT, Res, Part); + } + + // Modified the chain result - switch anything that used the old chain to // use the new one. - ReplaceValueWith(SDValue(N, 1), Tmp.getValue(1)); - return Tmp; + ReplaceValueWith(SDValue(N, 1), Chain); + + return Res; } From kremenek at apple.com Mon Nov 3 14:30:10 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 03 Nov 2008 20:30:10 -0000 Subject: [llvm-commits] [llvm] r58636 - /llvm/tags/checker/checker-121/ Message-ID: <200811032030.mA3KUArb026058@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 14:30:09 2008 New Revision: 58636 URL: http://llvm.org/viewvc/llvm-project?rev=58636&view=rev Log: Removing checker-121. Removed: llvm/tags/checker/checker-121/ From kremenek at apple.com Mon Nov 3 14:30:46 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 03 Nov 2008 20:30:46 -0000 Subject: [llvm-commits] [llvm] r58638 - /llvm/tags/checker/checker-121/ Message-ID: <200811032030.mA3KUk4i026105@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 14:30:46 2008 New Revision: 58638 URL: http://llvm.org/viewvc/llvm-project?rev=58638&view=rev Log: Tagging checker-121. Added: llvm/tags/checker/checker-121/ - copied from r58637, llvm/trunk/ From dalej at apple.com Mon Nov 3 14:35:38 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 3 Nov 2008 12:35:38 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c In-Reply-To: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> References: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> Message-ID: <2119AB79-1E43-42BC-AE5C-8C1C49021FEC@apple.com> On Nov 3, 2008, at 11:44 AMPST, Bill Wendling wrote: > Author: void > Date: Mon Nov 3 13:44:35 2008 > New Revision: 58633 > > URL: http://llvm.org/viewvc/llvm-project?rev=58633&view=rev > Log: > * Move generic_block_literal_struct_type into the tree.c file. This > isn't ideal, > but it's used there and in dwarf2out.c only. It's not ideal because > this is a > C-family specific call. The "right" way to do this sort of thing in gcc is to use a langhook, which is null for languages that don't support the feature. (People tend to avoid doing this because it's a PITA, you have to modify 7 or 8 files IIRC.) See the langhooks* files. I suggest taking an existing langhook and grepping for it throughout to see how this works. > * Create a stub for build_generic_block_struct_type. > > Modified: > llvm-gcc-4.2/trunk/gcc/c-common.c > llvm-gcc-4.2/trunk/gcc/stub-c.c > llvm-gcc-4.2/trunk/gcc/tree.c > > Modified: llvm-gcc-4.2/trunk/gcc/c-common.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=58633&r1=58632&r2=58633&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) > +++ llvm-gcc-4.2/trunk/gcc/c-common.c Mon Nov 3 13:44:35 2008 > @@ -201,8 +201,6 @@ > tree saved_function_name_decls; > > */ > -/* APPLE LOCAL radar 6300081 */ > -tree generic_block_literal_struct_type = NULL; > > tree c_global_trees[CTI_MAX]; > > > Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=58633&r1=58632&r2=58633&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original) > +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Mon Nov 3 13:44:35 2008 > @@ -180,3 +180,11 @@ > { > gcc_assert(0); > } > + > +/* APPLE LOCAL begin radar 6300081 */ > +tree > +build_generic_block_struct_type (void) > +{ > + return NULL_TREE; > +} > +/* APPLE LOCAL end radar 6300081 */ > > Modified: llvm-gcc-4.2/trunk/gcc/tree.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=58633&r1=58632&r2=58633&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/tree.c (original) > +++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Nov 3 13:44:35 2008 > @@ -71,6 +71,8 @@ > > /* obstack.[ch] explicitly declined to prototype this. */ > extern int _obstack_allocated_p (struct obstack *h, void *obj); > +/* APPLE LOCAL radar 6300081 */ > +tree generic_block_literal_struct_type = NULL; > > #ifdef GATHER_STATISTICS > /* Statistics-gathering stuff. */ > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Mon Nov 3 14:42:18 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 03 Nov 2008 20:42:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58640 - /llvm-gcc-4.2/trunk/gcc/stub-c.c Message-ID: <200811032042.mA3KgIDf026914@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 14:42:17 2008 New Revision: 58640 URL: http://llvm.org/viewvc/llvm-project?rev=58640&view=rev Log: Call gcc_assert instead of returning a value. Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c Modified: llvm-gcc-4.2/trunk/gcc/stub-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stub-c.c?rev=58640&r1=58639&r2=58640&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stub-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/stub-c.c Mon Nov 3 14:42:17 2008 @@ -185,6 +185,6 @@ tree build_generic_block_struct_type (void) { - return NULL_TREE; + gcc_assert(0); } /* APPLE LOCAL end radar 6300081 */ From isanbard at gmail.com Mon Nov 3 14:43:09 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 3 Nov 2008 12:43:09 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c In-Reply-To: References: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> Message-ID: <16e5fdf90811031243w303324hbc853131b21319e4@mail.gmail.com> On Mon, Nov 3, 2008 at 11:51 AM, Anton Korobeynikov wrote: > Hi, Bill > >> +/* APPLE LOCAL begin radar 6300081 */ >> +tree >> +build_generic_block_struct_type (void) >> +{ >> + return NULL_TREE; >> +} >> +/* APPLE LOCAL end radar 6300081 */ > Why don't gcc_assert(0) here? We shouldn't call this routine for non-C > languages, thus this approach seems to be more "robust". > Okay. Done. -bw From evan.cheng at apple.com Mon Nov 3 14:44:57 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 3 Nov 2008 12:44:57 -0800 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td In-Reply-To: <11542DAB-355C-4414-87BE-13A31708DF6D@apple.com> References: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> <11542DAB-355C-4414-87BE-13A31708DF6D@apple.com> Message-ID: <840F490C-F893-46E0-ADFF-B61BC21677D5@apple.com> Ok. It's not just a naming issue. AddrMode information is used by other ARM routines to determine instruction properties. Currently AddrMode6 is only used by the code emitter to determine instruction encoding. That seems wrong. You should be using instruction format bits to determine how to encode these instructions instead. See // Format specifies the encoding used by the instruction. This is part of the // ad-hoc solution used to emit machine instruction encodings by our machine // code emitter. class Format val> { bits<5> Value = val; } def Pseudo : Format<1>; def MulFrm : Format<2>; def MulSMLAW : Format<3>; Evan On Nov 3, 2008, at 11:41 AM, Jim Grosbach wrote: > I have no real preference for what name to use. I chose that to be > consistent with the other operations doing similar things (choosing > how to encode operands for a class of instructions). If there's an > alternative nomenclature that's preferable, that's fine with me. > > > On Nov 3, 2008, at 11:17 AM, Evan Cheng wrote: > >> Thanks. But is addrmode6 the right name? I don't see ARM manuals >> using >> that name. >> >> Evan >> >> On Nov 3, 2008, at 10:38 AM, Jim Grosbach wrote: >> >>> Author: grosbach >>> Date: Mon Nov 3 12:38:31 2008 >>> New Revision: 58626 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev >>> Log: >>> Add binary encoding support for multiply instructions. Some blanks >>> left to fill in, but the basics are there. >>> >>> Modified: >>> llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>> llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 12:38:31 >>> 2008 >>> @@ -82,8 +82,8 @@ >>> const TargetInstrDesc &TID, >>> const MachineOperand &MO); >>> >>> - unsigned getAddrMode1SBit(const MachineInstr &MI, >>> - const TargetInstrDesc &TID) const; >>> + unsigned getAddrModeSBit(const MachineInstr &MI, >>> + const TargetInstrDesc &TID) const; >>> >>> unsigned getAddrMode1InstrBinary(const MachineInstr &MI, >>> const TargetInstrDesc &TID, >>> @@ -97,6 +97,9 @@ >>> unsigned getAddrMode4InstrBinary(const MachineInstr &MI, >>> const TargetInstrDesc &TID, >>> unsigned Binary); >>> + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, >>> + const TargetInstrDesc &TID, >>> + unsigned Binary); >>> >>> /// getInstrBinary - Return binary encoding for the specified >>> /// machine instruction. >>> @@ -432,8 +435,8 @@ >>> return Binary; >>> } >>> >>> -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, >>> - const TargetInstrDesc >>> &TID) const { >>> +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, >>> + const TargetInstrDesc >>> &TID) const { >>> for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); >>> i != e; --i){ >>> const MachineOperand &MO = MI.getOperand(i-1); >>> if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) >>> @@ -449,7 +452,7 @@ >>> Binary |= II->getPredicate(&MI) << 28; >>> >>> // Encode S bit if MI modifies CPSR. >>> - Binary |= getAddrMode1SBit(MI, TID); >>> + Binary |= getAddrModeSBit(MI, TID); >>> >>> // Encode register def if there is one. >>> unsigned NumDefs = TID.getNumDefs(); >>> @@ -618,6 +621,33 @@ >>> return Binary; >>> } >>> >>> +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const MachineInstr >>> &MI, >>> + const >>> TargetInstrDesc &TID, >>> + unsigned Binary) { >>> + // Set the conditional execution predicate >>> + Binary |= II->getPredicate(&MI) << 28; >>> + >>> + // Encode S bit if MI modifies CPSR. >>> + Binary |= getAddrModeSBit(MI, TID); >>> + >>> + // 32x32->64bit operations have two destination registers. The >>> number >>> + // of register definitions will tell us if that's what we're >>> dealing with. >>> + int OpIdx = 0; >>> + if (TID.getNumDefs() == 2) >>> + Binary |= getMachineOpValue (MI, OpIdx++) << >>> ARMII::RegRdLoShift; >>> + >>> + // Encode Rd >>> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRdHiShift; >>> + >>> + // Encode Rm >>> + Binary |= getMachineOpValue(MI, OpIdx++); >>> + >>> + // Encode Rs >>> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; >>> + >>> + return Binary; >>> +} >>> + >>> /// getInstrBinary - Return binary encoding for the specified >>> /// machine instruction. >>> unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { >>> @@ -636,6 +666,8 @@ >>> return getAddrMode3InstrBinary(MI, TID, Binary); >>> case ARMII::AddrMode4: >>> return getAddrMode4InstrBinary(MI, TID, Binary); >>> + case ARMII::AddrMode6: >>> + return getAddrMode6InstrBinary(MI, TID, Binary); >>> } >>> >>> abort(); >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 12:38:31 >>> 2008 >>> @@ -659,6 +659,28 @@ >>> let Inst{27-25} = 0b100; >>> } >>> >>> +// addrmode6 >>> +// Unsigned multiply, multiply-accumulate instructions. >>> +class AI6 opcod, dag oops, dag iops, Format f, string opc, >>> + string asm, list pattern> >>> + : I>> opc, >>> + asm,"",pattern> >>> +{ >>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) >>> + let Inst{7-4} = 0b1001; >>> + let Inst{27-24} = 0b0000; >>> + let Inst{23-20} = opcod; >>> +} >>> +class AsI6 opcod, dag oops, dag iops, Format f, string opc, >>> + string asm, list pattern> >>> + : sI>> opc, >>> + asm,"",pattern> >>> +{ >>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, SMLAWy, ...) >>> + let Inst{7-4} = 0b1001; >>> + let Inst{27-24} = 0b0000; >>> + let Inst{23-20} = opcod; >>> +} >>> >>> // >>> = >>> = >>> = >>> ----------------------------------------------------------------------= >>> ==// >>> >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 >>> 2008 >>> @@ -30,8 +30,7 @@ >>> // Instruction Flags. >>> >>> // >>> = >>> ==------------------------------------------------------------------ >>> ===// >>> - // This three-bit field describes the addressing mode used. >>> Zero is unused >>> - // so that we can tell if we forgot to set a value. >>> + // This four-bit field describes the addressing mode used. >>> >>> AddrModeMask = 0xf, >>> AddrModeNone = 0, >>> @@ -40,10 +39,11 @@ >>> AddrMode3 = 3, >>> AddrMode4 = 4, >>> AddrMode5 = 5, >>> - AddrModeT1 = 6, >>> - AddrModeT2 = 7, >>> - AddrModeT4 = 8, >>> - AddrModeTs = 9, // i8 * 4 for pc and sp relative data >>> + AddrMode6 = 6, >>> + AddrModeT1 = 7, >>> + AddrModeT2 = 8, >>> + AddrModeT4 = 9, >>> + AddrModeTs = 10, // i8 * 4 for pc and sp relative data >>> >>> // Size* - Flags to keep track of the size of an instruction. >>> SizeShift = 4, >>> @@ -115,15 +115,17 @@ >>> >>> // Field shifts - such shifts are used to set field while >>> generating >>> // machine instructions. >>> - RotImmShift = 8, >>> - RegRsShift = 8, >>> - RegRdShift = 12, >>> - RegRnShift = 16, >>> - L_BitShift = 20, >>> - S_BitShift = 20, >>> - U_BitShift = 23, >>> - IndexShift = 24, >>> - I_BitShift = 25 >>> + RotImmShift = 8, >>> + RegRsShift = 8, >>> + RegRdLoShift = 12, >>> + RegRdShift = 12, >>> + RegRdHiShift = 16, >>> + RegRnShift = 16, >>> + L_BitShift = 20, >>> + S_BitShift = 20, >>> + U_BitShift = 23, >>> + IndexShift = 24, >>> + I_BitShift = 25 >>> }; >>> } >>> >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 >>> 2008 >>> @@ -310,10 +310,11 @@ >>> def AddrMode3 : AddrMode<3>; >>> def AddrMode4 : AddrMode<4>; >>> def AddrMode5 : AddrMode<5>; >>> -def AddrModeT1 : AddrMode<6>; >>> -def AddrModeT2 : AddrMode<7>; >>> -def AddrModeT4 : AddrMode<8>; >>> -def AddrModeTs : AddrMode<9>; >>> +def AddrMode6 : AddrMode<6>; >>> +def AddrModeT1 : AddrMode<7>; >>> +def AddrModeT2 : AddrMode<8>; >>> +def AddrModeT4 : AddrMode<9>; >>> +def AddrModeTs : AddrMode<10>; >>> >>> // Instruction size. >>> class SizeFlagVal val> { >>> @@ -910,49 +911,53 @@ >>> // Multiply Instructions. >>> // >>> >>> -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >>> - "mul", " $dst, $a, $b", >>> - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>> - >>> -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>> - MulFrm, "mla", " $dst, $a, $b, $c", >>> - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>> $c))]>; >>> +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), >>> MulFrm, >>> + "mul", " $dst, $a, $b", >>> + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>> + >>> +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR: >>> $c), >>> + MulFrm, "mla", " $dst, $a, $b, $c", >>> + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>> $c))]>; >>> >>> // Extra precision multiplies with low / high results >>> -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>> $b), >>> - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>> +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>> GPR:$b), >>> + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>> >>> -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>> $b), >>> - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>> +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>> GPR:$b), >>> + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>> >>> // Multiply + accumulate >>> -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>> $b), >>> - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>> +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>> GPR:$b), >>> + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>> >>> -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>> $b), >>> - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>> +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>> GPR:$b), >>> + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>> >>> -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>> $b), MulFrm, >>> - "umaal", " $ldst, $hdst, $a, $b", []>, >>> - Requires<[IsARM, HasV6]>; >>> +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>> GPR:$b), >>> + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, >>> + Requires<[IsARM, HasV6]>; >>> >>> // Most significant word multiply >>> +// FIXME: encoding >>> def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >>> "smmul", " $dst, $a, $b", >>> [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, >>> Requires<[IsARM, HasV6]>; >>> >>> +// FIXME: encoding >>> def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>> MulFrm, >>> "smmla", " $dst, $a, $b, $c", >>> [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR: >>> $c))]>, >>> Requires<[IsARM, HasV6]>; >>> >>> >>> +// FIXME: encoding >>> def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>> MulFrm, >>> "smmls", " $dst, $a, $b, $c", >>> [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR: >>> $b)))]>, >>> Requires<[IsARM, HasV6]>; >>> >>> +// FIXME: encoding >>> multiclass AI_smul { >>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, >>> !strconcat(opc, "bb"), " $dst, $a, $b", >>> @@ -992,6 +997,7 @@ >>> } >>> >>> >>> +// FIXME: encoding >>> multiclass AI_smla { >>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), >>> MulSMLA, >>> !strconcat(opc, "bb"), " $dst, $a, $b, $acc", >>> @@ -1031,7 +1037,9 @@ >>> Requires<[IsARM, HasV5TE]>; >>> } >>> >>> +// FIXME: encoding >>> defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >>> +// FIXME: encoding >>> defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >>> >>> // TODO: Halfword multiple accumulate long: SMLAL >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Mon Nov 3 14:47:45 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 03 Nov 2008 20:47:45 -0000 Subject: [llvm-commits] [llvm] r58642 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Message-ID: <200811032047.mA3KljXc027256@zion.cs.uiuc.edu> Author: johannes Date: Mon Nov 3 14:47:45 2008 New Revision: 58642 URL: http://llvm.org/viewvc/llvm-project?rev=58642&view=rev Log: Fix some ppcf128 regressions: make ExpandFloatRes_LOAD work correctly, and bring over a late change to ppcf128 SetCC handling. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=58642&r1=58641&r2=58642&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Mon Nov 3 14:47:45 2008 @@ -885,16 +885,16 @@ assert(NVT.isByteSized() && "Expanded type not byte sized!"); assert(LD->getMemoryVT().bitsLE(NVT) && "Float type not round?"); - Lo = DAG.getExtLoad(LD->getExtensionType(), NVT, Chain, Ptr, + Hi = DAG.getExtLoad(LD->getExtensionType(), NVT, Chain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), LD->getMemoryVT(), LD->isVolatile(), LD->getAlignment()); // Remember the chain. - Chain = Lo.getValue(1); + Chain = Hi.getValue(1); - // The high part is undefined. - Hi = DAG.getNode(ISD::UNDEF, NVT); + // The low part is zero. + Lo = DAG.getConstantFP(APFloat(APInt(NVT.getSizeInBits(), 0)), NVT); // Modified the chain - switch anything that used the old chain to use the // new one. @@ -1039,15 +1039,15 @@ assert(VT == MVT::ppcf128 && "Unsupported setcc type!"); // FIXME: This generated code sucks. We want to generate - // FCMP crN, hi1, hi2 + // FCMPU crN, hi1, hi2 // BNE crN, L: - // FCMP crN, lo1, lo2 + // FCMPU crN, lo1, lo2 // The following can be improved, but not that much. SDValue Tmp1, Tmp2, Tmp3; - Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETEQ); + Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETOEQ); Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSLo), LHSLo, RHSLo, CCCode); Tmp3 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2); - Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETNE); + Tmp1 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, ISD::SETUNE); Tmp2 = DAG.getSetCC(TLI.getSetCCResultType(LHSHi), LHSHi, RHSHi, CCCode); Tmp1 = DAG.getNode(ISD::AND, Tmp1.getValueType(), Tmp1, Tmp2); NewLHS = DAG.getNode(ISD::OR, Tmp1.getValueType(), Tmp1, Tmp3); From evan.cheng at apple.com Mon Nov 3 15:02:40 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 03 Nov 2008 21:02:40 -0000 Subject: [llvm-commits] [llvm] r58643 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Message-ID: <200811032102.mA3L2eZu028207@zion.cs.uiuc.edu> Author: evancheng Date: Mon Nov 3 15:02:39 2008 New Revision: 58643 URL: http://llvm.org/viewvc/llvm-project?rev=58643&view=rev Log: Minor code restructuring. No functionality change. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=58643&r1=58642&r2=58643&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Mon Nov 3 15:02:39 2008 @@ -296,13 +296,13 @@ } // Transfer LiveVariables states, kill / dead info. - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { - MachineOperand &MO = MI->getOperand(i); - if (MO.isReg() && MO.getReg() && - TargetRegisterInfo::isVirtualRegister(MO.getReg())) { - unsigned Reg = MO.getReg(); + if (LV) { + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + MachineOperand &MO = MI->getOperand(i); + if (MO.isReg() && MO.getReg() && + TargetRegisterInfo::isVirtualRegister(MO.getReg())) { + unsigned Reg = MO.getReg(); - if (LV) { LiveVariables::VarInfo &VI = LV->getVarInfo(Reg); if (MO.isDef()) { MachineInstr *NewMI = (Reg == WBReg) ? UpdateMI : MemMI; From isanbard at gmail.com Mon Nov 3 14:42:49 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 3 Nov 2008 12:42:49 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r58633 - in /llvm-gcc-4.2/trunk/gcc: c-common.c stub-c.c tree.c In-Reply-To: <2119AB79-1E43-42BC-AE5C-8C1C49021FEC@apple.com> References: <200811031944.mA3Jiac9023490@zion.cs.uiuc.edu> <2119AB79-1E43-42BC-AE5C-8C1C49021FEC@apple.com> Message-ID: <16e5fdf90811031242l28fbb1aeqde9ab517f4c7c847@mail.gmail.com> On Mon, Nov 3, 2008 at 12:35 PM, Dale Johannesen wrote: > > On Nov 3, 2008, at 11:44 AMPST, Bill Wendling wrote: > >> Author: void >> Date: Mon Nov 3 13:44:35 2008 >> New Revision: 58633 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=58633&view=rev >> Log: >> * Move generic_block_literal_struct_type into the tree.c file. This >> isn't ideal, >> but it's used there and in dwarf2out.c only. It's not ideal because >> this is a >> C-family specific call. > > The "right" way to do this sort of thing in gcc is to use a langhook, > which is null for languages that don't support the feature. > (People tend to avoid doing this because it's a PITA, you have to > modify 7 or 8 files IIRC.) See the langhooks* files. I suggest > taking an existing langhook and grepping for it throughout to see how > this works. > Okay. I'm going to talk with the person who created the original patch and see if I can convince her to redo it. -bw From evan.cheng at apple.com Mon Nov 3 15:26:53 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 03 Nov 2008 21:26:53 -0000 Subject: [llvm-commits] [llvm] r58644 - /llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Message-ID: <200811032126.mA3LQsn3029654@zion.cs.uiuc.edu> Author: evancheng Date: Mon Nov 3 15:26:52 2008 New Revision: 58644 URL: http://llvm.org/viewvc/llvm-project?rev=58644&view=rev Log: Remove a dead switch statement. Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=58644&r1=58643&r2=58644&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Nov 3 15:26:52 2008 @@ -775,23 +775,6 @@ default: { if (InCPMode && AFI->isThumbFunction()) InCPMode = false; - switch (Opc) { - case ARM::PICADD: - case ARM::PICLD: - case ARM::PICLDZH: - case ARM::PICLDZB: - case ARM::PICLDH: - case ARM::PICLDB: - case ARM::PICLDSH: - case ARM::PICLDSB: - case ARM::PICSTR: - case ARM::PICSTRH: - case ARM::PICSTRB: - case ARM::tPICADD: - break; - default: - break; - } }} // Call the autogenerated instruction printer routines. From daniel at zuster.org Mon Nov 3 14:55:51 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 3 Nov 2008 12:55:51 -0800 Subject: [llvm-commits] Release-Asserts warnings Message-ID: <6a8523d60811031255w938cdf3l38ba2cfee397c6de@mail.gmail.com> Quite a few warnings have crept in Release-Asserts mode. I'll fix some of these but it would be nice to have help, especially for the backend parts which have clear owners & I don't understand. :) The lists, taken from my nightlytester: -- ConstantFold.cpp: In function 'llvm::Constant* FoldBitCast(llvm::Constant*, const llvm::Type*)': ConstantFold.cpp:126: warning: unused variable 'SrcTy' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getUIToFP(llvm::Constant*, const llvm::Type*)': Constants.cpp:1926: warning: unused variable 'fromVec' Constants.cpp:1927: warning: unused variable 'toVec' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getSIToFP(llvm::Constant*, const llvm::Type*)': Constants.cpp:1935: warning: unused variable 'fromVec' Constants.cpp:1936: warning: unused variable 'toVec' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getFPToUI(llvm::Constant*, const llvm::Type*)': Constants.cpp:1944: warning: unused variable 'fromVec' Constants.cpp:1945: warning: unused variable 'toVec' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getFPToSI(llvm::Constant*, const llvm::Type*)': Constants.cpp:1953: warning: unused variable 'fromVec' Constants.cpp:1954: warning: unused variable 'toVec' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getBitCast(llvm::Constant*, const llvm::Type*)': Constants.cpp:1983: warning: unused variable 'SrcBitSize' Constants.cpp:1984: warning: unused variable 'DstBitSize' Constants.cpp: In static member function 'static llvm::Constant* llvm::ConstantExpr::getInsertValue(llvm::Constant*, llvm::Constant*, const unsigned int*, unsigned int)': Constants.cpp:2368: warning: unused variable 'ValTy' Instructions.cpp: In static member function 'static llvm::Instruction::CastOps llvm::CastInst::getCastOpcode(const llvm::Value*, bool, const llvm::Type*, bool)': Instructions.cpp:2172: warning: unused variable 'PTy' Instructions.cpp:2195: warning: unused variable 'PTy' Instructions.cpp:2203: warning: unused variable 'SrcPTy' BasicBlockUtils.cpp: In function 'llvm::BasicBlock* llvm::SplitEdge(llvm::BasicBlock*, llvm::BasicBlock*, llvm::Pass*)': BasicBlockUtils.cpp:208: warning: unused variable 'e' BasicBlockUtils.cpp:223: warning: unused variable 'SP' ArchiveWriter.cpp: In member function 'void llvm::Archive::writeSymbolTable(std::ofstream&)': ArchiveWriter.cpp:310: warning: unused variable 'startpos' ArchiveWriter.cpp:325: warning: unused variable 'endpos' DAGCombiner.cpp: In member function 'llvm::SDValue::DAGCombiner::FindBetterChain(llvm::SDNode*, llvm::SDValue)': DAGCombiner.cpp:5666: warning: 'SrcValueOffset' may be used uninitialized in this function DAGCombiner.cpp:5666: note: 'SrcValueOffset' was declared here DAGCombiner.cpp:5665: warning: 'SrcValue' may be used uninitialized in this function DAGCombiner.cpp:5665: note: 'SrcValue' was declared here DAGCombiner.cpp:5664: warning: 'Size' may be used uninitialized in this function DAGCombiner.cpp:5664: note: 'Size' was declared here DAGCombiner.cpp:5694: warning: 'OpSrcValueOffset' may be used uninitialized in this function DAGCombiner.cpp:5694: note: 'OpSrcValueOffset' was declared here DAGCombiner.cpp:5693: warning: 'OpSrcValue' may be used uninitialized in this function DAGCombiner.cpp:5693: note: 'OpSrcValue' was declared here DAGCombiner.cpp:5692: warning: 'OpSize' may be used uninitialized in this function DAGCombiner.cpp:5692: note: 'OpSize' was declared here LegalizeDAG.cpp: In member function 'void::SelectionDAGLegalize::AddPromotedOperand(llvm::SDValue, llvm::SDValue)': LegalizeDAG.cpp:115: warning: unused variable 'isNew' LegalizeDAG.cpp: In member function 'void::SelectionDAGLegalize::AddWidenOperand(llvm::SDValue, llvm::SDValue)': LegalizeDAG.cpp:121: warning: unused variable 'isNew' LegalizeDAG.cpp: In member function 'void::SelectionDAGLegalize::ExpandOp(llvm::SDValue, llvm::SDValue&, llvm::SDValue&)': LegalizeDAG.cpp:7088: warning: unused variable 'isNew' LegalizeDAG.cpp: In member function 'void::SelectionDAGLegalize::SplitVectorOp(llvm::SDValue, llvm::SDValue&, llvm::SDValue&)': LegalizeDAG.cpp:7398: warning: unused variable 'isNew' LegalizeDAG.cpp: In member function 'llvm::SDValue::SelectionDAGLegalize::ScalarizeVectorOp(llvm::SDValue)': LegalizeDAG.cpp:7556: warning: unused variable 'isNew' X86CodeEmitter.cpp: In member function 'void::Emitter::emitInstruction(const llvm::MachineInstr&, const llvm::TargetInstrDesc*)': X86CodeEmitter.cpp:519: warning: unused variable 'Value' LegalizeDAG.cpp: In function 'llvm::SDValue ExpandUnalignedLoad(llvm::LoadSDNode*, llvm::SelectionDAG&, llvm::TargetLowering&)': LegalizeDAG.cpp:686: warning: 'intVT.llvm::MVT::V' may be used uninitialized in this function LegalizeDAG.cpp: In function 'llvm::SDValue ExpandUnalignedStore(llvm::StoreSDNode*, llvm::SelectionDAG&, llvm::TargetLowering&)': LegalizeDAG.cpp:631: warning: 'intVT.llvm::MVT::V' may be used uninitialized in this function X86FastISel.cpp: In member function 'bool X86FastISel::X86SelectCall(llvm::Instruction*)': X86FastISel.cpp:1064: warning: unused variable 'Emitted' X86FastISel.cpp:1071: warning: unused variable 'Emitted' X86FastISel.cpp:1095: warning: unused variable 'Emitted' X86FastISel.cpp:1123: warning: unused variable 'Emitted' X86FastISel.cpp:1173: warning: unused variable 'Emitted' DwarfWriter.cpp: In member function 'void llvm::DwarfDebug::SetModuleInfo(llvm::MachineModuleInfo*)': DwarfWriter.cpp:2763: warning: unused variable 'AppendOk' ScalarEvolution.cpp: In member function 'void::ScalarEvolutionsImpl::setSCEV(llvm::Value*, const llvm::SCEVHandle&)': ScalarEvolution.cpp:1407: warning: unused variable 'isNew' X86ISelLowering.cpp: In member function 'llvm::SDValue llvm::X86TargetLowering::LowerFORMAL_ARGUMENTS(llvm::SDValue, llvm::SelectionDAG&)': X86ISelLowering.cpp:1235: warning: 'RC' may be used uninitialized in this function SelectionDAG.cpp: In member function 'llvm::SDValue llvm::SelectionDAG::getMemOperand(const llvm::MachineMemOperand&)': SelectionDAG.cpp:1200: warning: unused variable 'v' AlphaGenDAGISel.inc: In member function 'llvm::SDValue::AlphaDAGToDAGISel::Transform_immBRCond(llvm::SDNode*)': AlphaGenDAGISel.inc:69: warning: control reaches end of non-void function X86RegisterInfo.cpp: In member function 'virtual int llvm::X86RegisterInfo::getFrameIndexOffset(llvm::MachineFunction&, int) const': X86RegisterInfo.cpp:336: warning: unused variable 'Align' X86RegisterInfo.cpp: In member function 'virtual void llvm::X86RegisterInfo::processFunctionBeforeFrameFinalized(llvm::MachineFunction&) const': X86RegisterInfo.cpp:479: warning: unused variable 'FrameIdx' X86TargetAsmInfo.cpp: In member function 'virtual std::string llvm::X86COFFTargetAsmInfo::UniqueSectionForGlobal(const llvm::GlobalValue*, llvm::SectionKind::Kind) const': X86TargetAsmInfo.cpp:308: warning: control reaches end of non-void function LiveIntervalAnalysis.cpp: In member function 'void llvm::LiveIntervals::computeNumbering()': LiveIntervalAnalysis.cpp:127: warning: unused variable 'inserted' PPCRegisterInfo.cpp: In member function 'virtual void llvm::PPCRegisterInfo::emitEpilogue(llvm::MachineFunction&, llvm::MachineBasicBlock&) const': PPCRegisterInfo.cpp:1371: warning: unused variable 'JumpTarget' PPCRegisterInfo.cpp:1385: warning: unused variable 'JumpTarget' LiveVariables.cpp: In member function 'void llvm::LiveVariables::removeVirtualRegistersKilled(llvm::MachineInstr*)': LiveVariables.cpp:679: warning: unused variable 'removed' Reassociate.cpp: In member function 'void::Reassociate::LinearizeExprTree(llvm::BinaryOperator*, std::vector<::ValueEntry, std::allocator<::ValueEntry> >&)': Reassociate.cpp:283: warning: unused variable 'Success' LowerSubregs.cpp: In member function 'bool::LowerSubregsInstructionPass::LowerInsert(llvm::MachineInstr*)': LowerSubregs.cpp:155: warning: unused variable 'SrcReg' ARMConstantIslandPass.cpp:709: warning: 'bool BBIsJumpedOver(llvm::MachineBasicBlock*)' defined but not used MachOWriter.cpp: In member function 'void llvm::MachOCodeEmitter::emitConstantPool(llvm::MachineConstantPool*)': MachOWriter.cpp:267: warning: unused variable 'isPIC' MachOWriter.cpp: In member function 'void llvm::MachOCodeEmitter::emitJumpTables(llvm::MachineJumpTableInfo*)': MachOWriter.cpp:308: warning: unused variable 'isPIC' Reassociate.cpp: At global scope: Reassociate.cpp:58: warning: 'void PrintOps(llvm::Instruction*, const std::vector<::ValueEntry, std::allocator<::ValueEntry> >&)' defined but not used SCCP.cpp: In member function 'virtual bool::IPSCCP::runOnModule(llvm::Module&)': SCCP.cpp:1794: warning: unused variable 'SI' SCCP.cpp:1791: warning: unused variable 'BI' MipsISelDAGToDAG.cpp: In member function 'llvm::SDNode*::MipsDAGToDAGISel::Select(llvm::SDValue)': MipsISelDAGToDAG.cpp:221: warning: unused variable 'Opc' PredicateSimplifier.cpp:346: warning: 'bool::validPredicate(::LatticeVal)' defined but not used MipsInstrInfo.cpp: In member function 'virtual llvm::MachineInstr* llvm::MipsInstrInfo::foldMemoryOperand(llvm::MachineFunction&, llvm::MachineInstr*, const llvm::SmallVectorImpl&, int) const': MipsInstrInfo.cpp:317: warning: 'LoadOpc' may be used uninitialized in this function MipsInstrInfo.cpp:317: warning: 'StoreOpc' may be used uninitialized in this function MipsInstrInfo.cpp: In member function 'virtual void llvm::MipsInstrInfo::loadRegFromAddr(llvm::MachineFunction&, unsigned int, llvm::SmallVectorImpl&, const llvm::TargetRegisterClass*, llvm::SmallVectorImpl&) const': MipsInstrInfo.cpp:255: warning: 'Opc' may be used uninitialized in this function MipsInstrInfo.cpp: In member function 'virtual void llvm::MipsInstrInfo::storeRegToAddr(llvm::MachineFunction&, unsigned int, bool, llvm::SmallVectorImpl&, const llvm::TargetRegisterClass*, llvm::SmallVectorImpl&) const': MipsInstrInfo.cpp:204: warning: 'Opc' may be used uninitialized in this function MipsInstrInfo.cpp: In member function 'virtual void llvm::MipsInstrInfo::storeRegToStackSlot(llvm::MachineBasicBlock&, llvm::ilist_iterator, unsigned int, bool, int, const llvm::TargetRegisterClass*) const': MipsInstrInfo.cpp:184: warning: 'Opc' may be used uninitialized in this function MipsInstrInfo.cpp: In member function 'virtual void llvm::MipsInstrInfo::loadRegFromStackSlot(llvm::MachineBasicBlock&, llvm::ilist_iterator, unsigned int, int, const llvm::TargetRegisterClass*) const': MipsInstrInfo.cpp:236: warning: 'Opc' may be used uninitialized in this function ARMISelLowering.cpp: In member function 'llvm::SDValue llvm::ARMTargetLowering::LowerCALL(llvm::SDValue, llvm::SelectionDAG&)': ARMISelLowering.cpp:406: warning: unused variable 'CallConv' SPUAsmPrinter.cpp: In member function 'void::SPUAsmPrinter::printMemRegImmS10(const llvm::MachineInstr*, unsigned int)': SPUAsmPrinter.cpp:188: warning: unused variable 'MO' DarwinTargetAsmInfo.cpp: In member function 'virtual const llvm::Section* llvm::DarwinTargetAsmInfo::SelectSectionForGlobal(const llvm::GlobalValue*) const': DarwinTargetAsmInfo.cpp:111: warning: control reaches end of non-void function ELFTargetAsmInfo.cpp: In member function 'virtual const llvm::Section* llvm::ELFTargetAsmInfo::SelectSectionForGlobal(const llvm::GlobalValue*) const': ELFTargetAsmInfo.cpp:89: warning: control reaches end of non-void function RegAllocSimple.cpp: In member function 'unsigned int::RegAllocSimple::getFreeReg(unsigned int)': RegAllocSimple.cpp:125: warning: unused variable 'RE' TargetAsmInfo.cpp: In member function 'virtual std::string llvm::TargetAsmInfo::UniqueSectionForGlobal(const llvm::GlobalValue*, llvm::SectionKind::Kind) const': TargetAsmInfo.cpp:344: warning: control reaches end of non-void function RegisterScavenging.cpp:146: warning: 'bool isLiveInButUnusedBefore(unsigned int, llvm::MachineInstr*, llvm::MachineBasicBlock*, const llvm::TargetRegisterInfo*, llvm::MachineRegisterInfo*)' defined but not used SimpleRegisterCoalescing.cpp: In member function 'bool llvm::SimpleRegisterCoalescing::SimpleJoin(llvm::LiveInterval&, llvm::LiveInterval&)': SimpleRegisterCoalescing.cpp:1645: warning: 'LHSValNo' may be used uninitialized in this function -- - Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081103/c1840b70/attachment.html From grosbach at apple.com Mon Nov 3 16:10:33 2008 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 3 Nov 2008 14:10:33 -0800 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td In-Reply-To: <840F490C-F893-46E0-ADFF-B61BC21677D5@apple.com> References: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> <11542DAB-355C-4414-87BE-13A31708DF6D@apple.com> <840F490C-F893-46E0-ADFF-B61BC21677D5@apple.com> Message-ID: On Nov 3, 2008, at 12:44 PM, Evan Cheng wrote: > Ok. It's not just a naming issue. AddrMode information is used by > other ARM routines to determine instruction properties. Currently > AddrMode6 is only used by the code emitter to determine instruction > encoding. That seems wrong. You should be using instruction format > bits to determine how to encode these instructions instead. See > The places where the addressing mode is used in the backend are: ARMConstantIslands::InitialFunctionScan() - This is checking the max PC relative displacement for constant operands for a given instruction. The addressing mode check is performed when a constant pool operand is found. Since none of these instructions have constant operands, this check will never be hit and it is correct to omit reference to it in the switch statement (just like AddrMode4 is omitted). ARMRegisterInfo::eliminateFrameIndex() - Here we're looking for frame indexing and adjusting the instructions to get their operands relative to the stack pointer instead. Since all operands for these instructions are register direct, this does not apply. ARMRegisterInfo::processFunctionBeforeCalleeSavedScan() - Check for AddrMode3 and AddrMode5 explicitly to make sure enough registers are available for materializing stack offsets when necessary. Since these instructions don't do anything like that, again, there's nothing to add here. ARMInstrInfo::convertToThreeAddress() - Indexed load/store instructions are converted to an add/subtract with a non-indexed load/ store. Not applicable to the instructions we're looking at for these encodings. ARMCodeEmitter::getInstrBinary() - Dispatch routine for instruction encoding. This is currently based exclusively on AddrMode, and calls out to a separate function for each one. This is the one place where we do need to hook in for the new instructions. The instruction format bits are currently used to determine how to format and encode individual operands within a class of instructions. For example, my intent here is to use that format mask to handle bits 5 and 6 for the SMLAxy, SMLAWy, SULWy, etc. instructions. That is, the usage pattern in place is to use the addressing mode bits to indicate a class of instructions with common operand schemes, then use the format mask to break down nuances of those encodings. That's the pattern I've attempted to stay consistent with. It is, of course, technically possible to just hook off from getAddrModeNoneInstrBinary() based on the format mask entirely. I chose not to do that for the reasons outlined above. Do you have a counter-example that demonstrates why this is the wrong approach? > > // Format specifies the encoding used by the instruction. This is > part of the > // ad-hoc solution used to emit machine instruction encodings by our > machine > // code emitter. > class Format val> { > bits<5> Value = val; > } > > def Pseudo : Format<1>; > def MulFrm : Format<2>; > def MulSMLAW : Format<3>; > > Evan > > > On Nov 3, 2008, at 11:41 AM, Jim Grosbach wrote: > >> I have no real preference for what name to use. I chose that to be >> consistent with the other operations doing similar things (choosing >> how to encode operands for a class of instructions). If there's an >> alternative nomenclature that's preferable, that's fine with me. >> >> >> On Nov 3, 2008, at 11:17 AM, Evan Cheng wrote: >> >>> Thanks. But is addrmode6 the right name? I don't see ARM manuals >>> using >>> that name. >>> >>> Evan >>> >>> On Nov 3, 2008, at 10:38 AM, Jim Grosbach wrote: >>> >>>> Author: grosbach >>>> Date: Mon Nov 3 12:38:31 2008 >>>> New Revision: 58626 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev >>>> Log: >>>> Add binary encoding support for multiply instructions. Some blanks >>>> left to fill in, but the basics are there. >>>> >>>> Modified: >>>> llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>>> llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>>> >>>> Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) >>>> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 >>>> 12:38:31 >>>> 2008 >>>> @@ -82,8 +82,8 @@ >>>> const TargetInstrDesc &TID, >>>> const MachineOperand &MO); >>>> >>>> - unsigned getAddrMode1SBit(const MachineInstr &MI, >>>> - const TargetInstrDesc &TID) const; >>>> + unsigned getAddrModeSBit(const MachineInstr &MI, >>>> + const TargetInstrDesc &TID) const; >>>> >>>> unsigned getAddrMode1InstrBinary(const MachineInstr &MI, >>>> const TargetInstrDesc &TID, >>>> @@ -97,6 +97,9 @@ >>>> unsigned getAddrMode4InstrBinary(const MachineInstr &MI, >>>> const TargetInstrDesc &TID, >>>> unsigned Binary); >>>> + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, >>>> + const TargetInstrDesc &TID, >>>> + unsigned Binary); >>>> >>>> /// getInstrBinary - Return binary encoding for the specified >>>> /// machine instruction. >>>> @@ -432,8 +435,8 @@ >>>> return Binary; >>>> } >>>> >>>> -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, >>>> - const TargetInstrDesc >>>> &TID) const { >>>> +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, >>>> + const TargetInstrDesc >>>> &TID) const { >>>> for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); >>>> i != e; --i){ >>>> const MachineOperand &MO = MI.getOperand(i-1); >>>> if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) >>>> @@ -449,7 +452,7 @@ >>>> Binary |= II->getPredicate(&MI) << 28; >>>> >>>> // Encode S bit if MI modifies CPSR. >>>> - Binary |= getAddrMode1SBit(MI, TID); >>>> + Binary |= getAddrModeSBit(MI, TID); >>>> >>>> // Encode register def if there is one. >>>> unsigned NumDefs = TID.getNumDefs(); >>>> @@ -618,6 +621,33 @@ >>>> return Binary; >>>> } >>>> >>>> +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const >>>> MachineInstr >>>> &MI, >>>> + const >>>> TargetInstrDesc &TID, >>>> + unsigned >>>> Binary) { >>>> + // Set the conditional execution predicate >>>> + Binary |= II->getPredicate(&MI) << 28; >>>> + >>>> + // Encode S bit if MI modifies CPSR. >>>> + Binary |= getAddrModeSBit(MI, TID); >>>> + >>>> + // 32x32->64bit operations have two destination registers. The >>>> number >>>> + // of register definitions will tell us if that's what we're >>>> dealing with. >>>> + int OpIdx = 0; >>>> + if (TID.getNumDefs() == 2) >>>> + Binary |= getMachineOpValue (MI, OpIdx++) << >>>> ARMII::RegRdLoShift; >>>> + >>>> + // Encode Rd >>>> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRdHiShift; >>>> + >>>> + // Encode Rm >>>> + Binary |= getMachineOpValue(MI, OpIdx++); >>>> + >>>> + // Encode Rs >>>> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; >>>> + >>>> + return Binary; >>>> +} >>>> + >>>> /// getInstrBinary - Return binary encoding for the specified >>>> /// machine instruction. >>>> unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { >>>> @@ -636,6 +666,8 @@ >>>> return getAddrMode3InstrBinary(MI, TID, Binary); >>>> case ARMII::AddrMode4: >>>> return getAddrMode4InstrBinary(MI, TID, Binary); >>>> + case ARMII::AddrMode6: >>>> + return getAddrMode6InstrBinary(MI, TID, Binary); >>>> } >>>> >>>> abort(); >>>> >>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) >>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 >>>> 12:38:31 >>>> 2008 >>>> @@ -659,6 +659,28 @@ >>>> let Inst{27-25} = 0b100; >>>> } >>>> >>>> +// addrmode6 >>>> +// Unsigned multiply, multiply-accumulate instructions. >>>> +class AI6 opcod, dag oops, dag iops, Format f, string opc, >>>> + string asm, list pattern> >>>> + : I>>> opc, >>>> + asm,"",pattern> >>>> +{ >>>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, >>>> SMLAWy, ...) >>>> + let Inst{7-4} = 0b1001; >>>> + let Inst{27-24} = 0b0000; >>>> + let Inst{23-20} = opcod; >>>> +} >>>> +class AsI6 opcod, dag oops, dag iops, Format f, string >>>> opc, >>>> + string asm, list pattern> >>>> + : sI>>> opc, >>>> + asm,"",pattern> >>>> +{ >>>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, >>>> SMLAWy, ...) >>>> + let Inst{7-4} = 0b1001; >>>> + let Inst{27-24} = 0b0000; >>>> + let Inst{23-20} = opcod; >>>> +} >>>> >>>> // >>>> = >>>> = >>>> = >>>> ----------------------------------------------------------------------= >>>> ==// >>>> >>>> >>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) >>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 >>>> 2008 >>>> @@ -30,8 +30,7 @@ >>>> // Instruction Flags. >>>> >>>> // >>>> = >>>> = >>>> =------------------------------------------------------------------ >>>> ===// >>>> - // This three-bit field describes the addressing mode used. >>>> Zero is unused >>>> - // so that we can tell if we forgot to set a value. >>>> + // This four-bit field describes the addressing mode used. >>>> >>>> AddrModeMask = 0xf, >>>> AddrModeNone = 0, >>>> @@ -40,10 +39,11 @@ >>>> AddrMode3 = 3, >>>> AddrMode4 = 4, >>>> AddrMode5 = 5, >>>> - AddrModeT1 = 6, >>>> - AddrModeT2 = 7, >>>> - AddrModeT4 = 8, >>>> - AddrModeTs = 9, // i8 * 4 for pc and sp relative data >>>> + AddrMode6 = 6, >>>> + AddrModeT1 = 7, >>>> + AddrModeT2 = 8, >>>> + AddrModeT4 = 9, >>>> + AddrModeTs = 10, // i8 * 4 for pc and sp relative data >>>> >>>> // Size* - Flags to keep track of the size of an instruction. >>>> SizeShift = 4, >>>> @@ -115,15 +115,17 @@ >>>> >>>> // Field shifts - such shifts are used to set field while >>>> generating >>>> // machine instructions. >>>> - RotImmShift = 8, >>>> - RegRsShift = 8, >>>> - RegRdShift = 12, >>>> - RegRnShift = 16, >>>> - L_BitShift = 20, >>>> - S_BitShift = 20, >>>> - U_BitShift = 23, >>>> - IndexShift = 24, >>>> - I_BitShift = 25 >>>> + RotImmShift = 8, >>>> + RegRsShift = 8, >>>> + RegRdLoShift = 12, >>>> + RegRdShift = 12, >>>> + RegRdHiShift = 16, >>>> + RegRnShift = 16, >>>> + L_BitShift = 20, >>>> + S_BitShift = 20, >>>> + U_BitShift = 23, >>>> + IndexShift = 24, >>>> + I_BitShift = 25 >>>> }; >>>> } >>>> >>>> >>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) >>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 >>>> 2008 >>>> @@ -310,10 +310,11 @@ >>>> def AddrMode3 : AddrMode<3>; >>>> def AddrMode4 : AddrMode<4>; >>>> def AddrMode5 : AddrMode<5>; >>>> -def AddrModeT1 : AddrMode<6>; >>>> -def AddrModeT2 : AddrMode<7>; >>>> -def AddrModeT4 : AddrMode<8>; >>>> -def AddrModeTs : AddrMode<9>; >>>> +def AddrMode6 : AddrMode<6>; >>>> +def AddrModeT1 : AddrMode<7>; >>>> +def AddrModeT2 : AddrMode<8>; >>>> +def AddrModeT4 : AddrMode<9>; >>>> +def AddrModeTs : AddrMode<10>; >>>> >>>> // Instruction size. >>>> class SizeFlagVal val> { >>>> @@ -910,49 +911,53 @@ >>>> // Multiply Instructions. >>>> // >>>> >>>> -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >>>> - "mul", " $dst, $a, $b", >>>> - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>>> - >>>> -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>>> - MulFrm, "mla", " $dst, $a, $b, $c", >>>> - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>>> $c))]>; >>>> +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), >>>> MulFrm, >>>> + "mul", " $dst, $a, $b", >>>> + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>>> + >>>> +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, >>>> GPR: >>>> $c), >>>> + MulFrm, "mla", " $dst, $a, $b, $c", >>>> + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>>> $c))]>; >>>> >>>> // Extra precision multiplies with low / high results >>>> -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR: >>>> $b), >>>> - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>>> +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR:$b), >>>> + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>>> >>>> -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR: >>>> $b), >>>> - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>>> +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR:$b), >>>> + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>>> >>>> // Multiply + accumulate >>>> -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR: >>>> $b), >>>> - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>>> +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR:$b), >>>> + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>>> >>>> -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR: >>>> $b), >>>> - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>>> +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR:$b), >>>> + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>>> >>>> -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, GPR: >>>> $b), MulFrm, >>>> - "umaal", " $ldst, $hdst, $a, $b", []>, >>>> - Requires<[IsARM, HasV6]>; >>>> +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>> GPR:$b), >>>> + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, >>>> + Requires<[IsARM, HasV6]>; >>>> >>>> // Most significant word multiply >>>> +// FIXME: encoding >>>> def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >>>> "smmul", " $dst, $a, $b", >>>> [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, >>>> Requires<[IsARM, HasV6]>; >>>> >>>> +// FIXME: encoding >>>> def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>>> MulFrm, >>>> "smmla", " $dst, $a, $b, $c", >>>> [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR: >>>> $c))]>, >>>> Requires<[IsARM, HasV6]>; >>>> >>>> >>>> +// FIXME: encoding >>>> def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>>> MulFrm, >>>> "smmls", " $dst, $a, $b, $c", >>>> [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR: >>>> $b)))]>, >>>> Requires<[IsARM, HasV6]>; >>>> >>>> +// FIXME: encoding >>>> multiclass AI_smul { >>>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, >>>> !strconcat(opc, "bb"), " $dst, $a, $b", >>>> @@ -992,6 +997,7 @@ >>>> } >>>> >>>> >>>> +// FIXME: encoding >>>> multiclass AI_smla { >>>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), >>>> MulSMLA, >>>> !strconcat(opc, "bb"), " $dst, $a, $b, $acc", >>>> @@ -1031,7 +1037,9 @@ >>>> Requires<[IsARM, HasV5TE]>; >>>> } >>>> >>>> +// FIXME: encoding >>>> defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >>>> +// FIXME: encoding >>>> defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node:$RHS)>>; >>>> >>>> // TODO: Halfword multiple accumulate long: SMLAL >>>> >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From criswell at uiuc.edu Mon Nov 3 16:28:16 2008 From: criswell at uiuc.edu (John Criswell) Date: Mon, 03 Nov 2008 22:28:16 -0000 Subject: [llvm-commits] [poolalloc] r58645 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200811032228.mA3MSGlg001407@zion.cs.uiuc.edu> Author: criswell Date: Mon Nov 3 16:28:16 2008 New Revision: 58645 URL: http://llvm.org/viewvc/llvm-project?rev=58645&view=rev Log: Create another work around for using bugpoint on automatic pool allocation. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=58645&r1=58644&r2=58645&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Mon Nov 3 16:28:16 2008 @@ -661,6 +661,8 @@ assert (CF && "No call graph info"); // Get the common graph for the set of functions this call may invoke. + if (UsingBugpoint && (!(Graphs.hasDSGraph(*CF)))) return; + assert ((Graphs.hasDSGraph(*CF)) && "Function has no DSGraph!\n"); CalleeGraph = Graphs.getDSGraph(*CF); #ifndef NDEBUG From evan.cheng at apple.com Mon Nov 3 16:32:19 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 3 Nov 2008 14:32:19 -0800 Subject: [llvm-commits] [llvm] r58626 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrFormats.td ARMInstrInfo.h ARMInstrInfo.td In-Reply-To: References: <200811031838.mA3IcWqw019585@zion.cs.uiuc.edu> <11542DAB-355C-4414-87BE-13A31708DF6D@apple.com> <840F490C-F893-46E0-ADFF-B61BC21677D5@apple.com> Message-ID: <6361908F-1AFD-4B0A-920F-BA51EB869C48@apple.com> On Nov 3, 2008, at 2:10 PM, Jim Grosbach wrote: > On Nov 3, 2008, at 12:44 PM, Evan Cheng wrote: > >> Ok. It's not just a naming issue. AddrMode information is used by >> other ARM routines to determine instruction properties. Currently >> AddrMode6 is only used by the code emitter to determine instruction >> encoding. That seems wrong. You should be using instruction format >> bits to determine how to encode these instructions instead. See >> > > The places where the addressing mode is used in the backend are: > > > ARMCodeEmitter::getInstrBinary() - Dispatch routine for instruction > encoding. This is currently based exclusively on AddrMode, and calls > out to a separate function for each one. This is the one place where > we do need to hook in for the new instructions. > > > The instruction format bits are currently used to determine how to > format and encode individual operands within a class of instructions. > For example, my intent here is to use that format mask to handle bits > 5 and 6 for the SMLAxy, SMLAWy, SULWy, etc. instructions. > > That is, the usage pattern in place is to use the addressing mode bits > to indicate a class of instructions with common operand schemes, then > use the format mask to break down nuances of those encodings. That's > the pattern I've attempted to stay consistent with. Right. We are confusing "addressing mode" with "instruction set encoding scheme". It's a not advisable. It's done this way due to some legacy code. We got away with it because the all instructions in each address mode happens to be in the same encoding scheme (this is actually not true in addrmode1 case). This ought to be cleaned up when we have a chance. Please don't contribute to the problem. It's worse if you introduce a new addrmode6 address mode to represent a new encoding scheme. This is really confusing since isn't a address mode 6 in the ARM instruction set. > > It is, of course, technically possible to just hook off from > getAddrModeNoneInstrBinary() based on the format mask entirely. I > chose not to do that for the reasons outlined above. We ought to follow "A3.1 Instruction set encoding" by classifying instructions into the formats listed there. That doesn't have to be done now. But let's not follow the same mistake that's already made. We can leave addr1 to 5 instructions alone for now. For the rest, let's branch off to different encoding functions based on the format mask. This also means we should do away with getAddrModeNoneInstrBinary and introduce getBranchInstrBinary to handle the branch instructions. Evan > > > Do you have a counter-example that demonstrates why this is the wrong > approach? > > >> >> // Format specifies the encoding used by the instruction. This is >> part of the >> // ad-hoc solution used to emit machine instruction encodings by our >> machine >> // code emitter. >> class Format val> { >> bits<5> Value = val; >> } >> >> def Pseudo : Format<1>; >> def MulFrm : Format<2>; >> def MulSMLAW : Format<3>; >> >> Evan >> >> >> On Nov 3, 2008, at 11:41 AM, Jim Grosbach wrote: >> >>> I have no real preference for what name to use. I chose that to be >>> consistent with the other operations doing similar things (choosing >>> how to encode operands for a class of instructions). If there's an >>> alternative nomenclature that's preferable, that's fine with me. >>> >>> >>> On Nov 3, 2008, at 11:17 AM, Evan Cheng wrote: >>> >>>> Thanks. But is addrmode6 the right name? I don't see ARM manuals >>>> using >>>> that name. >>>> >>>> Evan >>>> >>>> On Nov 3, 2008, at 10:38 AM, Jim Grosbach wrote: >>>> >>>>> Author: grosbach >>>>> Date: Mon Nov 3 12:38:31 2008 >>>>> New Revision: 58626 >>>>> >>>>> URL: http://llvm.org/viewvc/llvm-project?rev=58626&view=rev >>>>> Log: >>>>> Add binary encoding support for multiply instructions. Some blanks >>>>> left to fill in, but the basics are there. >>>>> >>>>> Modified: >>>>> llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>>>> llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>>>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>>>> llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>>>> >>>>> Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58626&r1=58625&r2=58626&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) >>>>> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 >>>>> 12:38:31 >>>>> 2008 >>>>> @@ -82,8 +82,8 @@ >>>>> const TargetInstrDesc &TID, >>>>> const MachineOperand &MO); >>>>> >>>>> - unsigned getAddrMode1SBit(const MachineInstr &MI, >>>>> - const TargetInstrDesc &TID) const; >>>>> + unsigned getAddrModeSBit(const MachineInstr &MI, >>>>> + const TargetInstrDesc &TID) const; >>>>> >>>>> unsigned getAddrMode1InstrBinary(const MachineInstr &MI, >>>>> const TargetInstrDesc &TID, >>>>> @@ -97,6 +97,9 @@ >>>>> unsigned getAddrMode4InstrBinary(const MachineInstr &MI, >>>>> const TargetInstrDesc &TID, >>>>> unsigned Binary); >>>>> + unsigned getAddrMode6InstrBinary(const MachineInstr &MI, >>>>> + const TargetInstrDesc &TID, >>>>> + unsigned Binary); >>>>> >>>>> /// getInstrBinary - Return binary encoding for the specified >>>>> /// machine instruction. >>>>> @@ -432,8 +435,8 @@ >>>>> return Binary; >>>>> } >>>>> >>>>> -unsigned ARMCodeEmitter::getAddrMode1SBit(const MachineInstr &MI, >>>>> - const TargetInstrDesc >>>>> &TID) const { >>>>> +unsigned ARMCodeEmitter::getAddrModeSBit(const MachineInstr &MI, >>>>> + const TargetInstrDesc >>>>> &TID) const { >>>>> for (unsigned i = MI.getNumOperands(), e = TID.getNumOperands(); >>>>> i != e; --i){ >>>>> const MachineOperand &MO = MI.getOperand(i-1); >>>>> if (MO.isReg() && MO.isDef() && MO.getReg() == ARM::CPSR) >>>>> @@ -449,7 +452,7 @@ >>>>> Binary |= II->getPredicate(&MI) << 28; >>>>> >>>>> // Encode S bit if MI modifies CPSR. >>>>> - Binary |= getAddrMode1SBit(MI, TID); >>>>> + Binary |= getAddrModeSBit(MI, TID); >>>>> >>>>> // Encode register def if there is one. >>>>> unsigned NumDefs = TID.getNumDefs(); >>>>> @@ -618,6 +621,33 @@ >>>>> return Binary; >>>>> } >>>>> >>>>> +unsigned ARMCodeEmitter::getAddrMode6InstrBinary(const >>>>> MachineInstr >>>>> &MI, >>>>> + const >>>>> TargetInstrDesc &TID, >>>>> + unsigned >>>>> Binary) { >>>>> + // Set the conditional execution predicate >>>>> + Binary |= II->getPredicate(&MI) << 28; >>>>> + >>>>> + // Encode S bit if MI modifies CPSR. >>>>> + Binary |= getAddrModeSBit(MI, TID); >>>>> + >>>>> + // 32x32->64bit operations have two destination registers. The >>>>> number >>>>> + // of register definitions will tell us if that's what we're >>>>> dealing with. >>>>> + int OpIdx = 0; >>>>> + if (TID.getNumDefs() == 2) >>>>> + Binary |= getMachineOpValue (MI, OpIdx++) << >>>>> ARMII::RegRdLoShift; >>>>> + >>>>> + // Encode Rd >>>>> + Binary |= getMachineOpValue(MI, OpIdx++) << >>>>> ARMII::RegRdHiShift; >>>>> + >>>>> + // Encode Rm >>>>> + Binary |= getMachineOpValue(MI, OpIdx++); >>>>> + >>>>> + // Encode Rs >>>>> + Binary |= getMachineOpValue(MI, OpIdx++) << ARMII::RegRsShift; >>>>> + >>>>> + return Binary; >>>>> +} >>>>> + >>>>> /// getInstrBinary - Return binary encoding for the specified >>>>> /// machine instruction. >>>>> unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { >>>>> @@ -636,6 +666,8 @@ >>>>> return getAddrMode3InstrBinary(MI, TID, Binary); >>>>> case ARMII::AddrMode4: >>>>> return getAddrMode4InstrBinary(MI, TID, Binary); >>>>> + case ARMII::AddrMode6: >>>>> + return getAddrMode6InstrBinary(MI, TID, Binary); >>>>> } >>>>> >>>>> abort(); >>>>> >>>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=58626&r1=58625&r2=58626&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) >>>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Nov 3 >>>>> 12:38:31 >>>>> 2008 >>>>> @@ -659,6 +659,28 @@ >>>>> let Inst{27-25} = 0b100; >>>>> } >>>>> >>>>> +// addrmode6 >>>>> +// Unsigned multiply, multiply-accumulate instructions. >>>>> +class AI6 opcod, dag oops, dag iops, Format f, string >>>>> opc, >>>>> + string asm, list pattern> >>>>> + : I>>>> opc, >>>>> + asm,"",pattern> >>>>> +{ >>>>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, >>>>> SMLAWy, ...) >>>>> + let Inst{7-4} = 0b1001; >>>>> + let Inst{27-24} = 0b0000; >>>>> + let Inst{23-20} = opcod; >>>>> +} >>>>> +class AsI6 opcod, dag oops, dag iops, Format f, string >>>>> opc, >>>>> + string asm, list pattern> >>>>> + : sI>>>> f, >>>>> opc, >>>>> + asm,"",pattern> >>>>> +{ >>>>> + // FIXME: bits 7-4 should be a sub-mode (for SMLAxx, >>>>> SMLAWy, ...) >>>>> + let Inst{7-4} = 0b1001; >>>>> + let Inst{27-24} = 0b0000; >>>>> + let Inst{23-20} = opcod; >>>>> +} >>>>> >>>>> // >>>>> = >>>>> = >>>>> = >>>>> ----------------------------------------------------------------------= >>>>> ==// >>>>> >>>>> >>>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=58626&r1=58625&r2=58626&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) >>>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Mon Nov 3 12:38:31 >>>>> 2008 >>>>> @@ -30,8 +30,7 @@ >>>>> // Instruction Flags. >>>>> >>>>> // >>>>> = >>>>> = >>>>> = >>>>> ------------------------------------------------------------------ >>>>> ===// >>>>> - // This three-bit field describes the addressing mode used. >>>>> Zero is unused >>>>> - // so that we can tell if we forgot to set a value. >>>>> + // This four-bit field describes the addressing mode used. >>>>> >>>>> AddrModeMask = 0xf, >>>>> AddrModeNone = 0, >>>>> @@ -40,10 +39,11 @@ >>>>> AddrMode3 = 3, >>>>> AddrMode4 = 4, >>>>> AddrMode5 = 5, >>>>> - AddrModeT1 = 6, >>>>> - AddrModeT2 = 7, >>>>> - AddrModeT4 = 8, >>>>> - AddrModeTs = 9, // i8 * 4 for pc and sp relative data >>>>> + AddrMode6 = 6, >>>>> + AddrModeT1 = 7, >>>>> + AddrModeT2 = 8, >>>>> + AddrModeT4 = 9, >>>>> + AddrModeTs = 10, // i8 * 4 for pc and sp relative data >>>>> >>>>> // Size* - Flags to keep track of the size of an instruction. >>>>> SizeShift = 4, >>>>> @@ -115,15 +115,17 @@ >>>>> >>>>> // Field shifts - such shifts are used to set field while >>>>> generating >>>>> // machine instructions. >>>>> - RotImmShift = 8, >>>>> - RegRsShift = 8, >>>>> - RegRdShift = 12, >>>>> - RegRnShift = 16, >>>>> - L_BitShift = 20, >>>>> - S_BitShift = 20, >>>>> - U_BitShift = 23, >>>>> - IndexShift = 24, >>>>> - I_BitShift = 25 >>>>> + RotImmShift = 8, >>>>> + RegRsShift = 8, >>>>> + RegRdLoShift = 12, >>>>> + RegRdShift = 12, >>>>> + RegRdHiShift = 16, >>>>> + RegRnShift = 16, >>>>> + L_BitShift = 20, >>>>> + S_BitShift = 20, >>>>> + U_BitShift = 23, >>>>> + IndexShift = 24, >>>>> + I_BitShift = 25 >>>>> }; >>>>> } >>>>> >>>>> >>>>> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=58626&r1=58625&r2=58626&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) >>>>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Nov 3 12:38:31 >>>>> 2008 >>>>> @@ -310,10 +310,11 @@ >>>>> def AddrMode3 : AddrMode<3>; >>>>> def AddrMode4 : AddrMode<4>; >>>>> def AddrMode5 : AddrMode<5>; >>>>> -def AddrModeT1 : AddrMode<6>; >>>>> -def AddrModeT2 : AddrMode<7>; >>>>> -def AddrModeT4 : AddrMode<8>; >>>>> -def AddrModeTs : AddrMode<9>; >>>>> +def AddrMode6 : AddrMode<6>; >>>>> +def AddrModeT1 : AddrMode<7>; >>>>> +def AddrModeT2 : AddrMode<8>; >>>>> +def AddrModeT4 : AddrMode<9>; >>>>> +def AddrModeTs : AddrMode<10>; >>>>> >>>>> // Instruction size. >>>>> class SizeFlagVal val> { >>>>> @@ -910,49 +911,53 @@ >>>>> // Multiply Instructions. >>>>> // >>>>> >>>>> -def MUL : AsI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), >>>>> MulFrm, >>>>> - "mul", " $dst, $a, $b", >>>>> - [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>>>> - >>>>> -def MLA : AsI<0x2, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR: >>>>> $c), >>>>> - MulFrm, "mla", " $dst, $a, $b, $c", >>>>> - [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>>>> $c))]>; >>>>> +def MUL : AsI6<0b0000, (outs GPR:$dst), (ins GPR:$a, GPR:$b), >>>>> MulFrm, >>>>> + "mul", " $dst, $a, $b", >>>>> + [(set GPR:$dst, (mul GPR:$a, GPR:$b))]>; >>>>> + >>>>> +def MLA : AsI6<0b0010, (outs GPR:$dst), (ins GPR:$a, GPR:$b, >>>>> GPR: >>>>> $c), >>>>> + MulFrm, "mla", " $dst, $a, $b, $c", >>>>> + [(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR: >>>>> $c))]>; >>>>> >>>>> // Extra precision multiplies with low / high results >>>>> -def SMULL : AsI<0xC, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>>> GPR: >>>>> $b), >>>>> - MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>>>> +def SMULL : AsI6<0b1100, (outs GPR:$ldst, GPR:$hdst), (ins GPR: >>>>> $a, >>>>> GPR:$b), >>>>> + MulFrm, "smull", " $ldst, $hdst, $a, $b", []>; >>>>> >>>>> -def UMULL : AsI<0x8, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>>> GPR: >>>>> $b), >>>>> - MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>>>> +def UMULL : AsI6<0b1000, (outs GPR:$ldst, GPR:$hdst), (ins GPR: >>>>> $a, >>>>> GPR:$b), >>>>> + MulFrm, "umull", " $ldst, $hdst, $a, $b", []>; >>>>> >>>>> // Multiply + accumulate >>>>> -def SMLAL : AsI<0xE, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>>> GPR: >>>>> $b), >>>>> - MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>>>> +def SMLAL : AsI6<0b1110, (outs GPR:$ldst, GPR:$hdst), (ins GPR: >>>>> $a, >>>>> GPR:$b), >>>>> + MulFrm, "smlal", " $ldst, $hdst, $a, $b", []>; >>>>> >>>>> -def UMLAL : AsI<0xA, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>>> GPR: >>>>> $b), >>>>> - MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>>>> +def UMLAL : AsI6<0b1010, (outs GPR:$ldst, GPR:$hdst), (ins GPR: >>>>> $a, >>>>> GPR:$b), >>>>> + MulFrm, "umlal", " $ldst, $hdst, $a, $b", []>; >>>>> >>>>> -def UMAAL : AI<0x0, (outs GPR:$ldst, GPR:$hdst), (ins GPR:$a, >>>>> GPR: >>>>> $b), MulFrm, >>>>> - "umaal", " $ldst, $hdst, $a, $b", []>, >>>>> - Requires<[IsARM, HasV6]>; >>>>> +def UMAAL : AI6 <0b0000, (outs GPR:$ldst, GPR:$hdst), (ins GPR: >>>>> $a, >>>>> GPR:$b), >>>>> + MulFrm, "umaal", " $ldst, $hdst, $a, $b", []>, >>>>> + Requires<[IsARM, HasV6]>; >>>>> >>>>> // Most significant word multiply >>>>> +// FIXME: encoding >>>>> def SMMUL : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulFrm, >>>>> "smmul", " $dst, $a, $b", >>>>> [(set GPR:$dst, (mulhs GPR:$a, GPR:$b))]>, >>>>> Requires<[IsARM, HasV6]>; >>>>> >>>>> +// FIXME: encoding >>>>> def SMMLA : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>>>> MulFrm, >>>>> "smmla", " $dst, $a, $b, $c", >>>>> [(set GPR:$dst, (add (mulhs GPR:$a, GPR:$b), GPR: >>>>> $c))]>, >>>>> Requires<[IsARM, HasV6]>; >>>>> >>>>> >>>>> +// FIXME: encoding >>>>> def SMMLS : AI<0x0, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c), >>>>> MulFrm, >>>>> "smmls", " $dst, $a, $b, $c", >>>>> [(set GPR:$dst, (sub GPR:$c, (mulhs GPR:$a, GPR: >>>>> $b)))]>, >>>>> Requires<[IsARM, HasV6]>; >>>>> >>>>> +// FIXME: encoding >>>>> multiclass AI_smul { >>>>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b), MulSMUL, >>>>> !strconcat(opc, "bb"), " $dst, $a, $b", >>>>> @@ -992,6 +997,7 @@ >>>>> } >>>>> >>>>> >>>>> +// FIXME: encoding >>>>> multiclass AI_smla { >>>>> def BB : AI<0x8, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc), >>>>> MulSMLA, >>>>> !strconcat(opc, "bb"), " $dst, $a, $b, $acc", >>>>> @@ -1031,7 +1037,9 @@ >>>>> Requires<[IsARM, HasV5TE]>; >>>>> } >>>>> >>>>> +// FIXME: encoding >>>>> defm SMUL : AI_smul<"smul", BinOpFrag<(mul node:$LHS, node: >>>>> $RHS)>>; >>>>> +// FIXME: encoding >>>>> defm SMLA : AI_smla<"smla", BinOpFrag<(mul node:$LHS, node: >>>>> $RHS)>>; >>>>> >>>>> // TODO: Halfword multiple accumulate long: SMLAL >>>>> >>>>> >>>>> _______________________________________________ >>>>> llvm-commits mailing list >>>>> llvm-commits at cs.uiuc.edu >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Mon Nov 3 16:41:42 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 03 Nov 2008 22:41:42 -0000 Subject: [llvm-commits] [llvm] r58648 - /llvm/branches/ggreif/README Message-ID: <200811032241.mA3MfgdL002064@zion.cs.uiuc.edu> Author: ggreif Date: Mon Nov 3 16:41:42 2008 New Revision: 58648 URL: http://llvm.org/viewvc/llvm-project?rev=58648&view=rev Log: Update my status items, hint at son-of-use-diet. Modified: llvm/branches/ggreif/README Modified: llvm/branches/ggreif/README URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/README?rev=58648&r1=58647&r2=58648&view=diff ============================================================================== --- llvm/branches/ggreif/README (original) +++ llvm/branches/ggreif/README Mon Nov 3 16:41:42 2008 @@ -24,6 +24,15 @@ svn switch http(s)://llvm.org/svn/llvm-project/llvm/branches/ggreif/parallelized-test/Transforms/DecomposeMultiDimRefs Transforms/DecomposeMultiDimRefs rm -r Transforms/DecomposeMultiDimRefs +STATUS: Pretty stable. There are some intermittent failures with -j4 because BugPoint seems + to hard-code the filename for its reductions. This causes races. Merging to main would + be easy, the harder part is to verify that the generated report has the same format as + the non-parallel dejagnu output (whatever that is) and that there is a smooth fallback + to the non-parallel execution that do not impose the overhead of the parallel tests. + +IDEAS: The creation of the many small files could be made faster by using a ram-disk (or + equivalent). + -------------------------------------------------------------------------------- 2) size reduction. After some conversation with Chris I think we are ready for a @@ -76,3 +85,13 @@ cd llvm svn switch http(s)://llvm.org/svn/llvm-project/llvm/branches/ggreif/use-diet . +STATUS: waves 1..3 already merged to trunk and released in 2.4. Measured 13% memory + savings on big testcases (dealII). An estimated another 10% seems realistic + with waves 4..6. Ideas formulated, implementation started. Feasibility uncertain. + +-------------------------------------------------------------------------------- +3) Son of Use-Diet. + +Reduction of struct Use size to 2 pointers. Uses a variant of the original +waymarking algorithm. Implementation exists and applicable against release 2.4. + From gohman at apple.com Mon Nov 3 16:55:43 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 22:55:43 -0000 Subject: [llvm-commits] [llvm] r58650 - in /llvm/trunk: include/llvm-c/Core.h lib/VMCore/Core.cpp Message-ID: <200811032255.mA3MthHr002574@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 16:55:43 2008 New Revision: 58650 URL: http://llvm.org/viewvc/llvm-project?rev=58650&view=rev Log: Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel! Modified: llvm/trunk/include/llvm-c/Core.h llvm/trunk/lib/VMCore/Core.cpp Modified: llvm/trunk/include/llvm-c/Core.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=58650&r1=58649&r2=58650&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Core.h (original) +++ llvm/trunk/include/llvm-c/Core.h Mon Nov 3 16:55:43 2008 @@ -371,6 +371,11 @@ LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant); +LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, + unsigned NumIdx); +LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, + LLVMValueRef ElementValueConstant, + unsigned *IdxList, unsigned NumIdx); /* Operations on global variables, functions, and aliases (globals) */ LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global); @@ -605,6 +610,11 @@ LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name); +LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal, + unsigned Index, const char *Name); +LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal, + LLVMValueRef EltVal, unsigned Index, + const char *Name); /*===-- Module providers --------------------------------------------------===*/ Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=58650&r1=58649&r2=58650&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Mon Nov 3 16:55:43 2008 @@ -541,6 +541,20 @@ unwrap(MaskConstant))); } +LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, + unsigned NumIdx) { + return wrap(ConstantExpr::getExtractValue(unwrap(AggConstant), + IdxList, NumIdx)); +} + +LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, + LLVMValueRef ElementValueConstant, + unsigned *IdxList, unsigned NumIdx) { + return wrap(ConstantExpr::getInsertValue(unwrap(AggConstant), + unwrap(ElementValueConstant), + IdxList, NumIdx)); +} + /*--.. Operations on global variables, functions, and aliases (globals) ....--*/ LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global) { @@ -1326,6 +1340,18 @@ unwrap(Mask), Name)); } +LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef B, LLVMValueRef AggVal, + unsigned Index, const char *Name) { + return wrap(unwrap(B)->CreateExtractValue(unwrap(AggVal), Index, Name)); +} + +LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef B, LLVMValueRef AggVal, + LLVMValueRef EltVal, unsigned Index, + const char *Name) { + return wrap(unwrap(B)->CreateInsertValue(unwrap(AggVal), unwrap(EltVal), + Index, Name)); +} + /*===-- Module providers --------------------------------------------------===*/ From dpatel at apple.com Mon Nov 3 17:14:09 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 03 Nov 2008 23:14:09 -0000 Subject: [llvm-commits] [llvm] r58651 - /llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Message-ID: <200811032314.mA3NE9ia003406@zion.cs.uiuc.edu> Author: dpatel Date: Mon Nov 3 17:14:09 2008 New Revision: 58651 URL: http://llvm.org/viewvc/llvm-project?rev=58651&view=rev Log: Fix unused variable warnings. Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=58651&r1=58650&r2=58651&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Mon Nov 3 17:14:09 2008 @@ -205,7 +205,10 @@ BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, Pass *P) { TerminatorInst *LatchTerm = BB->getTerminator(); unsigned SuccNum = 0; - for (unsigned i = 0, e = LatchTerm->getNumSuccessors(); ; ++i) { +#ifndef NDEBUG + unsigned e = LatchTerm->getNumSuccessors(); +#endif + for (unsigned i = 0; ; ++i) { assert(i != e && "Didn't find edge?"); if (LatchTerm->getSuccessor(i) == Succ) { SuccNum = i; @@ -224,6 +227,7 @@ // If the successor only has a single pred, split the top of the successor // block. assert(SP == BB && "CFG broken"); + SP = NULL; return SplitBlock(Succ, Succ->begin(), P); } else { // Otherwise, if BB has a single successor, split it at the bottom of the From dpatel at apple.com Mon Nov 3 17:20:04 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 03 Nov 2008 23:20:04 -0000 Subject: [llvm-commits] [llvm] r58653 - in /llvm/trunk/lib/VMCore: ConstantFold.cpp Constants.cpp Message-ID: <200811032320.mA3NK4VJ003681@zion.cs.uiuc.edu> Author: dpatel Date: Mon Nov 3 17:20:04 2008 New Revision: 58653 URL: http://llvm.org/viewvc/llvm-project?rev=58653&view=rev Log: Fix unused variable warnings. Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp llvm/trunk/lib/VMCore/Constants.cpp Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=58653&r1=58652&r2=58653&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Nov 3 17:20:04 2008 @@ -126,6 +126,7 @@ if (const VectorType *SrcTy = dyn_cast(V->getType())) { assert(DestPTy->getBitWidth() == SrcTy->getBitWidth() && "Not cast between same sized vectors!"); + SrcTy = NULL; // First, check for null. Undef is already handled. if (isa(V)) return Constant::getNullValue(DestTy); Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=58653&r1=58652&r2=58653&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon Nov 3 17:20:04 2008 @@ -1923,8 +1923,10 @@ } Constant *ConstantExpr::getUIToFP(Constant *C, const Type *Ty) { +#ifndef NDEBUG bool fromVec = C->getType()->getTypeID() == Type::VectorTyID; bool toVec = Ty->getTypeID() == Type::VectorTyID; +#endif assert((fromVec == toVec) && "Cannot convert from scalar to/from vector"); assert(C->getType()->isIntOrIntVector() && Ty->isFPOrFPVector() && "This is an illegal uint to floating point cast!"); @@ -1932,8 +1934,10 @@ } Constant *ConstantExpr::getSIToFP(Constant *C, const Type *Ty) { +#ifndef NDEBUG bool fromVec = C->getType()->getTypeID() == Type::VectorTyID; bool toVec = Ty->getTypeID() == Type::VectorTyID; +#endif assert((fromVec == toVec) && "Cannot convert from scalar to/from vector"); assert(C->getType()->isIntOrIntVector() && Ty->isFPOrFPVector() && "This is an illegal sint to floating point cast!"); @@ -1941,8 +1945,10 @@ } Constant *ConstantExpr::getFPToUI(Constant *C, const Type *Ty) { +#ifndef NDEBUG bool fromVec = C->getType()->getTypeID() == Type::VectorTyID; bool toVec = Ty->getTypeID() == Type::VectorTyID; +#endif assert((fromVec == toVec) && "Cannot convert from scalar to/from vector"); assert(C->getType()->isFPOrFPVector() && Ty->isIntOrIntVector() && "This is an illegal floating point to uint cast!"); @@ -1950,8 +1956,10 @@ } Constant *ConstantExpr::getFPToSI(Constant *C, const Type *Ty) { +#ifndef NDEBUG bool fromVec = C->getType()->getTypeID() == Type::VectorTyID; bool toVec = Ty->getTypeID() == Type::VectorTyID; +#endif assert((fromVec == toVec) && "Cannot convert from scalar to/from vector"); assert(C->getType()->isFPOrFPVector() && Ty->isIntOrIntVector() && "This is an illegal floating point to sint cast!"); @@ -1973,6 +1981,7 @@ Constant *ConstantExpr::getBitCast(Constant *C, const Type *DstTy) { // BitCast implies a no-op cast of type only. No bits change. However, you // can't cast pointers to anything but pointers. +#ifndef NDEBUG const Type *SrcTy = C->getType(); assert((isa(SrcTy) == isa(DstTy)) && "BitCast cannot cast pointer to non-pointer and vice versa"); @@ -1982,6 +1991,7 @@ // destination bit widths are identical. unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DstBitSize = DstTy->getPrimitiveSizeInBits(); +#endif assert(SrcBitSize == DstBitSize && "BitCast requies types of same width"); return getFoldedCast(Instruction::BitCast, C, DstTy); } @@ -2365,8 +2375,10 @@ "Tried to create insertelement operation on non-first-class type!"); const Type *ReqTy = Agg->getType(); +#ifndef NDEBUG const Type *ValTy = ExtractValueInst::getIndexedType(Agg->getType(), IdxList, IdxList+NumIdx); +#endif assert(ValTy == Val->getType() && "insertvalue indices invalid!"); return getInsertValueTy(ReqTy, Agg, Val, IdxList, NumIdx); } From gohman at apple.com Mon Nov 3 17:43:55 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 03 Nov 2008 23:43:55 -0000 Subject: [llvm-commits] [llvm] r58655 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/pr2982.ll Message-ID: <200811032343.mA3Nhtl5004527@zion.cs.uiuc.edu> Author: djg Date: Mon Nov 3 17:43:55 2008 New Revision: 58655 URL: http://llvm.org/viewvc/llvm-project?rev=58655&view=rev Log: The ANDMask node folds to a constant, and isn't the node that needs to have its node id set. The new and and shift nodes are the nodes that need the IDs. This fixes PR2982. Added: llvm/trunk/test/CodeGen/X86/pr2982.ll Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=58655&r1=58654&r2=58655&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Nov 3 17:43:55 2008 @@ -993,8 +993,8 @@ Shift.getOperand(0), NewANDMask); SDValue NewSHIFT = CurDAG->getNode(ISD::SHL, N.getValueType(), NewAND, SDValue(C1, 0)); - NewANDMask.getNode()->setNodeId(Shift.getNode()->getNodeId()); - NewAND.getNode()->setNodeId(N.getNode()->getNodeId()); + NewAND.getNode()->setNodeId(Shift.getNode()->getNodeId()); + NewSHIFT.getNode()->setNodeId(N.getNode()->getNodeId()); CurDAG->ReplaceAllUsesWith(N, NewSHIFT); AM.Scale = 1 << ShiftCst; Added: llvm/trunk/test/CodeGen/X86/pr2982.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2982.ll?rev=58655&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/pr2982.ll (added) +++ llvm/trunk/test/CodeGen/X86/pr2982.ll Mon Nov 3 17:43:55 2008 @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | llc -march=x86 +; PR2982 + +target datalayout = +"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.5" + at g_279 = external global i32 ; [#uses=1] + at g_265 = external global i32 ; [#uses=1] + at g_3 = external global i8 ; [#uses=1] + +declare i32 @rshift_u_u(...) + +define void @bar() nounwind { +entry: + %0 = load i32* @g_279, align 4 ; [#uses=1] + %1 = shl i32 %0, 1 ; [#uses=1] + %2 = and i32 %1, 2 ; [#uses=1] + %3 = load i32* @g_265, align 4 ; [#uses=1] + %4 = load i8* @g_3, align 1 ; [#uses=1] + %5 = sext i8 %4 to i32 ; [#uses=1] + %6 = add i32 %2, %3 ; [#uses=1] + %7 = add i32 %6, %5 ; [#uses=1] + %8 = tail call i32 (...)* @rshift_u_u(i32 %7, i32 0) nounwind +; [#uses=0] + ret void +} From kremenek at apple.com Mon Nov 3 18:09:47 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 04 Nov 2008 00:09:47 -0000 Subject: [llvm-commits] [llvm] r58659 - /llvm/tags/checker/checker-122/ Message-ID: <200811040009.mA409l8W005540@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 18:09:46 2008 New Revision: 58659 URL: http://llvm.org/viewvc/llvm-project?rev=58659&view=rev Log: Tagging checker-122. Added: llvm/tags/checker/checker-122/ - copied from r58658, llvm/trunk/ From kremenek at apple.com Mon Nov 3 18:21:52 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 04 Nov 2008 00:21:52 -0000 Subject: [llvm-commits] [llvm] r58661 - /llvm/tags/checker/checker-122/ Message-ID: <200811040021.mA40LrrA005936@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 18:21:52 2008 New Revision: 58661 URL: http://llvm.org/viewvc/llvm-project?rev=58661&view=rev Log: Removing checker-122. Removed: llvm/tags/checker/checker-122/ From kremenek at apple.com Mon Nov 3 18:22:35 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 04 Nov 2008 00:22:35 -0000 Subject: [llvm-commits] [llvm] r58664 - /llvm/tags/checker/checker-122/ Message-ID: <200811040022.mA40MZMv005993@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 18:22:34 2008 New Revision: 58664 URL: http://llvm.org/viewvc/llvm-project?rev=58664&view=rev Log: Tagging checker-122. Added: llvm/tags/checker/checker-122/ - copied from r58663, llvm/trunk/ From kremenek at apple.com Mon Nov 3 18:37:34 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 04 Nov 2008 00:37:34 -0000 Subject: [llvm-commits] [llvm] r58667 - /llvm/tags/checker/checker-122/ Message-ID: <200811040037.mA40bYS9006533@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 18:37:33 2008 New Revision: 58667 URL: http://llvm.org/viewvc/llvm-project?rev=58667&view=rev Log: Removing checker-122. Removed: llvm/tags/checker/checker-122/ From kremenek at apple.com Mon Nov 3 18:38:23 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 04 Nov 2008 00:38:23 -0000 Subject: [llvm-commits] [llvm] r58669 - /llvm/tags/checker/checker-122/ Message-ID: <200811040038.mA40cNnI006608@zion.cs.uiuc.edu> Author: kremenek Date: Mon Nov 3 18:38:23 2008 New Revision: 58669 URL: http://llvm.org/viewvc/llvm-project?rev=58669&view=rev Log: Tagging checker-122. Added: llvm/tags/checker/checker-122/ - copied from r58668, llvm/trunk/ From evan.cheng at apple.com Mon Nov 3 18:50:32 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 04 Nov 2008 00:50:32 -0000 Subject: [llvm-commits] [llvm] r58671 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMConstantPoolValue.cpp ARMJITInfo.cpp ARMJITInfo.h ARMRelocations.h Message-ID: <200811040050.mA40oX7g007252@zion.cs.uiuc.edu> Author: evancheng Date: Mon Nov 3 18:50:32 2008 New Revision: 58671 URL: http://llvm.org/viewvc/llvm-project?rev=58671&view=rev Log: Handle ARM machine constantpool entries. Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp llvm/trunk/lib/Target/ARM/ARMJITInfo.h llvm/trunk/lib/Target/ARM/ARMRelocations.h Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58671&r1=58670&r2=58671&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Mon Nov 3 18:50:32 2008 @@ -158,7 +158,7 @@ TD = ((ARMTargetMachine&)MF.getTarget()).getTargetData(); JTI = ((ARMTargetMachine&)MF.getTarget()).getJITInfo(); MCPEs = &MF.getConstantPool()->getConstants(); - JTI->ResizeConstPoolMap(MCPEs->size()); + JTI->Initialize(MCPEs); do { DOUT << "JITTing function '" << MF.getFunction()->getName() << "'\n"; @@ -257,7 +257,7 @@ } void ARMCodeEmitter::emitInstruction(const MachineInstr &MI) { - DOUT << "JIT: " << "0x" << MCE.getCurrentPCValue() << ":\t" << MI; + DOUT << "JIT: " << (void*)MCE.getCurrentPCValue() << ":\t" << MI; NumEmitted++; // Keep track of the # of mi's emitted if ((MI.getDesc().TSFlags & ARMII::FormMask) == ARMII::Pseudo) @@ -286,8 +286,10 @@ GlobalValue *GV = ACPV->getGV(); if (GV) { assert(!ACPV->isStub() && "Don't know how to deal this yet!"); - emitGlobalAddress(GV, ARM::reloc_arm_absolute, false); - } else { + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), + ARM::reloc_arm_machine_cp_entry, + GV, CPIndex, false)); + } else { assert(!ACPV->isNonLazyPointer() && "Don't know how to deal this yet!"); emitExternalSymbolAddress(ACPV->getSymbol(), ARM::reloc_arm_absolute); } @@ -320,6 +322,12 @@ emitConstPoolInstruction(MI); break; case ARM::PICADD: { + // Remember of the address of the PC label for relocation later. + const MachineOperand &MO2 = MI.getOperand(2); + DOUT << "\t** LPC" << MO2.getImm() << " @ " + << (void*)MCE.getCurrentPCValue() << '\n'; + JTI->addPCLabelAddr(MO2.getImm(), MCE.getCurrentPCValue()); + // PICADD is just an add instruction that implicitly read pc. unsigned Binary = getBinaryCodeForInstr(MI); const TargetInstrDesc &TID = MI.getDesc(); Modified: llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp?rev=58671&r1=58670&r2=58671&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantPoolValue.cpp Mon Nov 3 18:50:32 2008 @@ -93,10 +93,8 @@ else if (isStub()) O << "$stub"; if (Modifier) O << "(" << Modifier << ")"; if (PCAdjust != 0) { - O << "-(LPIC" << LabelId << "+" - << (unsigned)PCAdjust; - if (AddCurrentAddress) - O << "-."; + O << "-(LPC" << LabelId << "+" << (unsigned)PCAdjust; + if (AddCurrentAddress) O << "-."; O << ")"; } } Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=58671&r1=58670&r2=58671&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Mon Nov 3 18:50:32 2008 @@ -13,6 +13,7 @@ #define DEBUG_TYPE "jit" #include "ARMJITInfo.h" +#include "ARMConstantPoolValue.h" #include "ARMRelocations.h" #include "ARMSubtarget.h" #include "llvm/Function.h" @@ -167,6 +168,25 @@ return MCE.finishFunctionStub(F); } +intptr_t ARMJITInfo::resolveRelocationAddr(MachineRelocation *MR) const { + ARM::RelocationType RT = (ARM::RelocationType)MR->getRelocationType(); + if (RT == ARM::reloc_arm_cp_entry) + return getConstantPoolEntryAddr(MR->getConstantPoolIndex()); + else if (RT == ARM::reloc_arm_machine_cp_entry) { + const MachineConstantPoolEntry &MCPE = (*MCPEs)[MR->getConstantVal()]; + assert(MCPE.isMachineConstantPoolEntry() && + "Expecting a machine constant pool entry!"); + ARMConstantPoolValue *ACPV = + static_cast(MCPE.Val.MachineCPVal); + assert((!ACPV->hasModifier() && !ACPV->mustAddCurrentAddress()) && + "Can't handle this machine constant pool entry yet!"); + intptr_t Addr = (intptr_t)(MR->getResultPointer()); + Addr -= getPCLabelAddr(ACPV->getLabelId()) + ACPV->getPCAdjustment(); + return Addr; + } + return (intptr_t)(MR->getResultPointer()); +} + /// relocate - Before the JIT can run a block of code that has been emitted, /// it must rewrite the code to contain the actual addresses of any /// referenced global symbols. @@ -174,12 +194,9 @@ unsigned NumRelocs, unsigned char* GOTBase) { for (unsigned i = 0; i != NumRelocs; ++i, ++MR) { void *RelocPos = (char*)Function + MR->getMachineCodeOffset(); - ARM::RelocationType RT = (ARM::RelocationType)MR->getRelocationType(); // If this is a constpool relocation, get the address of the // constpool_entry instruction. - intptr_t ResultPtr = (RT == ARM::reloc_arm_cp_entry) - ? getConstantPoolEntryAddr(MR->getConstantPoolIndex()) - : (intptr_t)MR->getResultPointer(); + intptr_t ResultPtr = resolveRelocationAddr(MR); switch ((ARM::RelocationType)MR->getRelocationType()) { case ARM::reloc_arm_cp_entry: case ARM::reloc_arm_relative: { @@ -190,18 +207,20 @@ if (ResultPtr >= 0) *((unsigned*)RelocPos) |= 1 << 23; else { - // otherwise, obtain the absolute value and set + // Otherwise, obtain the absolute value and set // bit U(23) to 0. ResultPtr *= -1; *((unsigned*)RelocPos) &= 0xFF7FFFFF; } - // set the immed value calculated + // Set the immed value calculated. *((unsigned*)RelocPos) |= (unsigned)ResultPtr; - // set register Rn to PC + // Set register Rn to PC. *((unsigned*)RelocPos) |= 0xF << 16; break; } + case ARM::reloc_arm_machine_cp_entry: case ARM::reloc_arm_absolute: { + // These addresses have already been resolved. *((unsigned*)RelocPos) += (unsigned)ResultPtr; break; } Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.h?rev=58671&r1=58670&r2=58671&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.h Mon Nov 3 18:50:32 2008 @@ -15,6 +15,8 @@ #define ARMJITINFO_H #include "llvm/Target/TargetJITInfo.h" +#include "llvm/CodeGen/MachineConstantPool.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" namespace llvm { @@ -23,10 +25,17 @@ class ARMJITInfo : public TargetJITInfo { ARMTargetMachine &TM; + // MCPEs - List of the constant pool entries for the current machine + // function that's being processed. + const std::vector *MCPEs; + // ConstPoolId2AddrMap - A map from constant pool ids to the corresponding // CONSTPOOL_ENTRY addresses. SmallVector ConstPoolId2AddrMap; + // PCLabelMap - A map from PC labels to addresses. + DenseMap PCLabelMap; + public: explicit ARMJITInfo(ARMTargetMachine &tm) : TM(tm) { useGOT = false; } @@ -51,15 +60,16 @@ /// referenced global symbols. virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char* GOTBase); - + /// hasCustomConstantPool - Allows a target to specify that constant /// pool address resolution is handled by the target. virtual bool hasCustomConstantPool() const { return true; } - /// ResizeConstPoolMap - Resize constant pool ids to CONSTPOOL_ENTRY - /// addresses map. - void ResizeConstPoolMap(unsigned Size) { - ConstPoolId2AddrMap.resize(Size); + /// Initialize - Initialize internal stage. Get the list of constant pool + /// Resize constant pool ids to CONSTPOOL_ENTRY addresses map. + void Initialize(const std::vector *mcpes) { + MCPEs = mcpes; + ConstPoolId2AddrMap.resize(MCPEs->size()); } /// getConstantPoolEntryAddr - The ARM target puts all constant @@ -77,6 +87,24 @@ assert(CPI < ConstPoolId2AddrMap.size()); ConstPoolId2AddrMap[CPI] = Addr; } + + /// getPCLabelAddr - Retrieve the address of the PC label of the specified id. + intptr_t getPCLabelAddr(unsigned Id) const { + DenseMap::const_iterator I = PCLabelMap.find(Id); + assert(I != PCLabelMap.end()); + return I->second; + } + + /// addPCLabelAddr - Remember the address of the specified PC label. + void addPCLabelAddr(unsigned Id, intptr_t Addr) { + PCLabelMap.insert(std::make_pair(Id, Addr)); + } + + private: + /// resolveRelocationAddr - Resolve the resulting address of the relocation + /// if it's not already solved. Constantpool entries must be resolved by + /// ARM target. + intptr_t resolveRelocationAddr(MachineRelocation *MR) const; }; } Modified: llvm/trunk/lib/Target/ARM/ARMRelocations.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRelocations.h?rev=58671&r1=58670&r2=58671&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRelocations.h (original) +++ llvm/trunk/lib/Target/ARM/ARMRelocations.h Mon Nov 3 18:50:32 2008 @@ -31,6 +31,10 @@ // addresses are kept locally in a map. reloc_arm_cp_entry, + // reloc_arm_machine_cp_entry - Relocation of a ARM machine constantpool + // entry. + reloc_arm_machine_cp_entry, + // reloc_arm_branch - Branch address relocation. reloc_arm_branch }; From isanbard at gmail.com Mon Nov 3 20:10:23 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 04 Nov 2008 02:10:23 -0000 Subject: [llvm-commits] [llvm] r58673 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/StackProtector.cpp Message-ID: <200811040210.mA42ANXh009663@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 20:10:20 2008 New Revision: 58673 URL: http://llvm.org/viewvc/llvm-project?rev=58673&view=rev Log: Initial checkin for stack protectors. Here's what it does: * The prologue is modified to read the __stack_chk_guard global and insert it onto the stack. * The epilogue is modified to read the stored guard from the stack and compare it to the original __stack_chk_guard value. If they differ, then the __stack_chk_fail() function is called. * The stack protector needs to be first on the stack (after the parameters) to catch any stack-smashing activities. Front-end support will follow after a round of beta testing. Added: llvm/trunk/lib/CodeGen/StackProtector.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=58673&r1=58672&r2=58673&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Mon Nov 3 20:10:20 2008 @@ -191,7 +191,10 @@ /// createStackSlotColoringPass - This pass performs stack slot coloring. FunctionPass *createStackSlotColoringPass(); - + + /// createStackProtectorPass - This pass adds stack protectors to functions. + FunctionPass *createStackProtectorPass(int Level); + } // End llvm namespace #endif Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=58673&r1=58672&r2=58673&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Mon Nov 3 20:10:20 2008 @@ -60,6 +60,11 @@ EnableFastISelOption("fast-isel", cl::Hidden, cl::desc("Enable the experimental \"fast\" instruction selector")); +// Enable stack protectors. +static cl::opt +EnableStackProtector("enable-stack-protector", cl::init(0), + cl::desc("Use ProPolice as a stack protection method.")); + FileModel::Model LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, raw_ostream &Out, @@ -165,6 +170,8 @@ if (!Fast) PM.add(createCodeGenPreparePass(getTargetLowering())); + PM.add(createStackProtectorPass(EnableStackProtector)); + if (PrintISelInput) PM.add(createPrintFunctionPass("\n\n" "*** Final LLVM Code input to ISel ***\n", Added: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=58673&view=auto ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (added) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Mon Nov 3 20:10:20 2008 @@ -0,0 +1,228 @@ +//===-- StackProtector.cpp - Stack Protector Insertion --------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass inserts stack protectors into functions which need them. The stack +// protectors this uses are the type that ProPolice used. A variable with a +// random value in it is stored onto the stack before the local variables are +// allocated. Upon exitting the block, the stored value is checked. If it's +// changed, then there was some sort of violation and the program aborts. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "stack-protector" +#include "llvm/CodeGen/Passes.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/Instructions.h" +#include "llvm/Module.h" +#include "llvm/Pass.h" +#include "llvm/ADT/APInt.h" +#include "llvm/Support/CommandLine.h" +using namespace llvm; + +// Enable stack protectors. +static cl::opt +SSPBufferSize("ssp-buffer-size", cl::init(8), + cl::desc("The lower bound for a buffer to be considered for " + "stack smashing protection.")); + +namespace { + class VISIBILITY_HIDDEN StackProtector : public FunctionPass { + // Level == 0 -- Stack protectors are off. + // Level == 1 -- Stack protectors are on only for some functions. + // Level == 2 -- Stack protectors are on for all functions. + int Level; + + /// FailBB - Holds the basic block to jump to when the stack protector check + /// fails. + BasicBlock *FailBB; + + /// StackProtFrameSlot - The place on the stack that the stack protector + /// guard is kept. + AllocaInst *StackProtFrameSlot; + + /// StackGuardVar - The global variable for the stack guard. + GlobalVariable *StackGuardVar; + + Function *F; + Module *M; + + /// InsertStackProtectorPrologue - Insert code into the entry block that + /// stores the __stack_chk_guard variable onto the stack. + void InsertStackProtectorPrologue(); + + /// InsertStackProtectorEpilogue - Insert code before the return + /// instructions checking the stack value that was stored in the + /// prologue. If it isn't the same as the original value, then call a + /// "failure" function. + void InsertStackProtectorEpilogue(); + + /// CreateFailBB - Create a basic block to jump to when the stack protector + /// check fails. + void CreateFailBB(); + + /// RequiresStackProtector - Check whether or not this function needs a + /// stack protector based upon the stack protector level. + bool RequiresStackProtector(); + public: + static char ID; // Pass identification, replacement for typeid. + StackProtector(int lvl = 0) : FunctionPass(&ID), Level(lvl), FailBB(0) {} + + virtual bool runOnFunction(Function &Fn); + }; +} // end anonymous namespace + +char StackProtector::ID = 0; +static RegisterPass +X("stack-protector", "Insert stack protectors"); + +FunctionPass *llvm::createStackProtectorPass(int lvl) { + return new StackProtector(lvl); +} + +bool StackProtector::runOnFunction(Function &Fn) { + F = &Fn; + M = F->getParent(); + + if (!RequiresStackProtector()) return false; + + InsertStackProtectorPrologue(); + InsertStackProtectorEpilogue(); + + // Cleanup. + FailBB = 0; + StackProtFrameSlot = 0; + StackGuardVar = 0; + return true; +} + +/// InsertStackProtectorPrologue - Insert code into the entry block that stores +/// the __stack_chk_guard variable onto the stack. +void StackProtector::InsertStackProtectorPrologue() { + BasicBlock &Entry = F->getEntryBlock(); + Instruction &InsertPt = Entry.front(); + + const char *StackGuardStr = "__stack_chk_guard"; + StackGuardVar = M->getNamedGlobal(StackGuardStr); + + if (!StackGuardVar) + StackGuardVar = new GlobalVariable(PointerType::getUnqual(Type::Int8Ty), + false, GlobalValue::ExternalLinkage, + 0, StackGuardStr, M); + + StackProtFrameSlot = new AllocaInst(PointerType::getUnqual(Type::Int8Ty), + "StackProt_Frame", &InsertPt); + LoadInst *LI = new LoadInst(StackGuardVar, "StackGuard", true, &InsertPt); + new StoreInst(LI, StackProtFrameSlot, true, &InsertPt); +} + +/// InsertStackProtectorEpilogue - Insert code before the return instructions +/// checking the stack value that was stored in the prologue. If it isn't the +/// same as the original value, then call a "failure" function. +void StackProtector::InsertStackProtectorEpilogue() { + // Create the basic block to jump to when the guard check fails. + CreateFailBB(); + + Function::iterator I = F->begin(), E = F->end(); + std::vector ReturnBBs; + ReturnBBs.reserve(F->size()); + + for (; I != E; ++I) + if (isa((*I).getTerminator())) + ReturnBBs.push_back(I); + + if (ReturnBBs.empty()) return; // Odd, but could happen. . . + + // Loop through the basic blocks that have return instructions. Convert this: + // + // return: + // ... + // ret ... + // + // into this: + // + // return: + // ... + // %1 = load __stack_chk_guard + // %2 = load + // %3 = cmp i1 %1, %2 + // br i1 %3, label %SPRet, label %CallStackCheckFailBlk + // + // SPRet: + // ret ... + // + // CallStackCheckFailBlk: + // call void @__stack_chk_fail() + // unreachable + // + for (std::vector::iterator + II = ReturnBBs.begin(), IE = ReturnBBs.end(); II != IE; ++II) { + BasicBlock *BB = *II; + ReturnInst *RI = cast(BB->getTerminator()); + Function::iterator InsPt = BB; ++InsPt; // Insertion point for new BB. + + BasicBlock *NewBB = BasicBlock::Create("SPRet", F, InsPt); + + // Move the return instruction into the new basic block. + RI->removeFromParent(); + NewBB->getInstList().insert(NewBB->begin(), RI); + + LoadInst *LI2 = new LoadInst(StackGuardVar, "", false, BB); + LoadInst *LI1 = new LoadInst(StackProtFrameSlot, "", true, BB); + ICmpInst *Cmp = new ICmpInst(CmpInst::ICMP_EQ, LI1, LI2, "", BB); + BranchInst::Create(NewBB, FailBB, Cmp, BB); + } +} + +/// CreateFailBB - Create a basic block to jump to when the stack protector +/// check fails. +void StackProtector::CreateFailBB() { + assert(!FailBB && "Failure basic block already created?!"); + FailBB = BasicBlock::Create("CallStackCheckFailBlk", F); + std::vector Params; + Constant *StackChkFail = + M->getOrInsertFunction("__stack_chk_fail", + FunctionType::get(Type::VoidTy, Params, false)); + CallInst::Create(StackChkFail, "", FailBB); + new UnreachableInst(FailBB); +} + +/// RequiresStackProtector - Check whether or not this function needs a stack +/// protector based upon the stack protector level. +bool StackProtector::RequiresStackProtector() { + switch (Level) { + default: return false; + case 2: return true; + case 1: { + // If the size of the local variables allocated on the stack is greater than + // SSPBufferSize, then we require a stack protector. + uint64_t StackSize = 0; + + for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) { + BasicBlock *BB = I; + + for (BasicBlock::iterator + II = BB->begin(), IE = BB->end(); II != IE; ++II) + if (AllocaInst *AI = dyn_cast(II)) + if (ConstantInt *CI = dyn_cast(AI->getArraySize())) { + const APInt &Size = CI->getValue(); + StackSize += Size.getZExtValue() * 8; + } + } + + if (SSPBufferSize <= StackSize) + return true; + + return false; + } + } +} + +// [EOF] StackProtector.cpp From isanbard at gmail.com Mon Nov 3 20:13:26 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 04 Nov 2008 02:13:26 -0000 Subject: [llvm-commits] [test-suite] r58674 - /test-suite/trunk/Makefile.programs Message-ID: <200811040213.mA42DQcW009761@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 20:13:25 2008 New Revision: 58674 URL: http://llvm.org/viewvc/llvm-project?rev=58674&view=rev Log: Test stack protectors. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=58674&r1=58673&r2=58674&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Mon Nov 3 20:13:25 2008 @@ -231,7 +231,8 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -fast-isel +LLCBETAOPTION := -enable-stack-protector=2 +#-fast-isel #-aggressive-remat #-machine-licm #-new-spilling-heuristic From isanbard at gmail.com Mon Nov 3 20:15:23 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 04 Nov 2008 02:15:23 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r58675 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp opts.c Message-ID: <200811040215.mA42FNrP009833@zion.cs.uiuc.edu> Author: void Date: Mon Nov 3 20:15:23 2008 New Revision: 58675 URL: http://llvm.org/viewvc/llvm-project?rev=58675&view=rev Log: Add the "enable-stack-protector" flag to the backend calling stuff. Don't change the default in common.opt for the flag_stack_protect just yet! Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/opts.c Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=58675&r1=58674&r2=58675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Nov 3 20:15:23 2008 @@ -70,6 +70,7 @@ #include "tree-inline.h" #include "langhooks.h" #include "cgraph.h" +#include "params.h" } // Non-zero if bytecode from PCH is successfully read. @@ -165,6 +166,13 @@ ArgStrings.push_back(Arg); } + if (flag_stack_protect > 0) { + std::string Arg("--enable-stack-protector=" + utostr(flag_stack_protect)); + ArgStrings.push_back(Arg); + Arg = "--ssp-buffer-size=" + utostr(PARAM_VALUE(PARAM_SSP_BUFFER_SIZE)); + ArgStrings.push_back(Arg); + } + if (llvm_optns) { std::string Opts = llvm_optns; for (std::string Opt = getToken(Opts); !Opt.empty(); Opt = getToken(Opts)) Modified: llvm-gcc-4.2/trunk/gcc/opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/opts.c?rev=58675&r1=58674&r2=58675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/opts.c Mon Nov 3 20:15:23 2008 @@ -206,13 +206,6 @@ opt = argv[0]; - /* LLVM LOCAL begin stack protector */ -#ifdef ENABLE_LLVM - if (strncmp(opt, "-fstack-protector", 17) == 0) - error ("-fstack-protector is not supported."); -#endif - /* LLVM LOCAL end stack protector */ - opt_index = find_opt (opt + 1, lang_mask | CL_COMMON | CL_TARGET); if (opt_index == cl_options_count && (opt[1] == 'W' || opt[1] == 'f' || opt[1] == 'm') From ofv at wanadoo.es Mon Nov 3 21:24:09 2008 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 04 Nov 2008 03:24:09 -0000 Subject: [llvm-commits] [llvm] r58676 - /llvm/trunk/lib/CodeGen/CMakeLists.txt Message-ID: <200811040324.mA43OBLG011992@zion.cs.uiuc.edu> Author: ofv Date: Mon Nov 3 21:24:04 2008 New Revision: 58676 URL: http://llvm.org/viewvc/llvm-project?rev=58676&view=rev Log: CMake: Updated list of source files. Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=58676&r1=58675&r2=58676&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CMakeLists.txt (original) +++ llvm/trunk/lib/CodeGen/CMakeLists.txt Mon Nov 3 21:24:04 2008 @@ -42,6 +42,7 @@ RegisterScavenging.cpp ShadowStackGC.cpp SimpleRegisterCoalescing.cpp + StackProtector.cpp StackSlotColoring.cpp StrongPHIElimination.cpp TargetInstrInfoImpl.cpp From ofv at wanadoo.es Mon Nov 3 21:27:28 2008 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 04 Nov 2008 03:27:28 -0000 Subject: [llvm-commits] [llvm] r58677 - in /llvm/trunk: CMakeLists.txt cmake/modules/AddPartiallyLinkedObject.cmake Message-ID: <200811040327.mA43RTlB012105@zion.cs.uiuc.edu> Author: ofv Date: Mon Nov 3 21:27:24 2008 New Revision: 58677 URL: http://llvm.org/viewvc/llvm-project?rev=58677&view=rev Log: CMake: Support for building 32 bit mode libs and binaries on Linux/x86-64. Modified: llvm/trunk/CMakeLists.txt llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=58677&r1=58676&r2=58677&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Mon Nov 3 21:27:24 2008 @@ -73,6 +73,21 @@ add_definitions( -D__STDC_LIMIT_MACROS ) add_definitions( -D__STDC_CONSTANT_MACROS ) +set(LLVM_PLO_FLAGS "" CACHE + STRING "Flags for creating partially linked objects.") + +if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) + # TODO: support other platforms and toolchains. + option(BUILD_32_BITS "Build 32 bits executables and libraries." OFF) + if( BUILD_32_BITS ) + message(STATUS "Building 32 bits executables and libraries.") + add_definitions( -m32 ) + set( CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}" ) + set( CMAKE_LINK_LIBRARY_FLAG "-m32 ${CMAKE_LINK_LIBRARY_FLAG}" ) + set( LLVM_PLO_FLAGS -melf_i386 ${LLVM_PLO_FLAGS} ) + endif( BUILD_32_BITS ) +endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) + if( MSVC ) add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS ) add_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS ) Modified: llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake?rev=58677&r1=58676&r2=58677&view=diff ============================================================================== --- llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake (original) +++ llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake Mon Nov 3 21:27:24 2008 @@ -24,7 +24,7 @@ DEPENDS ${lib} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX} - COMMAND ld -r *${CMAKE_CXX_OUTPUT_EXTENSION} -o ${pll} + COMMAND ld "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll} COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION} ) target_name_of_partially_linked_object(${lib} tnplo) From ofv at wanadoo.es Mon Nov 3 21:28:37 2008 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 04 Nov 2008 03:28:37 -0000 Subject: [llvm-commits] [llvm] r58678 - /llvm/trunk/tools/llc/CMakeLists.txt Message-ID: <200811040328.mA43Sbu1012160@zion.cs.uiuc.edu> Author: ofv Date: Mon Nov 3 21:28:37 2008 New Revision: 58678 URL: http://llvm.org/viewvc/llvm-project?rev=58678&view=rev Log: CMakeLists: removed asmprinter component from tools/llc/CMakeLists.txt. Modified: llvm/trunk/tools/llc/CMakeLists.txt Modified: llvm/trunk/tools/llc/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/CMakeLists.txt?rev=58678&r1=58677&r2=58678&view=diff ============================================================================== --- llvm/trunk/tools/llc/CMakeLists.txt (original) +++ llvm/trunk/tools/llc/CMakeLists.txt Mon Nov 3 21:28:37 2008 @@ -1,4 +1,4 @@ -set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader asmprinter) +set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader) add_llvm_tool(llc llc.cpp From alenhar2 at cs.uiuc.edu Mon Nov 3 21:45:07 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 3 Nov 2008 21:45:07 -0600 Subject: [llvm-commits] CVS: llvm-www/pubs/2007-06-10-PLDI-DSA-Presentation.pdf 2007-06-10-PLDI-DSA.html Message-ID: <200811040345.mA43j7c9028792@gravity.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2007-06-10-PLDI-DSA-Presentation.pdf added (r1.1) 2007-06-10-PLDI-DSA.html updated: 1.2 -> 1.3 --- Log message: DSA slides --- Diffs of the changes: (+5 -2) 2007-06-10-PLDI-DSA-Presentation.pdf | 0 2007-06-10-PLDI-DSA.html | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) Index: llvm-www/pubs/2007-06-10-PLDI-DSA-Presentation.pdf Index: llvm-www/pubs/2007-06-10-PLDI-DSA.html diff -u llvm-www/pubs/2007-06-10-PLDI-DSA.html:1.2 llvm-www/pubs/2007-06-10-PLDI-DSA.html:1.3 --- llvm-www/pubs/2007-06-10-PLDI-DSA.html:1.2 Thu Mar 29 16:49:41 2007 +++ llvm-www/pubs/2007-06-10-PLDI-DSA.html Mon Nov 3 21:44:20 2008 @@ -14,7 +14,7 @@
Chris Lattner, - Andrew Lenharth, and + Andrew Lenharth, and Vikram Adve
@@ -67,7 +67,10 @@

Slides:

-

not yet

+

BibTeX Entry:






From isanbard at gmail.com  Mon Nov  3 21:52:29 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 04 Nov 2008 03:52:29 -0000
Subject: [llvm-commits] [test-suite] r58679 -
	/test-suite/trunk/Makefile.programs
Message-ID: <200811040352.mA43qUgj012909@zion.cs.uiuc.edu>

Author: void
Date: Mon Nov  3 21:52:29 2008
New Revision: 58679

URL: http://llvm.org/viewvc/llvm-project?rev=58679&view=rev
Log:
Stack protectors aren't Darwin-specific. However, other platforms need to add
the -lssp library or they'll fail.

Modified:
    test-suite/trunk/Makefile.programs

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=58679&r1=58678&r2=58679&view=diff

==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Mon Nov  3 21:52:29 2008
@@ -231,7 +231,11 @@
 LLCBETAOPTION := -sched=simple 
 endif
 ifeq ($(ARCH),x86)
+ifeq ($(OS),Darwin)
 LLCBETAOPTION := -enable-stack-protector=2
+else
+LLCBETAOPTION := -fast-isel
+endif
 #-fast-isel
 #-aggressive-remat
 #-machine-licm




From evan.cheng at apple.com  Tue Nov  4 00:09:39 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 04 Nov 2008 06:09:39 -0000
Subject: [llvm-commits] [llvm] r58682 -
	/llvm/trunk/lib/System/Disassembler.cpp
Message-ID: <200811040609.mA469eon017246@zion.cs.uiuc.edu>

Author: evancheng
Date: Tue Nov  4 00:09:38 2008
New Revision: 58682

URL: http://llvm.org/viewvc/llvm-project?rev=58682&view=rev
Log:
hasDisassembler should return false if disassembler isn't available.

Modified:
    llvm/trunk/lib/System/Disassembler.cpp

Modified: llvm/trunk/lib/System/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Disassembler.cpp?rev=58682&r1=58681&r2=58682&view=diff

==============================================================================
--- llvm/trunk/lib/System/Disassembler.cpp (original)
+++ llvm/trunk/lib/System/Disassembler.cpp Tue Nov  4 00:09:38 2008
@@ -30,10 +30,14 @@
 {
 #if defined (__i386__) || defined (__amd64__) || defined (__x86_64__)
   // We have option to enable udis86 library.
+# if USE_UDIS86
   return true;
 #else
   return false;
 #endif
+#else
+  return false;
+#endif
 }
 
 std::string llvm::sys::disassembleBuffer(uint8_t* start, size_t length,




From evan.cheng at apple.com  Tue Nov  4 00:10:07 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 04 Nov 2008 06:10:07 -0000
Subject: [llvm-commits] [llvm] r58683 -
	/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
Message-ID: <200811040610.mA46A7xg017280@zion.cs.uiuc.edu>

Author: evancheng
Date: Tue Nov  4 00:10:06 2008
New Revision: 58683

URL: http://llvm.org/viewvc/llvm-project?rev=58683&view=rev
Log:
Stylistic change.

Modified:
    llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=58683&r1=58682&r2=58683&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Tue Nov  4 00:10:06 2008
@@ -111,7 +111,7 @@
   // stub with:
   //   ldr pc, [pc,#-4]
   //   
-  bool ok = sys::Memory::setRangeWritable ((void*)StubAddr, 8);
+  bool ok = sys::Memory::setRangeWritable((void*)StubAddr, 8);
   if (!ok)
     {
       cerr << "ERROR: Unable to mark stub writable\n";
@@ -119,7 +119,7 @@
     }
   *(intptr_t *)StubAddr = 0xe51ff004;
   *(intptr_t *)(StubAddr+4) = NewVal;
-  ok = sys::Memory::setRangeExecutable ((void*)StubAddr, 8);
+  ok = sys::Memory::setRangeExecutable((void*)StubAddr, 8);
   if (!ok)
     {
       cerr << "ERROR: Unable to mark stub executable\n";




From evan.cheng at apple.com  Tue Nov  4 00:10:31 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 04 Nov 2008 06:10:31 -0000
Subject: [llvm-commits] [llvm] r58684 -
	/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
Message-ID: <200811040610.mA46AWQs017305@zion.cs.uiuc.edu>

Author: evancheng
Date: Tue Nov  4 00:10:31 2008
New Revision: 58684

URL: http://llvm.org/viewvc/llvm-project?rev=58684&view=rev
Log:
80 col violation.

Modified:
    llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp

Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=58684&r1=58683&r2=58684&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Tue Nov  4 00:10:31 2008
@@ -715,8 +715,8 @@
 /// is the address of the memory at which to store Val, cast to GenericValue *.
 /// It is not a pointer to a GenericValue containing the address at which to
 /// store Val.
-void ExecutionEngine::StoreValueToMemory(const GenericValue &Val, GenericValue *Ptr,
-                                         const Type *Ty) {
+void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
+                                         GenericValue *Ptr, const Type *Ty) {
   const unsigned StoreBytes = getTargetData()->getTypeStoreSize(Ty);
 
   switch (Ty->getTypeID()) {




From isanbard at gmail.com  Tue Nov  4 01:43:01 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 04 Nov 2008 07:43:01 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r58686 - /llvm-gcc-4.2/trunk/gcc/c.opt
Message-ID: <200811040743.mA47h2rL020110@zion.cs.uiuc.edu>

Author: void
Date: Tue Nov  4 01:42:59 2008
New Revision: 58686

URL: http://llvm.org/viewvc/llvm-project?rev=58686&view=rev
Log:
Enable for ObjC++

Modified:
    llvm-gcc-4.2/trunk/gcc/c.opt

Modified: llvm-gcc-4.2/trunk/gcc/c.opt
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c.opt?rev=58686&r1=58685&r2=58686&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c.opt (original)
+++ llvm-gcc-4.2/trunk/gcc/c.opt Tue Nov  4 01:42:59 2008
@@ -331,7 +331,7 @@
 
 ; APPLE LOCAL begin warn missing prototype 6261539
 Wmissing-prototypes
-C ObjC C++ Objc++ Var(warn_missing_prototypes)
+C ObjC C++ ObjC++ Var(warn_missing_prototypes)
 Warn about global functions without prototypes
 ; APPLE LOCAL end warn missing prototype 6261539
 




From s.othman at web.de  Mon Nov  3 16:45:06 2008
From: s.othman at web.de (Sascha Othman)
Date: Mon, 03 Nov 2008 23:45:06 +0100
Subject: [llvm-commits] Patch: improve protability of llvm-config
Message-ID: <490F7EF2.2020808@web.de>

llvm-config uses shell scripting instead of perl functions to determine
llvm's installation directories, which is not very portable. This patch
is an attempt to fix that by using perl's Cwd functions.
Please review twice and don't be too harsh with me since I'm not
especially experienced at this kind of thing.

Regards,
Sascha
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-config.in.in.diff
Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081103/bd243297/attachment.pl 

From nicholas at mxc.ca  Tue Nov  4 02:05:21 2008
From: nicholas at mxc.ca (Nick Lewycky)
Date: Tue, 04 Nov 2008 08:05:21 -0000
Subject: [llvm-commits] [llvm] r58687 -
	/llvm/trunk/tools/llvm-config/llvm-config.in.in
Message-ID: <200811040805.mA485MH9020764@zion.cs.uiuc.edu>

Author: nicholas
Date: Tue Nov  4 02:05:21 2008
New Revision: 58687

URL: http://llvm.org/viewvc/llvm-project?rev=58687&view=rev
Log:
Don't "shell out" to resolve paths. Using pure perl makes llvm-config
friendlier to non-Unixes that happen to have perl. Patch from Sascha Othman!

Modified:
    llvm/trunk/tools/llvm-config/llvm-config.in.in

Modified: llvm/trunk/tools/llvm-config/llvm-config.in.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.in.in?rev=58687&r1=58686&r2=58687&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.in.in (original)
+++ llvm/trunk/tools/llvm-config/llvm-config.in.in Tue Nov  4 02:05:21 2008
@@ -18,6 +18,7 @@
 use 5.006;
 use strict;
 use warnings;
+use Cwd;
 
 #---- begin autoconf values ----
 my $PACKAGE_NAME        = q{@PACKAGE_NAME@};
@@ -64,21 +65,13 @@
 # Convert the current executable name into its directory (e.g. ".").
 my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/);
 
-# Find the unix pwd program: we don't want to use the bash builtin, as it does
-# not look through symlinks etc.
-my $PWD = `which pwd`;
-chomp($PWD);
-$PWD = "pwd" if (!-e $PWD);
-
 # Turn the directory into an absolute directory on the file system, also pop up
 # from "bin" into the build or prefix dir.
-my $ABS_RUN_DIR = `cd $RUN_DIR/..; $PWD`;
-chomp($ABS_RUN_DIR);
+my $ABS_RUN_DIR = Cwd::realpath("$RUN_DIR/..");
 
 # Compute the absolute object directory build, e.g. "foo/llvm/Debug".
 my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE";
-$ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; $PWD` if (-d $ABS_OBJ_ROOT);
-chomp($ABS_OBJ_ROOT);
+$ABS_OBJ_ROOT = Cwd::realpath($ABS_OBJ_ROOT) if (-d $ABS_OBJ_ROOT);
 
 my $INCLUDEDIR = "$ABS_RUN_DIR/include";
 my $LIBDIR     = "$ABS_RUN_DIR/lib";
@@ -142,9 +135,9 @@
         } elsif ($arg eq "--build-mode") {
             $has_opt = 1; print "$LLVM_BUILDMODE\n";
         } elsif ($arg eq "--obj-root") {
-            $has_opt = 1; print `cd $LLVM_OBJ_ROOT/; $PWD`;
+            $has_opt = 1; print Cwd::realpath($LLVM_OBJ_ROOT), "\n";
         } elsif ($arg eq "--src-root") {
-            $has_opt = 1; print `cd $LLVM_SRC_ROOT/; $PWD`;
+            $has_opt = 1; print Cwd::realpath($LLVM_SRC_ROOT), "\n";
         } else {
             usage();
         }




From nicholas at mxc.ca  Tue Nov  4 02:05:23 2008
From: nicholas at mxc.ca (Nick Lewycky)
Date: Tue, 04 Nov 2008 00:05:23 -0800
Subject: [llvm-commits] Patch: improve protability of llvm-config
In-Reply-To: <490F7EF2.2020808@web.de>
References: <490F7EF2.2020808@web.de>
Message-ID: <49100243.3000402@mxc.ca>

Sascha Othman wrote:
> llvm-config uses shell scripting instead of perl functions to determine
> llvm's installation directories, which is not very portable. This patch
> is an attempt to fix that by using perl's Cwd functions.
> Please review twice and don't be too harsh with me since I'm not
> especially experienced at this kind of thing.

Patch applied!

The only change I made was to add , "\n" to the print statements, 
otherwise llvm-config --obj-root wouldn't print a newline.

Nick

> Regards,
> Sascha
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



From evan.cheng at apple.com  Tue Nov  4 03:30:49 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 04 Nov 2008 09:30:49 -0000
Subject: [llvm-commits] [llvm] r58688 - in /llvm/trunk:
 include/llvm/Target/TargetJITInfo.h lib/ExecutionEngine/JIT/JIT.cpp
 lib/Target/ARM/ARMJITInfo.h
Message-ID: <200811040930.mA49UnXl000451@zion.cs.uiuc.edu>

Author: evancheng
Date: Tue Nov  4 03:30:48 2008
New Revision: 58688

URL: http://llvm.org/viewvc/llvm-project?rev=58688&view=rev
Log:
For some targets, it's not possible to place GVs in the same memory buffer as the MachineCodeEmitter allocated memory. Code and data has different read / write / execution privilege requirements.

This is a short term workaround. The current solution is for the JIT memory manager to manage code and data memory separately.

Modified:
    llvm/trunk/include/llvm/Target/TargetJITInfo.h
    llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
    llvm/trunk/lib/Target/ARM/ARMJITInfo.h

Modified: llvm/trunk/include/llvm/Target/TargetJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetJITInfo.h?rev=58688&r1=58687&r2=58688&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetJITInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetJITInfo.h Tue Nov  4 03:30:48 2008
@@ -110,6 +110,11 @@
     /// hasCustomConstantPool - Allows a target to specify that constant
     /// pool address resolution is handled by the target.
     virtual bool hasCustomConstantPool() const { return false; }
+
+    /// allocateSeparateGVMemory - If true, globals should be placed in
+    /// separately allocated heap memory rather than in the same
+    /// code memory allocated by MachineCodeEmitter.
+    virtual bool allocateSeparateGVMemory() const { return false; }
   protected:
     bool useGOT;
   };

Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=58688&r1=58687&r2=58688&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Tue Nov  4 03:30:48 2008
@@ -565,6 +565,16 @@
     if (GV->isThreadLocal()) {
       MutexGuard locked(lock);
       Ptr = TJI.allocateThreadLocalMemory(S);
+    } else if (TJI.allocateSeparateGVMemory()) {
+      if (A <= 8) {
+        Ptr = malloc(S);
+      } else {
+        // Allocate S+A bytes of memory, then use an aligned pointer within that
+        // space.
+        Ptr = malloc(S+A);
+        unsigned MisAligned = ((intptr_t)Ptr & (A-1));
+        Ptr = (char*)Ptr + (MisAligned ? (A-MisAligned) : 0);
+      }
     } else {
       Ptr = MCE->allocateSpace(S, A);
     }

Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.h?rev=58688&r1=58687&r2=58688&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.h Tue Nov  4 03:30:48 2008
@@ -65,6 +65,17 @@
     /// pool address resolution is handled by the target.
     virtual bool hasCustomConstantPool() const { return true; }
 
+    /// allocateSeparateGVMemory - If true, globals should be placed in
+    /// separately allocated heap memory rather than in the same
+    /// code memory allocated by MachineCodeEmitter.
+    virtual bool allocateSeparateGVMemory() const {
+#ifdef __APPLE__
+      return true;
+#else
+      return false;
+#endif
+    }
+
     /// Initialize - Initialize internal stage. Get the list of constant pool
     /// Resize constant pool ids to CONSTPOOL_ENTRY addresses map.
     void Initialize(const std::vector *mcpes) {




From duncan.sands at math.u-psud.fr  Tue Nov  4 03:38:35 2008
From: duncan.sands at math.u-psud.fr (Duncan Sands)
Date: Tue, 4 Nov 2008 10:38:35 +0100
Subject: [llvm-commits] [llvm] r58623 - in /llvm/trunk:
	include/llvm/CodeGen/ValueTypes.h lib/VMCore/ValueTypes.cpp
	test/CodeGen/X86/i2k.ll utils/TableGen/CMakeLists.txt
	utils/TableGen/TGValueTypes.cpp
In-Reply-To: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu>
References: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu>
Message-ID: <200811041038.36565.duncan.sands@math.u-psud.fr>

Hi Dan,

> Change how extended types are represented in MVTs. Instead of fiddling
> bits, use a union of a SimpleValueType enum and a regular Type*.

this is a wonderful improvement!

> there are no libcalls defined for very large integers so operations
> like multiply and divide aren't supported.

Here's a crazy idea.  I hear that people are working on "libllvm",
a reimplementation of libgcc.  Maybe instead the code generator
could be taught to generate library functions on the fly.  For
example, suppose a call to __udivsi3 is needed.  Then the code
generator creates the function __udivsi3 in the assembler, with
weak linkage.  Thanks to weak linkage there will be only one
copy no matter how many object files it turns up in, and there
is no need to link with libllvm.  Now imagine that you need a
similar library function to __udivsi3, but for i1024.  Then you
can have the code generators squirt out __udivsiXYZ!

> This also introduces a minimal tablgen Type library, capable of
> handling IntegerType and VectorType. This will allow parts of
> TableGen that don't depend on using SimpleValueType values to handle
> arbitrary integer and vector types.

Are there any such parts?  Or, rather, can such parts be changed
to only use SimpleValueType?

>      /// isSimple - Test if the given MVT is simple (as opposed to being
>      /// extended).
>      bool isSimple() const {
> -      return V <= SimpleTypeMask;
> +      return V <= LastSimpleValueType;
>      }

I see that you are confident that heap allocations never occur in the
first 256 bytes of memory! :)

> +unsigned MVT::getExtendedSizeInBits() const {
> +  assert(isExtended() && "Type is not extended!");
> +  if (const IntegerType *ITy = dyn_cast(LLVMTy))
> +    return ITy->getBitWidth();
> +  if (const VectorType *VTy = dyn_cast(LLVMTy))
> +    return VTy->getBitWidth();
> +  assert(false && "Unrecognized extended type!");

You probably want a return statement here so as not to get
compiler warnings when assertions are turned off.
> +}

Finally, I notice that you didn't touch getTypeForMVT.  For extended
value types that function could be simplified to return LLVMTy.

Ciao,

Duncan.


From sabre at nondot.org  Tue Nov  4 04:24:36 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 4 Nov 2008 04:24:36 -0600
Subject: [llvm-commits] CVS: llvm-www/pubs/2008-10-04-ACAT-LLVM-Intro.html
	2008-10-04-ACAT-LLVM-Intro.pdf
Message-ID: <200811041024.mA4AOaEw003084@zion.cs.uiuc.edu>



Changes in directory llvm-www/pubs:

2008-10-04-ACAT-LLVM-Intro.html added (r1.1)
2008-10-04-ACAT-LLVM-Intro.pdf added (r1.1)
---
Log message:

add a new talk


---
Diffs of the changes:  (+41 -0)

 2008-10-04-ACAT-LLVM-Intro.html |   41 ++++++++++++++++++++++++++++++++++++++++
 2008-10-04-ACAT-LLVM-Intro.pdf  |    0 
 2 files changed, 41 insertions(+)


Index: llvm-www/pubs/2008-10-04-ACAT-LLVM-Intro.html
diff -c /dev/null llvm-www/pubs/2008-10-04-ACAT-LLVM-Intro.html:1.1
*** /dev/null	Tue Nov  4 04:23:17 2008
--- llvm-www/pubs/2008-10-04-ACAT-LLVM-Intro.html	Tue Nov  4 04:23:06 2008
***************
*** 0 ****
--- 1,41 ----
+ 
+ 
+ 
+   
+   
+   Introduction to the LLVM Compiler System
+ 
+ 
+ 
+ 
+ Introduction to the LLVM Compiler System +
+ + +

Abstract:

+
+

+ This talk gives a gentle introduction to LLVM, talking about the benefits of + using llvm-gcc and including updated compile-time and run-time performance + numbers. This talk is high level and particularly suited + for those without a deep compiler hacker background. +

+ +
+ +

Published:

+
+ "Introduction to the LLVM Compiler System", Chris Lattner,
+ ACAT 2008: Advanced Computing and Analysis Techniques in Physics Research, Erice, Sicily, Italy, Nov 2008.
+
+ +

Download Presentation:

+ + + + + Index: llvm-www/pubs/2008-10-04-ACAT-LLVM-Intro.pdf From sabre at nondot.org Tue Nov 4 04:25:57 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 4 Nov 2008 04:25:57 -0600 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200811041025.mA4APvnm003221@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.83 -> 1.84 --- Log message: add talk --- Diffs of the changes: (+4 -0) index.html | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.83 llvm-www/pubs/index.html:1.84 --- llvm-www/pubs/index.html:1.83 Thu Oct 9 13:18:40 2008 +++ llvm-www/pubs/index.html Tue Nov 4 04:25:34 2008 @@ -3,6 +3,10 @@
    +
  1. "Introduction to the LLVM Compiler System"
    + Chris Lattner
    + Plenary Talk, ACAT 2008: Advanced Computing and Analysis Techniques in Physics Research, Erice, Sicily, Italy, November 2008.
  2. +
  3. "KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs"
    From clattner at apple.com Tue Nov 4 04:54:18 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 4 Nov 2008 02:54:18 -0800 Subject: [llvm-commits] [llvm] r58631 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnswitch.cpp test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll In-Reply-To: <200811031938.mA3Jc768023118@zion.cs.uiuc.edu> References: <200811031938.mA3Jc768023118@zion.cs.uiuc.edu> Message-ID: <13D2BF23-2BF9-42C0-A8C1-67C90F3AC2B8@apple.com> On Nov 3, 2008, at 11:38 AM, Devang Patel wrote: > Author: dpatel > Date: Mon Nov 3 13:38:07 2008 > New Revision: 58631 > > URL: http://llvm.org/viewvc/llvm-project?rev=58631&view=rev > Log: > Ignore conditions that are outside the loop. Why can't this be unswitched? Is this a missed optimization now? -Chris From clattner at apple.com Tue Nov 4 04:58:23 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 4 Nov 2008 02:58:23 -0800 Subject: [llvm-commits] [llvm] r58623 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h lib/VMCore/ValueTypes.cpp test/CodeGen/X86/i2k.ll utils/TableGen/CMakeLists.txt utils/TableGen/TGValueTypes.cpp In-Reply-To: <200811041038.36565.duncan.sands@math.u-psud.fr> References: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu> <200811041038.36565.duncan.sands@math.u-psud.fr> Message-ID: <822CF83A-249C-4FB3-8D72-750E76E20D87@apple.com> On Nov 4, 2008, at 1:38 AM, Duncan Sands wrote: > Hi Dan, >> Change how extended types are represented in MVTs. Instead of >> fiddling >> bits, use a union of a SimpleValueType enum and a regular Type*. > > this is a wonderful improvement! I agree! >> there are no libcalls defined for very large integers so operations >> like multiply and divide aren't supported. > > Here's a crazy idea. I hear that people are working on "libllvm", > a reimplementation of libgcc. Maybe instead the code generator > could be taught to generate library functions on the fly. For > example, suppose a call to __udivsi3 is needed. Then the code > generator creates the function __udivsi3 in the assembler, with > weak linkage. Thanks to weak linkage there will be only one > copy no matter how many object files it turns up in, and there > is no need to link with libllvm. Now imagine that you need a > similar library function to __udivsi3, but for i1024. Then you > can have the code generators squirt out __udivsiXYZ! I think it would be better to make an arbitrary precision version of udiv that takes a pointer to the integer in memory, and the size in bits as an argument. -Chris From clattner at apple.com Tue Nov 4 05:19:33 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 4 Nov 2008 03:19:33 -0800 Subject: [llvm-commits] [llvm] r58505 - /llvm/trunk/lib/VMCore/Type.cpp In-Reply-To: <1225536655.7995.2.camel@idc-lt-i00171.microchip.com> References: <200810311026.m9VAQKSc028696@zion.cs.uiuc.edu> <1225536655.7995.2.camel@idc-lt-i00171.microchip.com> Message-ID: <64763E6A-1EBC-4939-BEA7-856332B147C2@apple.com> On Nov 1, 2008, at 3:50 AM, sanjiv gupta wrote: >> I think this is the right way to go, but I don't want to get stuck >> with half of the change in the tree but it not working 100%. >> >> -Chris >> > Agree. I will revert this back and make changes when everything is > ready. Thank you Sanjiv! Sorry for the trouble, but I appreciate it, -Chris From nunoplopes at sapo.pt Tue Nov 4 07:03:00 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 04 Nov 2008 13:03:00 -0000 Subject: [llvm-commits] [llvm] r58690 - /llvm/trunk/lib/CodeGen/IfConversion.cpp Message-ID: <200811041303.mA4D30Os008130@zion.cs.uiuc.edu> Author: nlopes Date: Tue Nov 4 07:02:59 2008 New Revision: 58690 URL: http://llvm.org/viewvc/llvm-project?rev=58690&view=rev Log: fix leakage of IfcvtTokens Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=58690&r1=58689&r2=58690&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Nov 4 07:02:59 2008 @@ -256,6 +256,10 @@ Tokens.pop_back(); BBInfo &BBI = Token->BBI; IfcvtKind Kind = Token->Kind; + unsigned NumDups = Token->NumDups; + unsigned NumDups2 = Token->NumDups; + + delete Token; // If the block has been evicted out of the queue or it has already been // marked dead (due to it being predicated), then skip it. @@ -323,7 +327,7 @@ DOUT << "Ifcvt (Diamond): BB#" << BBI.BB->getNumber() << " (T:" << BBI.TrueBB->getNumber() << ",F:" << BBI.FalseBB->getNumber() << ") "; - RetVal = IfConvertDiamond(BBI, Kind, Token->NumDups, Token->NumDups2); + RetVal = IfConvertDiamond(BBI, Kind, NumDups, NumDups2); DOUT << (RetVal ? "succeeded!" : "failed!") << "\n"; if (RetVal) NumDiamonds++; break; From duncan.sands at math.u-psud.fr Tue Nov 4 07:15:18 2008 From: duncan.sands at math.u-psud.fr (Duncan Sands) Date: Tue, 4 Nov 2008 14:15:18 +0100 Subject: [llvm-commits] [llvm] r58623 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h lib/VMCore/ValueTypes.cpp test/CodeGen/X86/i2k.ll utils/TableGen/CMakeLists.txt utils/TableGen/TGValueTypes.cpp In-Reply-To: <822CF83A-249C-4FB3-8D72-750E76E20D87@apple.com> References: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu> <200811041038.36565.duncan.sands@math.u-psud.fr> <822CF83A-249C-4FB3-8D72-750E76E20D87@apple.com> Message-ID: <200811041415.18278.duncan.sands@math.u-psud.fr> > > Here's a crazy idea. I hear that people are working on "libllvm", > > a reimplementation of libgcc. Maybe instead the code generator > > could be taught to generate library functions on the fly. For > > example, suppose a call to __udivsi3 is needed. Then the code > > generator creates the function __udivsi3 in the assembler, with > > weak linkage. Thanks to weak linkage there will be only one > > copy no matter how many object files it turns up in, and there > > is no need to link with libllvm. Now imagine that you need a > > similar library function to __udivsi3, but for i1024. Then you > > can have the code generators squirt out __udivsiXYZ! > > I think it would be better to make an arbitrary precision version of > udiv that takes a pointer to the integer in memory, and the size in > bits as an argument. Spoilsport :) That said, the current design of breaking big integers into registers is not well adapted to huge integers. It's a bit like first class aggregates in that respect. So if someone wants to go down the i1024 arithmetic route, they probably should start by rethinking the break-into-registers design. Ciao, Duncan. From clattner at apple.com Tue Nov 4 07:28:13 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 4 Nov 2008 05:28:13 -0800 Subject: [llvm-commits] [llvm] r58673 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/StackProtector.cpp In-Reply-To: <200811040210.mA42ANXh009663@zion.cs.uiuc.edu> References: <200811040210.mA42ANXh009663@zion.cs.uiuc.edu> Message-ID: On Nov 3, 2008, at 6:10 PM, Bill Wendling wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=58673&view=rev > Log: > Initial checkin for stack protectors. Here's what it does: Cool! Some questions/comments below: > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) > +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Mon Nov 3 20:10:20 > 2008 > @@ -60,6 +60,11 @@ > EnableFastISelOption("fast-isel", cl::Hidden, > cl::desc("Enable the experimental \"fast\" instruction selector")); > > +// Enable stack protectors. > +static cl::opt > +EnableStackProtector("enable-stack-protector", cl::init(0), > + cl::desc("Use ProPolice as a stack protection > method.")); I don't know what "ProPolice" is, but it sounds like it may be a trademark or something. Please just use "stack canary" or something generic like that. Also, you should use an enum for this, not magic integer numbers. I'd like to see -enable-stack-protector=all | some | none. > @@ -165,6 +170,8 @@ > if (!Fast) > PM.add(createCodeGenPreparePass(getTargetLowering())); > > + PM.add(createStackProtectorPass(EnableStackProtector)); Why do you add the pass even when it is not enabled? Have you looked at whether adding this pass ends up breaking analysis chains, and requiring them to be run multiple times? For example, does dominators end up being run more frequently with this? If so, the pass should update dominators instead of invalidating it. > @@ -0,0 +1,228 @@ > +//===-- StackProtector.cpp - Stack Protector Insertion > --------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// > +// This pass inserts stack protectors into functions which need > them. The stack > +// protectors this uses are the type that ProPolice used. A > variable with a Please remove references to ProPolice and make the documentation self contained instead. > > +// random value in it is stored onto the stack before the local > variables are > +// allocated. Upon exitting the block, the stored value is checked. > If it's typo exiting. > +// Enable stack protectors. > +static cl::opt > +SSPBufferSize("ssp-buffer-size", cl::init(8), > + cl::desc("The lower bound for a buffer to be > considered for " > + "stack smashing protection.")); why the contraction ssp? Please use something like "stack-protector- buffer-size" or something like that, for similarity with the enable- stack-protector option. > > + > +namespace { > + class VISIBILITY_HIDDEN StackProtector : public FunctionPass { > + // Level == 0 -- Stack protectors are off. > + // Level == 1 -- Stack protectors are on only for some > functions. > + // Level == 2 -- Stack protectors are on for all functions. > + int Level; I think that this should be an enum in Passes.h, which can also be used above for the command line option. > > ++ /// RequiresStackProtector - Check whether or not this > function needs a > + /// stack protector based upon the stack protector level. > + bool RequiresStackProtector(); This should be const. > +/// InsertStackProtectorPrologue - Insert code into the entry block > that stores > +/// the __stack_chk_guard variable onto the stack. > +void StackProtector::InsertStackProtectorPrologue() { > + BasicBlock &Entry = F->getEntryBlock(); > + Instruction &InsertPt = Entry.front(); > + > + const char *StackGuardStr = "__stack_chk_guard"; > + StackGuardVar = M->getNamedGlobal(StackGuardStr) If the module already has a '__stack_chk_guard' global with the wrong type, I think this code will crash, see below: > > + if (!StackGuardVar) > + StackGuardVar = new > GlobalVariable(PointerType::getUnqual(Type::Int8Ty), > + false, > GlobalValue::ExternalLinkage, > + 0, StackGuardStr, M); We really want a Module::getOrInsertGlobal() method that works like getOrInsertFunction. It would do the bitcast to solve the problem above and factor away this code. Can you please add this? > + StackProtFrameSlot = new > AllocaInst(PointerType::getUnqual(Type::Int8Ty), > + "StackProt_Frame", &InsertPt); What ensures that this alloca ends up in the right place in the stack frame at codegen time? > + LoadInst *LI = new LoadInst(StackGuardVar, "StackGuard", true, > &InsertPt); > + new StoreInst(LI, StackProtFrameSlot, true, &InsertPt); Please add a comment indicating why these are volatile. Why is the load volatile? > +/// InsertStackProtectorEpilogue - Insert code before the return > instructions > +/// checking the stack value that was stored in the prologue. If it > isn't the > +/// same as the original value, then call a "failure" function. > +void StackProtector::InsertStackProtectorEpilogue() { > + // Create the basic block to jump to when the guard check fails. > + CreateFailBB(); > + > + Function::iterator I = F->begin(), E = F->end(); > + std::vector ReturnBBs; > + ReturnBBs.reserve(F->size()); > + > + for (; I != E; ++I) > + if (isa((*I).getTerminator())) > + ReturnBBs.push_back(I); Two things: first, use I->getTerminator. Second, why do you make a vector of returns and iterate over the vector? You should be able to handle all of these with one pass over the function without the intermediate vector. Also, F->size() is linear time, so that itself does a pass over the function. > + for (std::vector::iterator > + II = ReturnBBs.begin(), IE = ReturnBBs.end(); II != IE; + > +II) { > + BasicBlock *BB = *II; > + ReturnInst *RI = cast(BB->getTerminator()); > + Function::iterator InsPt = BB; ++InsPt; // Insertion point for > new BB. > + > + BasicBlock *NewBB = BasicBlock::Create("SPRet", F, InsPt); > + > + // Move the return instruction into the new basic block. > + RI->removeFromParent(); > + NewBB->getInstList().insert(NewBB->begin(), RI); Please use BasicBlock::splitBasicBlock to simplify this code. > +/// CreateFailBB - Create a basic block to jump to when the stack > protector > +/// check fails. > +void StackProtector::CreateFailBB() { > + assert(!FailBB && "Failure basic block already created?!"); > + FailBB = BasicBlock::Create("CallStackCheckFailBlk", F); > + std::vector Params; > + Constant *StackChkFail = > + M->getOrInsertFunction("__stack_chk_fail", > + FunctionType::get(Type::VoidTy, Params, > false)); You can eliminate the temporary vector by using the varargs form of getOrInsertFunction: Constant *StackChkFail = M->getOrInsertFunction("__stack_chk_fail", Type::VoidTy, NULL); > +/// RequiresStackProtector - Check whether or not this function > needs a stack > +/// protector based upon the stack protector level. > +bool StackProtector::RequiresStackProtector() { > + switch (Level) { > + default: return false; > + case 2: return true; > + case 1: { Please use enums instead of magic numbers :) > + // If the size of the local variables allocated on the stack is > greater than > + // SSPBufferSize, then we require a stack protector. > + uint64_t StackSize = 0; > + > + for (Function::iterator I = F->begin(), E = F->end(); I != E; + > +I) { > + BasicBlock *BB = I; > + > + for (BasicBlock::iterator > + II = BB->begin(), IE = BB->end(); II != IE; ++II) > + if (AllocaInst *AI = dyn_cast(II)) > + if (ConstantInt *CI = dyn_cast(AI- > >getArraySize())) { > + const APInt &Size = CI->getValue(); > + StackSize += Size.getZExtValue() * 8; > + } This isn't sufficient. If you have "alloca i32", the array size is 1. You need to use TargetData to multiply the array size by the size of the type. Also, is the protection size in bits or bytes? Does GCC ignore variable sized stack allocations? > + if (SSPBufferSize <= StackSize) > + return true; This check should be moved inside the loop so that you stop scanning a function as soon as you see at least enough to qualify for stack protection. > > + > +// [EOF] StackProtector.cpp Urr? -Chris From clattner at apple.com Tue Nov 4 07:28:51 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 4 Nov 2008 05:28:51 -0800 Subject: [llvm-commits] [llvm] r58623 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h lib/VMCore/ValueTypes.cpp test/CodeGen/X86/i2k.ll utils/TableGen/CMakeLists.txt utils/TableGen/TGValueTypes.cpp In-Reply-To: <200811041415.18278.duncan.sands@math.u-psud.fr> References: <200811031756.mA3HuRvA017091@zion.cs.uiuc.edu> <200811041038.36565.duncan.sands@math.u-psud.fr> <822CF83A-249C-4FB3-8D72-750E76E20D87@apple.com> <200811041415.18278.duncan.sands@math.u-psud.fr> Message-ID: On Nov 4, 2008, at 5:15 AM, Duncan Sands wrote: >>> Here's a crazy idea. I hear that people are working on "libllvm", >>> a reimplementation of libgcc. Maybe instead the code generator >>> could be taught to generate library functions on the fly. For >>> example, suppose a call to __udivsi3 is needed. Then the code >>> generator creates the function __udivsi3 in the assembler, with >>> weak linkage. Thanks to weak linkage there will be only one >>> copy no matter how many object files it turns up in, and there >>> is no need to link with libllvm. Now imagine that you need a >>> similar library function to __udivsi3, but for i1024. Then you >>> can have the code generators squirt out __udivsiXYZ! >> >> I think it would be better to make an arbitrary precision version of >> udiv that takes a pointer to the integer in memory, and the size in >> bits as an argument. > > Spoilsport :) That said, the current design of breaking big integers > into registers is not well adapted to huge integers. It's a bit like > first class aggregates in that respect. So if someone wants to go > down > the i1024 arithmetic route, they probably should start by rethinking > the break-into-registers design. I agree, I doubt that this will be a real priority for anyone in the near future. -Chris From nunoplopes at sapo.pt Tue Nov 4 08:26:59 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 04 Nov 2008 14:26:59 -0000 Subject: [llvm-commits] [llvm] r58693 - /llvm/trunk/lib/AsmParser/llvmAsmParser.y Message-ID: <200811041426.mA4EQx5B011121@zion.cs.uiuc.edu> Author: nlopes Date: Tue Nov 4 08:26:58 2008 New Revision: 58693 URL: http://llvm.org/viewvc/llvm-project?rev=58693&view=rev Log: fix leakage of APSInt in getVal() Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=58693&r1=58692&r2=58693&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Nov 4 08:26:58 2008 @@ -418,6 +418,7 @@ { APSInt Tmp = *D.ConstPoolInt; + D.destroy(); Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits()); return ConstantInt::get(Tmp); } From nunoplopes at sapo.pt Tue Nov 4 08:28:33 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 04 Nov 2008 14:28:33 -0000 Subject: [llvm-commits] [llvm] r58694 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200811041428.mA4ESXe0011174@zion.cs.uiuc.edu> Author: nlopes Date: Tue Nov 4 08:28:33 2008 New Revision: 58694 URL: http://llvm.org/viewvc/llvm-project?rev=58694&view=rev Log: regenerate Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=58694&r1=58693&r2=58694&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Nov 4 08:28:33 2008 @@ -802,6 +802,7 @@ { APSInt Tmp = *D.ConstPoolInt; + D.destroy(); Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits()); return ConstantInt::get(Tmp); } @@ -1382,7 +1383,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 981 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1431,7 +1432,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 187 of yacc.c. */ -#line 1435 "llvmAsmParser.tab.c" +#line 1436 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1444,7 +1445,7 @@ /* Line 216 of yacc.c. */ -#line 1448 "llvmAsmParser.tab.c" +#line 1449 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1888,41 +1889,41 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, - 1147, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149, - 1149, 1149, 1149, 1150, 1150, 1150, 1150, 1150, 1150, 1153, - 1153, 1154, 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1161, - 1161, 1162, 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1166, - 1166, 1167, 1167, 1168, 1169, 1172, 1172, 1172, 1173, 1173, - 1175, 1176, 1180, 1184, 1189, 1195, 1195, 1197, 1198, 1203, - 1209, 1210, 1211, 1212, 1213, 1214, 1218, 1219, 1220, 1224, - 1225, 1226, 1227, 1231, 1232, 1233, 1237, 1238, 1239, 1240, - 1241, 1245, 1246, 1247, 1250, 1251, 1252, 1253, 1254, 1255, - 1256, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, - 1272, 1276, 1277, 1282, 1283, 1284, 1287, 1288, 1294, 1295, - 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1306, 1307, - 1313, 1314, 1321, 1322, 1328, 1329, 1338, 1346, 1347, 1352, - 1353, 1354, 1359, 1372, 1372, 1372, 1372, 1372, 1372, 1372, - 1375, 1379, 1383, 1390, 1395, 1403, 1438, 1469, 1474, 1484, - 1494, 1498, 1508, 1515, 1524, 1531, 1536, 1541, 1548, 1549, - 1556, 1563, 1571, 1577, 1589, 1617, 1633, 1660, 1688, 1714, - 1734, 1760, 1780, 1792, 1799, 1865, 1875, 1885, 1896, 1909, - 1920, 1934, 1941, 1948, 1966, 1978, 1999, 2007, 2013, 2024, - 2029, 2034, 2039, 2044, 2050, 2056, 2062, 2070, 2081, 2085, - 2093, 2093, 2096, 2096, 2099, 2111, 2132, 2137, 2145, 2146, - 2150, 2150, 2154, 2154, 2157, 2160, 2184, 2196, 2195, 2207, - 2206, 2216, 2215, 2226, 2266, 2269, 2275, 2285, 2289, 2294, - 2296, 2301, 2306, 2315, 2325, 2336, 2340, 2349, 2358, 2363, - 2512, 2512, 2514, 2523, 2523, 2525, 2530, 2542, 2546, 2551, - 2555, 2559, 2564, 2569, 2573, 2577, 2581, 2585, 2589, 2593, - 2615, 2637, 2643, 2656, 2668, 2673, 2685, 2691, 2695, 2705, - 2709, 2713, 2718, 2725, 2725, 2731, 2740, 2745, 2750, 2754, - 2763, 2772, 2785, 2794, 2798, 2806, 2826, 2830, 2835, 2846, - 2865, 2874, 2978, 2982, 2989, 3000, 3013, 3022, 3035, 3046, - 3056, 3067, 3075, 3085, 3092, 3095, 3096, 3104, 3110, 3119, - 3123, 3128, 3144, 3161, 3173, 3185, 3199, 3213, 3225, 3246, - 3253, 3259, 3265, 3271, 3286, 3396, 3401, 3405, 3412, 3419, - 3429, 3436, 3446, 3454, 3468, 3485, 3499, 3514, 3529 + 0, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, + 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1150, + 1150, 1150, 1150, 1151, 1151, 1151, 1151, 1151, 1151, 1154, + 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1158, 1158, 1162, + 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1166, 1166, 1167, + 1167, 1168, 1168, 1169, 1170, 1173, 1173, 1173, 1174, 1174, + 1176, 1177, 1181, 1185, 1190, 1196, 1196, 1198, 1199, 1204, + 1210, 1211, 1212, 1213, 1214, 1215, 1219, 1220, 1221, 1225, + 1226, 1227, 1228, 1232, 1233, 1234, 1238, 1239, 1240, 1241, + 1242, 1246, 1247, 1248, 1251, 1252, 1253, 1254, 1255, 1256, + 1257, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, + 1273, 1277, 1278, 1283, 1284, 1285, 1288, 1289, 1295, 1296, + 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1307, 1308, + 1314, 1315, 1322, 1323, 1329, 1330, 1339, 1347, 1348, 1353, + 1354, 1355, 1360, 1373, 1373, 1373, 1373, 1373, 1373, 1373, + 1376, 1380, 1384, 1391, 1396, 1404, 1439, 1470, 1475, 1485, + 1495, 1499, 1509, 1516, 1525, 1532, 1537, 1542, 1549, 1550, + 1557, 1564, 1572, 1578, 1590, 1618, 1634, 1661, 1689, 1715, + 1735, 1761, 1781, 1793, 1800, 1866, 1876, 1886, 1897, 1910, + 1921, 1935, 1942, 1949, 1967, 1979, 2000, 2008, 2014, 2025, + 2030, 2035, 2040, 2045, 2051, 2057, 2063, 2071, 2082, 2086, + 2094, 2094, 2097, 2097, 2100, 2112, 2133, 2138, 2146, 2147, + 2151, 2151, 2155, 2155, 2158, 2161, 2185, 2197, 2196, 2208, + 2207, 2217, 2216, 2227, 2267, 2270, 2276, 2286, 2290, 2295, + 2297, 2302, 2307, 2316, 2326, 2337, 2341, 2350, 2359, 2364, + 2513, 2513, 2515, 2524, 2524, 2526, 2531, 2543, 2547, 2552, + 2556, 2560, 2565, 2570, 2574, 2578, 2582, 2586, 2590, 2594, + 2616, 2638, 2644, 2657, 2669, 2674, 2686, 2692, 2696, 2706, + 2710, 2714, 2719, 2726, 2726, 2732, 2741, 2746, 2751, 2755, + 2764, 2773, 2786, 2795, 2799, 2807, 2827, 2831, 2836, 2847, + 2866, 2875, 2979, 2983, 2990, 3001, 3014, 3023, 3036, 3047, + 3057, 3068, 3076, 3086, 3093, 3096, 3097, 3105, 3111, 3120, + 3124, 3129, 3145, 3162, 3174, 3186, 3200, 3214, 3226, 3247, + 3254, 3260, 3266, 3272, 3287, 3397, 3402, 3406, 3413, 3420, + 3430, 3437, 3447, 3455, 3469, 3486, 3500, 3515, 3530 }; #endif @@ -3648,152 +3649,152 @@ switch (yyn) { case 29: -#line 1153 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1153 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 59: -#line 1173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 60: -#line 1175 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 61: -#line 1176 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1177 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 62: -#line 1180 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3801,7 +3802,7 @@ break; case 63: -#line 1184 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3809,7 +3810,7 @@ break; case 64: -#line 1189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1190 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3817,7 +3818,7 @@ break; case 68: -#line 1198 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3825,7 +3826,7 @@ break; case 69: -#line 1203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3833,157 +3834,157 @@ break; case 70: -#line 1209 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 71: -#line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 72: -#line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 73: -#line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 74: -#line 1213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 75: -#line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 76: -#line 1218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 77: -#line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 78: -#line 1220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1221 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1224 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 80: -#line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 81: -#line 1226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 82: -#line 1227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1228 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 83: -#line 1231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 84: -#line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 85: -#line 1233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 86: -#line 1237 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 87: -#line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 88: -#line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 89: -#line 1240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 90: -#line 1241 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 91: -#line 1245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 92: -#line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 93: -#line 1247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1250 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 95: -#line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 96: -#line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 97: -#line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 98: -#line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 99: -#line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 100: -#line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3993,176 +3994,176 @@ break; case 101: -#line 1263 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 102: -#line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 103: -#line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 104: -#line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 105: -#line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 106: -#line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::StructRet; ;} break; case 107: -#line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoAlias; ;} break; case 108: -#line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ByVal; ;} break; case 109: -#line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::Nest; ;} break; case 110: -#line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 111: -#line 1276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 112: -#line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 113: -#line 1282 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 114: -#line 1283 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1284 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 115: -#line 1284 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 116: -#line 1287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 117: -#line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 118: -#line 1294 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoReturn; ;} break; case 119: -#line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoUnwind; ;} break; case 120: -#line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 121: -#line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 122: -#line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 123: -#line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadNone; ;} break; case 124: -#line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadOnly; ;} break; case 125: -#line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoInline; ;} break; case 126: -#line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::AlwaysInline; ;} break; case 127: -#line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::OptimizeForSize; ;} break; case 128: -#line 1306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 129: -#line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1308 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 130: -#line 1313 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 131: -#line 1314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1315 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 132: -#line 1321 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1322 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 133: -#line 1322 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1323 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4172,12 +4173,12 @@ break; case 134: -#line 1328 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1329 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 135: -#line 1329 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1330 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4187,7 +4188,7 @@ break; case 136: -#line 1338 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1339 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4198,27 +4199,27 @@ break; case 137: -#line 1346 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1347 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 138: -#line 1347 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1348 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 139: -#line 1352 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 140: -#line 1353 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 141: -#line 1354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1355 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4227,7 +4228,7 @@ break; case 142: -#line 1359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1360 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4237,7 +4238,7 @@ break; case 150: -#line 1375 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1376 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4245,7 +4246,7 @@ break; case 151: -#line 1379 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4253,7 +4254,7 @@ break; case 152: -#line 1383 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1384 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4264,7 +4265,7 @@ break; case 153: -#line 1390 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1391 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4273,7 +4274,7 @@ break; case 154: -#line 1395 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1396 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4285,7 +4286,7 @@ break; case 155: -#line 1403 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1404 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4324,7 +4325,7 @@ break; case 156: -#line 1438 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1439 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4358,7 +4359,7 @@ break; case 157: -#line 1469 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1470 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4367,7 +4368,7 @@ break; case 158: -#line 1474 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1475 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4381,7 +4382,7 @@ break; case 159: -#line 1484 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1485 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4395,7 +4396,7 @@ break; case 160: -#line 1494 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1495 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4403,7 +4404,7 @@ break; case 161: -#line 1498 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4417,7 +4418,7 @@ break; case 162: -#line 1508 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1509 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4425,7 +4426,7 @@ break; case 163: -#line 1515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1516 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4435,7 +4436,7 @@ break; case 164: -#line 1524 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4446,14 +4447,14 @@ break; case 165: -#line 1531 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1532 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 166: -#line 1536 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1537 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4462,7 +4463,7 @@ break; case 167: -#line 1541 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1542 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4470,7 +4471,7 @@ break; case 169: -#line 1549 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1550 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4481,7 +4482,7 @@ break; case 170: -#line 1556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1557 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4492,7 +4493,7 @@ break; case 171: -#line 1563 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4500,7 +4501,7 @@ break; case 172: -#line 1571 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1572 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4510,7 +4511,7 @@ break; case 173: -#line 1577 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4519,7 +4520,7 @@ break; case 174: -#line 1589 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4551,7 +4552,7 @@ break; case 175: -#line 1617 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1618 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4571,7 +4572,7 @@ break; case 176: -#line 1633 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1634 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4602,7 +4603,7 @@ break; case 177: -#line 1660 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1661 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4634,7 +4635,7 @@ break; case 178: -#line 1688 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1689 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4664,7 +4665,7 @@ break; case 179: -#line 1714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1715 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4688,7 +4689,7 @@ break; case 180: -#line 1734 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1735 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4718,7 +4719,7 @@ break; case 181: -#line 1760 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1761 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4742,7 +4743,7 @@ break; case 182: -#line 1780 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1781 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4758,7 +4759,7 @@ break; case 183: -#line 1792 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1793 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4769,7 +4770,7 @@ break; case 184: -#line 1799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1800 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4839,7 +4840,7 @@ break; case 185: -#line 1865 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4853,7 +4854,7 @@ break; case 186: -#line 1875 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4867,7 +4868,7 @@ break; case 187: -#line 1885 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1886 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val))) @@ -4882,7 +4883,7 @@ break; case 188: -#line 1896 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1897 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth()) @@ -4899,7 +4900,7 @@ break; case 189: -#line 1909 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1910 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val))) @@ -4914,7 +4915,7 @@ break; case 190: -#line 1920 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth()) @@ -4932,7 +4933,7 @@ break; case 191: -#line 1934 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1935 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty) GEN_ERROR("Constant true must have type i1"); @@ -4943,7 +4944,7 @@ break; case 192: -#line 1941 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1942 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty) GEN_ERROR("Constant false must have type i1"); @@ -4954,7 +4955,7 @@ break; case 193: -#line 1948 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1949 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4974,7 +4975,7 @@ break; case 194: -#line 1966 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1967 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4990,7 +4991,7 @@ break; case 195: -#line 1978 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -5015,7 +5016,7 @@ break; case 196: -#line 1999 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2000 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -5027,7 +5028,7 @@ break; case 197: -#line 2007 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2008 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -5037,7 +5038,7 @@ break; case 198: -#line 2013 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -5052,7 +5053,7 @@ break; case 199: -#line 2024 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2025 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -5061,7 +5062,7 @@ break; case 200: -#line 2029 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2030 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -5070,7 +5071,7 @@ break; case 201: -#line 2034 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2035 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -5079,7 +5080,7 @@ break; case 202: -#line 2039 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2040 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -5088,7 +5089,7 @@ break; case 203: -#line 2044 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2045 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5098,7 +5099,7 @@ break; case 204: -#line 2050 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2051 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5108,7 +5109,7 @@ break; case 205: -#line 2056 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5118,7 +5119,7 @@ break; case 206: -#line 2062 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2063 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5130,7 +5131,7 @@ break; case 207: -#line 2070 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2071 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5142,7 +5143,7 @@ break; case 208: -#line 2081 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2082 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5150,7 +5151,7 @@ break; case 209: -#line 2085 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5159,27 +5160,27 @@ break; case 210: -#line 2093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 211: -#line 2093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 212: -#line 2096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 213: -#line 2096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 214: -#line 2099 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2100 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5195,7 +5196,7 @@ break; case 215: -#line 2111 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2112 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5211,7 +5212,7 @@ break; case 216: -#line 2132 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2133 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5220,7 +5221,7 @@ break; case 217: -#line 2137 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2138 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5229,12 +5230,12 @@ break; case 220: -#line 2150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 221: -#line 2150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5242,26 +5243,26 @@ break; case 222: -#line 2154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 223: -#line 2154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 224: -#line 2157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 225: -#line 2160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5289,7 +5290,7 @@ break; case 226: -#line 2184 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5304,7 +5305,7 @@ break; case 227: -#line 2196 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2197 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5316,14 +5317,14 @@ break; case 228: -#line 2203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 229: -#line 2207 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5333,14 +5334,14 @@ break; case 230: -#line 2212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 231: -#line 2216 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5351,7 +5352,7 @@ break; case 232: -#line 2222 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5359,7 +5360,7 @@ break; case 233: -#line 2226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5403,21 +5404,21 @@ break; case 234: -#line 2266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 235: -#line 2269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 236: -#line 2275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5430,7 +5431,7 @@ break; case 237: -#line 2285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2286 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5438,7 +5439,7 @@ break; case 238: -#line 2289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2290 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5446,7 +5447,7 @@ break; case 240: -#line 2296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5455,7 +5456,7 @@ break; case 241: -#line 2301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5464,14 +5465,14 @@ break; case 242: -#line 2306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 243: -#line 2315 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2316 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5485,7 +5486,7 @@ break; case 244: -#line 2325 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5499,7 +5500,7 @@ break; case 245: -#line 2336 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2337 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5507,7 +5508,7 @@ break; case 246: -#line 2340 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2341 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5520,7 +5521,7 @@ break; case 247: -#line 2349 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2350 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5533,7 +5534,7 @@ break; case 248: -#line 2358 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5541,7 +5542,7 @@ break; case 249: -#line 2364 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2365 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(4) - (11)].StrVal)); delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory! @@ -5692,7 +5693,7 @@ break; case 252: -#line 2514 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5704,7 +5705,7 @@ break; case 255: -#line 2525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2526 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5712,7 +5713,7 @@ break; case 256: -#line 2530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2531 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5723,7 +5724,7 @@ break; case 257: -#line 2542 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2543 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5731,7 +5732,7 @@ break; case 258: -#line 2546 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5739,7 +5740,7 @@ break; case 259: -#line 2551 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2552 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5747,7 +5748,7 @@ break; case 260: -#line 2555 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5755,7 +5756,7 @@ break; case 261: -#line 2559 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2560 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5764,7 +5765,7 @@ break; case 262: -#line 2564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2565 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5773,7 +5774,7 @@ break; case 263: -#line 2569 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2570 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5781,7 +5782,7 @@ break; case 264: -#line 2573 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2574 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5789,7 +5790,7 @@ break; case 265: -#line 2577 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5797,7 +5798,7 @@ break; case 266: -#line 2581 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5805,7 +5806,7 @@ break; case 267: -#line 2585 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2586 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5813,7 +5814,7 @@ break; case 268: -#line 2589 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5821,7 +5822,7 @@ break; case 269: -#line 2593 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5847,7 +5848,7 @@ break; case 270: -#line 2615 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2616 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5873,7 +5874,7 @@ break; case 271: -#line 2637 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2638 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5883,7 +5884,7 @@ break; case 272: -#line 2643 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2644 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5900,7 +5901,7 @@ break; case 273: -#line 2656 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2657 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5916,7 +5917,7 @@ break; case 274: -#line 2668 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2669 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5925,7 +5926,7 @@ break; case 275: -#line 2673 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2674 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5941,7 +5942,7 @@ break; case 276: -#line 2685 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2686 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5951,7 +5952,7 @@ break; case 277: -#line 2691 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2692 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5959,7 +5960,7 @@ break; case 278: -#line 2695 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2696 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5969,7 +5970,7 @@ break; case 279: -#line 2705 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2706 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5977,7 +5978,7 @@ break; case 280: -#line 2709 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2710 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5985,7 +5986,7 @@ break; case 281: -#line 2713 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5994,7 +5995,7 @@ break; case 282: -#line 2718 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -6003,7 +6004,7 @@ break; case 285: -#line 2731 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2732 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -6014,7 +6015,7 @@ break; case 286: -#line 2740 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2741 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -6023,7 +6024,7 @@ break; case 287: -#line 2745 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2746 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -6031,7 +6032,7 @@ break; case 288: -#line 2750 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2751 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6039,7 +6040,7 @@ break; case 289: -#line 2754 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2755 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6047,7 +6048,7 @@ break; case 290: -#line 2763 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2764 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -6059,7 +6060,7 @@ break; case 291: -#line 2772 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2773 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -6074,7 +6075,7 @@ break; case 292: -#line 2785 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2786 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -6087,7 +6088,7 @@ break; case 293: -#line 2794 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2795 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -6095,7 +6096,7 @@ break; case 294: -#line 2798 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -6105,7 +6106,7 @@ break; case 295: -#line 2806 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2807 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6129,7 +6130,7 @@ break; case 296: -#line 2826 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2827 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -6137,7 +6138,7 @@ break; case 297: -#line 2830 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2831 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6146,7 +6147,7 @@ break; case 298: -#line 2835 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2836 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6161,7 +6162,7 @@ break; case 299: -#line 2846 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2847 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6184,7 +6185,7 @@ break; case 300: -#line 2865 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6197,7 +6198,7 @@ break; case 301: -#line 2875 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6304,7 +6305,7 @@ break; case 302: -#line 2978 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6312,7 +6313,7 @@ break; case 303: -#line 2982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6320,7 +6321,7 @@ break; case 304: -#line 2989 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2990 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6335,7 +6336,7 @@ break; case 305: -#line 3000 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3001 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6351,7 +6352,7 @@ break; case 306: -#line 3013 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6363,7 +6364,7 @@ break; case 307: -#line 3022 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3023 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6378,7 +6379,7 @@ break; case 308: -#line 3035 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3036 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6393,7 +6394,7 @@ break; case 309: -#line 3046 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3047 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6405,7 +6406,7 @@ break; case 310: -#line 3056 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6420,7 +6421,7 @@ break; case 311: -#line 3067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3068 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6432,7 +6433,7 @@ break; case 312: -#line 3075 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3076 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6446,7 +6447,7 @@ break; case 313: -#line 3085 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6457,17 +6458,17 @@ break; case 314: -#line 3092 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 315: -#line 3095 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 316: -#line 3096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6476,7 +6477,7 @@ break; case 317: -#line 3104 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3105 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6486,7 +6487,7 @@ break; case 318: -#line 3110 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3111 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6497,7 +6498,7 @@ break; case 319: -#line 3119 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3120 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6505,7 +6506,7 @@ break; case 320: -#line 3123 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3124 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6513,7 +6514,7 @@ break; case 321: -#line 3128 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3129 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6533,7 +6534,7 @@ break; case 322: -#line 3144 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3145 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6554,7 +6555,7 @@ break; case 323: -#line 3161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6570,7 +6571,7 @@ break; case 324: -#line 3173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6586,7 +6587,7 @@ break; case 325: -#line 3185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3186 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6604,7 +6605,7 @@ break; case 326: -#line 3199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3200 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6622,7 +6623,7 @@ break; case 327: -#line 3213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6638,7 +6639,7 @@ break; case 328: -#line 3225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (isa((yyvsp[(2) - (6)].ValueVal)->getType())) { // vector select @@ -6663,7 +6664,7 @@ break; case 329: -#line 3246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6674,7 +6675,7 @@ break; case 330: -#line 3253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6684,7 +6685,7 @@ break; case 331: -#line 3259 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3260 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6694,7 +6695,7 @@ break; case 332: -#line 3265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6704,7 +6705,7 @@ break; case 333: -#line 3271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6723,7 +6724,7 @@ break; case 334: -#line 3287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6836,7 +6837,7 @@ break; case 335: -#line 3396 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3397 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR @@ -6844,7 +6845,7 @@ break; case 336: -#line 3401 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3402 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6852,7 +6853,7 @@ break; case 337: -#line 3405 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3406 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6860,7 +6861,7 @@ break; case 338: -#line 3412 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3413 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6871,7 +6872,7 @@ break; case 339: -#line 3419 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3420 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6885,7 +6886,7 @@ break; case 340: -#line 3429 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3430 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6896,7 +6897,7 @@ break; case 341: -#line 3436 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3437 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6910,7 +6911,7 @@ break; case 342: -#line 3446 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3447 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6921,7 +6922,7 @@ break; case 343: -#line 3454 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3455 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6939,7 +6940,7 @@ break; case 344: -#line 3468 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3469 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6960,7 +6961,7 @@ break; case 345: -#line 3485 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3486 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6978,7 +6979,7 @@ break; case 346: -#line 3499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3500 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6997,7 +6998,7 @@ break; case 347: -#line 3514 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -7016,7 +7017,7 @@ break; case 348: -#line 3529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -7038,7 +7039,7 @@ /* Line 1267 of yacc.c. */ -#line 7042 "llvmAsmParser.tab.c" +#line 7043 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -7252,7 +7253,7 @@ } -#line 3548 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3549 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=58694&r1=58693&r2=58694&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Nov 4 08:28:33 2008 @@ -360,7 +360,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 981 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=58694&r1=58693&r2=58694&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Nov 4 08:28:33 2008 @@ -418,6 +418,7 @@ { APSInt Tmp = *D.ConstPoolInt; + D.destroy(); Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits()); return ConstantInt::get(Tmp); } From nunoplopes at sapo.pt Tue Nov 4 08:42:20 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 04 Nov 2008 14:42:20 -0000 Subject: [llvm-commits] [llvm] r58696 - in /llvm/trunk/lib/AsmParser: ParserInternals.h llvmAsmParser.y Message-ID: <200811041442.mA4EgKGc011611@zion.cs.uiuc.edu> Author: nlopes Date: Tue Nov 4 08:42:19 2008 New Revision: 58696 URL: http://llvm.org/viewvc/llvm-project?rev=58696&view=rev Log: fix leakage of APFloats in getExistingVal() Modified: llvm/trunk/lib/AsmParser/ParserInternals.h llvm/trunk/lib/AsmParser/llvmAsmParser.y Modified: llvm/trunk/lib/AsmParser/ParserInternals.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/ParserInternals.h?rev=58696&r1=58695&r2=58696&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/ParserInternals.h (original) +++ llvm/trunk/lib/AsmParser/ParserInternals.h Tue Nov 4 08:42:19 2008 @@ -152,6 +152,8 @@ delete IAD; else if (Type == ConstAPInt) delete ConstPoolInt; + else if (Type == ConstFPVal) + delete ConstPoolFP; } inline ValID copy() const { Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=58696&r1=58695&r2=58696&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Nov 4 08:42:19 2008 @@ -437,7 +437,11 @@ D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &ignored); } - return ConstantFP::get(*D.ConstPoolFP); + { + ConstantFP *tmp = ConstantFP::get(*D.ConstPoolFP); + D.destroy(); + return tmp; + } case ValID::ConstNullVal: // Is it a null value? if (!isa(Ty)) { From nunoplopes at sapo.pt Tue Nov 4 08:43:20 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 04 Nov 2008 14:43:20 -0000 Subject: [llvm-commits] [llvm] r58697 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200811041443.mA4EhLfv011653@zion.cs.uiuc.edu> Author: nlopes Date: Tue Nov 4 08:43:20 2008 New Revision: 58697 URL: http://llvm.org/viewvc/llvm-project?rev=58697&view=rev Log: regenerate Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=58697&r1=58696&r2=58697&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Nov 4 08:43:20 2008 @@ -821,7 +821,11 @@ D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &ignored); } - return ConstantFP::get(*D.ConstPoolFP); + { + ConstantFP *tmp = ConstantFP::get(*D.ConstPoolFP); + D.destroy(); + return tmp; + } case ValID::ConstNullVal: // Is it a null value? if (!isa(Ty)) { @@ -1383,7 +1387,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 986 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1432,7 +1436,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 187 of yacc.c. */ -#line 1436 "llvmAsmParser.tab.c" +#line 1440 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1445,7 +1449,7 @@ /* Line 216 of yacc.c. */ -#line 1449 "llvmAsmParser.tab.c" +#line 1453 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1889,41 +1893,41 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, - 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1150, - 1150, 1150, 1150, 1151, 1151, 1151, 1151, 1151, 1151, 1154, - 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1158, 1158, 1162, - 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1166, 1166, 1167, - 1167, 1168, 1168, 1169, 1170, 1173, 1173, 1173, 1174, 1174, - 1176, 1177, 1181, 1185, 1190, 1196, 1196, 1198, 1199, 1204, - 1210, 1211, 1212, 1213, 1214, 1215, 1219, 1220, 1221, 1225, - 1226, 1227, 1228, 1232, 1233, 1234, 1238, 1239, 1240, 1241, - 1242, 1246, 1247, 1248, 1251, 1252, 1253, 1254, 1255, 1256, - 1257, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, - 1273, 1277, 1278, 1283, 1284, 1285, 1288, 1289, 1295, 1296, - 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1307, 1308, - 1314, 1315, 1322, 1323, 1329, 1330, 1339, 1347, 1348, 1353, - 1354, 1355, 1360, 1373, 1373, 1373, 1373, 1373, 1373, 1373, - 1376, 1380, 1384, 1391, 1396, 1404, 1439, 1470, 1475, 1485, - 1495, 1499, 1509, 1516, 1525, 1532, 1537, 1542, 1549, 1550, - 1557, 1564, 1572, 1578, 1590, 1618, 1634, 1661, 1689, 1715, - 1735, 1761, 1781, 1793, 1800, 1866, 1876, 1886, 1897, 1910, - 1921, 1935, 1942, 1949, 1967, 1979, 2000, 2008, 2014, 2025, - 2030, 2035, 2040, 2045, 2051, 2057, 2063, 2071, 2082, 2086, - 2094, 2094, 2097, 2097, 2100, 2112, 2133, 2138, 2146, 2147, - 2151, 2151, 2155, 2155, 2158, 2161, 2185, 2197, 2196, 2208, - 2207, 2217, 2216, 2227, 2267, 2270, 2276, 2286, 2290, 2295, - 2297, 2302, 2307, 2316, 2326, 2337, 2341, 2350, 2359, 2364, - 2513, 2513, 2515, 2524, 2524, 2526, 2531, 2543, 2547, 2552, - 2556, 2560, 2565, 2570, 2574, 2578, 2582, 2586, 2590, 2594, - 2616, 2638, 2644, 2657, 2669, 2674, 2686, 2692, 2696, 2706, - 2710, 2714, 2719, 2726, 2726, 2732, 2741, 2746, 2751, 2755, - 2764, 2773, 2786, 2795, 2799, 2807, 2827, 2831, 2836, 2847, - 2866, 2875, 2979, 2983, 2990, 3001, 3014, 3023, 3036, 3047, - 3057, 3068, 3076, 3086, 3093, 3096, 3097, 3105, 3111, 3120, - 3124, 3129, 3145, 3162, 3174, 3186, 3200, 3214, 3226, 3247, - 3254, 3260, 3266, 3272, 3287, 3397, 3402, 3406, 3413, 3420, - 3430, 3437, 3447, 3455, 3469, 3486, 3500, 3515, 3530 + 0, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, + 1152, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 1154, 1154, + 1154, 1154, 1154, 1155, 1155, 1155, 1155, 1155, 1155, 1158, + 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162, 1162, 1166, + 1166, 1167, 1167, 1168, 1168, 1169, 1169, 1170, 1170, 1171, + 1171, 1172, 1172, 1173, 1174, 1177, 1177, 1177, 1178, 1178, + 1180, 1181, 1185, 1189, 1194, 1200, 1200, 1202, 1203, 1208, + 1214, 1215, 1216, 1217, 1218, 1219, 1223, 1224, 1225, 1229, + 1230, 1231, 1232, 1236, 1237, 1238, 1242, 1243, 1244, 1245, + 1246, 1250, 1251, 1252, 1255, 1256, 1257, 1258, 1259, 1260, + 1261, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, + 1277, 1281, 1282, 1287, 1288, 1289, 1292, 1293, 1299, 1300, + 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1311, 1312, + 1318, 1319, 1326, 1327, 1333, 1334, 1343, 1351, 1352, 1357, + 1358, 1359, 1364, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1380, 1384, 1388, 1395, 1400, 1408, 1443, 1474, 1479, 1489, + 1499, 1503, 1513, 1520, 1529, 1536, 1541, 1546, 1553, 1554, + 1561, 1568, 1576, 1582, 1594, 1622, 1638, 1665, 1693, 1719, + 1739, 1765, 1785, 1797, 1804, 1870, 1880, 1890, 1901, 1914, + 1925, 1939, 1946, 1953, 1971, 1983, 2004, 2012, 2018, 2029, + 2034, 2039, 2044, 2049, 2055, 2061, 2067, 2075, 2086, 2090, + 2098, 2098, 2101, 2101, 2104, 2116, 2137, 2142, 2150, 2151, + 2155, 2155, 2159, 2159, 2162, 2165, 2189, 2201, 2200, 2212, + 2211, 2221, 2220, 2231, 2271, 2274, 2280, 2290, 2294, 2299, + 2301, 2306, 2311, 2320, 2330, 2341, 2345, 2354, 2363, 2368, + 2517, 2517, 2519, 2528, 2528, 2530, 2535, 2547, 2551, 2556, + 2560, 2564, 2569, 2574, 2578, 2582, 2586, 2590, 2594, 2598, + 2620, 2642, 2648, 2661, 2673, 2678, 2690, 2696, 2700, 2710, + 2714, 2718, 2723, 2730, 2730, 2736, 2745, 2750, 2755, 2759, + 2768, 2777, 2790, 2799, 2803, 2811, 2831, 2835, 2840, 2851, + 2870, 2879, 2983, 2987, 2994, 3005, 3018, 3027, 3040, 3051, + 3061, 3072, 3080, 3090, 3097, 3100, 3101, 3109, 3115, 3124, + 3128, 3133, 3149, 3166, 3178, 3190, 3204, 3218, 3230, 3251, + 3258, 3264, 3270, 3276, 3291, 3401, 3406, 3410, 3417, 3424, + 3434, 3441, 3451, 3459, 3473, 3490, 3504, 3519, 3534 }; #endif @@ -3649,152 +3653,152 @@ switch (yyn) { case 29: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1171 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1171 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 59: -#line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1178 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 60: -#line 1176 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 61: -#line 1177 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 62: -#line 1181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3802,7 +3806,7 @@ break; case 63: -#line 1185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3810,7 +3814,7 @@ break; case 64: -#line 1190 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3818,7 +3822,7 @@ break; case 68: -#line 1199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3826,7 +3830,7 @@ break; case 69: -#line 1204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3834,157 +3838,157 @@ break; case 70: -#line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 71: -#line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 72: -#line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1216 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 73: -#line 1213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 74: -#line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 75: -#line 1215 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 76: -#line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 77: -#line 1220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 78: -#line 1221 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1229 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 80: -#line 1226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1230 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 81: -#line 1227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 82: -#line 1228 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 83: -#line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1236 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 84: -#line 1233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 85: -#line 1234 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 86: -#line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 87: -#line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1243 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 88: -#line 1240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1244 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 89: -#line 1241 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 90: -#line 1242 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 91: -#line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 92: -#line 1247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 93: -#line 1248 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 95: -#line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 96: -#line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 97: -#line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1258 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 98: -#line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1259 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 99: -#line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1260 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 100: -#line 1257 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1261 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3994,176 +3998,176 @@ break; case 101: -#line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 102: -#line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 103: -#line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 104: -#line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 105: -#line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 106: -#line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::StructRet; ;} break; case 107: -#line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoAlias; ;} break; case 108: -#line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ByVal; ;} break; case 109: -#line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::Nest; ;} break; case 110: -#line 1273 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 111: -#line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1281 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 112: -#line 1278 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1282 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 113: -#line 1283 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 114: -#line 1284 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 115: -#line 1285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 116: -#line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 117: -#line 1289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1293 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 118: -#line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoReturn; ;} break; case 119: -#line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoUnwind; ;} break; case 120: -#line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 121: -#line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 122: -#line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 123: -#line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadNone; ;} break; case 124: -#line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1305 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadOnly; ;} break; case 125: -#line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoInline; ;} break; case 126: -#line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::AlwaysInline; ;} break; case 127: -#line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1308 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::OptimizeForSize; ;} break; case 128: -#line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1311 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 129: -#line 1308 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1312 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 130: -#line 1314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1318 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 131: -#line 1315 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1319 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 132: -#line 1322 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 133: -#line 1323 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1327 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4173,12 +4177,12 @@ break; case 134: -#line 1329 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1333 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 135: -#line 1330 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1334 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4188,7 +4192,7 @@ break; case 136: -#line 1339 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1343 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4199,27 +4203,27 @@ break; case 137: -#line 1347 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1351 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 138: -#line 1348 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1352 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 139: -#line 1353 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1357 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 140: -#line 1354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1358 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 141: -#line 1355 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4228,7 +4232,7 @@ break; case 142: -#line 1360 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1364 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4238,7 +4242,7 @@ break; case 150: -#line 1376 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4246,7 +4250,7 @@ break; case 151: -#line 1380 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1384 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4254,7 +4258,7 @@ break; case 152: -#line 1384 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1388 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4265,7 +4269,7 @@ break; case 153: -#line 1391 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1395 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4274,7 +4278,7 @@ break; case 154: -#line 1396 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1400 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4286,7 +4290,7 @@ break; case 155: -#line 1404 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1408 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4325,7 +4329,7 @@ break; case 156: -#line 1439 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1443 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4359,7 +4363,7 @@ break; case 157: -#line 1470 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1474 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4368,7 +4372,7 @@ break; case 158: -#line 1475 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1479 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4382,7 +4386,7 @@ break; case 159: -#line 1485 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1489 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4396,7 +4400,7 @@ break; case 160: -#line 1495 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4404,7 +4408,7 @@ break; case 161: -#line 1499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1503 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4418,7 +4422,7 @@ break; case 162: -#line 1509 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1513 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4426,7 +4430,7 @@ break; case 163: -#line 1516 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1520 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4436,7 +4440,7 @@ break; case 164: -#line 1525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4447,14 +4451,14 @@ break; case 165: -#line 1532 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1536 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 166: -#line 1537 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1541 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4463,7 +4467,7 @@ break; case 167: -#line 1542 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1546 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4471,7 +4475,7 @@ break; case 169: -#line 1550 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1554 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4482,7 +4486,7 @@ break; case 170: -#line 1557 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1561 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4493,7 +4497,7 @@ break; case 171: -#line 1564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1568 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4501,7 +4505,7 @@ break; case 172: -#line 1572 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1576 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4511,7 +4515,7 @@ break; case 173: -#line 1578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4520,7 +4524,7 @@ break; case 174: -#line 1590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4552,7 +4556,7 @@ break; case 175: -#line 1618 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1622 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4572,7 +4576,7 @@ break; case 176: -#line 1634 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1638 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4603,7 +4607,7 @@ break; case 177: -#line 1661 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1665 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4635,7 +4639,7 @@ break; case 178: -#line 1689 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1693 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4665,7 +4669,7 @@ break; case 179: -#line 1715 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4689,7 +4693,7 @@ break; case 180: -#line 1735 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1739 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4719,7 +4723,7 @@ break; case 181: -#line 1761 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1765 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4743,7 +4747,7 @@ break; case 182: -#line 1781 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1785 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4759,7 +4763,7 @@ break; case 183: -#line 1793 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1797 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4770,7 +4774,7 @@ break; case 184: -#line 1800 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1804 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4840,7 +4844,7 @@ break; case 185: -#line 1866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1870 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4854,7 +4858,7 @@ break; case 186: -#line 1876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1880 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4868,7 +4872,7 @@ break; case 187: -#line 1886 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1890 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val))) @@ -4883,7 +4887,7 @@ break; case 188: -#line 1897 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1901 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth()) @@ -4900,7 +4904,7 @@ break; case 189: -#line 1910 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1914 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val))) @@ -4915,7 +4919,7 @@ break; case 190: -#line 1921 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1925 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants if (IntegerType *IT = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get())) { if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth()) @@ -4933,7 +4937,7 @@ break; case 191: -#line 1935 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1939 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty) GEN_ERROR("Constant true must have type i1"); @@ -4944,7 +4948,7 @@ break; case 192: -#line 1942 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1946 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty) GEN_ERROR("Constant false must have type i1"); @@ -4955,7 +4959,7 @@ break; case 193: -#line 1949 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1953 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4975,7 +4979,7 @@ break; case 194: -#line 1967 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1971 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4991,7 +4995,7 @@ break; case 195: -#line 1979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -5016,7 +5020,7 @@ break; case 196: -#line 2000 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2004 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -5028,7 +5032,7 @@ break; case 197: -#line 2008 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2012 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -5038,7 +5042,7 @@ break; case 198: -#line 2014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2018 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -5053,7 +5057,7 @@ break; case 199: -#line 2025 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2029 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -5062,7 +5066,7 @@ break; case 200: -#line 2030 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2034 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -5071,7 +5075,7 @@ break; case 201: -#line 2035 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2039 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -5080,7 +5084,7 @@ break; case 202: -#line 2040 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2044 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -5089,7 +5093,7 @@ break; case 203: -#line 2045 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2049 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5099,7 +5103,7 @@ break; case 204: -#line 2051 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2055 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5109,7 +5113,7 @@ break; case 205: -#line 2057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2061 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5119,7 +5123,7 @@ break; case 206: -#line 2063 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5131,7 +5135,7 @@ break; case 207: -#line 2071 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2075 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5143,7 +5147,7 @@ break; case 208: -#line 2082 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5151,7 +5155,7 @@ break; case 209: -#line 2086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2090 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5160,27 +5164,27 @@ break; case 210: -#line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2098 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 211: -#line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2098 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 212: -#line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2101 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 213: -#line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2101 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 214: -#line 2100 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2104 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5196,7 +5200,7 @@ break; case 215: -#line 2112 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2116 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5212,7 +5216,7 @@ break; case 216: -#line 2133 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2137 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5221,7 +5225,7 @@ break; case 217: -#line 2138 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2142 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5230,12 +5234,12 @@ break; case 220: -#line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 221: -#line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5243,26 +5247,26 @@ break; case 222: -#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 223: -#line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 224: -#line 2158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 225: -#line 2161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5290,7 +5294,7 @@ break; case 226: -#line 2185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5305,7 +5309,7 @@ break; case 227: -#line 2197 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2201 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5317,14 +5321,14 @@ break; case 228: -#line 2204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 229: -#line 2208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5334,14 +5338,14 @@ break; case 230: -#line 2213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 231: -#line 2217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2221 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5352,7 +5356,7 @@ break; case 232: -#line 2223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5360,7 +5364,7 @@ break; case 233: -#line 2227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5404,21 +5408,21 @@ break; case 234: -#line 2267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 235: -#line 2270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2274 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 236: -#line 2276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2280 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5431,7 +5435,7 @@ break; case 237: -#line 2286 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2290 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5439,7 +5443,7 @@ break; case 238: -#line 2290 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2294 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5447,7 +5451,7 @@ break; case 240: -#line 2297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5456,7 +5460,7 @@ break; case 241: -#line 2302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5465,14 +5469,14 @@ break; case 242: -#line 2307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2311 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 243: -#line 2316 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2320 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5486,7 +5490,7 @@ break; case 244: -#line 2326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2330 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5500,7 +5504,7 @@ break; case 245: -#line 2337 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2341 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5508,7 +5512,7 @@ break; case 246: -#line 2341 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2345 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5521,7 +5525,7 @@ break; case 247: -#line 2350 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5534,7 +5538,7 @@ break; case 248: -#line 2359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2363 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5542,7 +5546,7 @@ break; case 249: -#line 2365 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2369 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(4) - (11)].StrVal)); delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory! @@ -5693,7 +5697,7 @@ break; case 252: -#line 2515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2519 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5705,7 +5709,7 @@ break; case 255: -#line 2526 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5713,7 +5717,7 @@ break; case 256: -#line 2531 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2535 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5724,7 +5728,7 @@ break; case 257: -#line 2543 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5732,7 +5736,7 @@ break; case 258: -#line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2551 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5740,7 +5744,7 @@ break; case 259: -#line 2552 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5748,7 +5752,7 @@ break; case 260: -#line 2556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2560 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5756,7 +5760,7 @@ break; case 261: -#line 2560 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5765,7 +5769,7 @@ break; case 262: -#line 2565 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2569 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5774,7 +5778,7 @@ break; case 263: -#line 2570 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2574 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5782,7 +5786,7 @@ break; case 264: -#line 2574 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5790,7 +5794,7 @@ break; case 265: -#line 2578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5798,7 +5802,7 @@ break; case 266: -#line 2582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2586 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5806,7 +5810,7 @@ break; case 267: -#line 2586 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5814,7 +5818,7 @@ break; case 268: -#line 2590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5822,7 +5826,7 @@ break; case 269: -#line 2594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2598 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5848,7 +5852,7 @@ break; case 270: -#line 2616 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2620 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5874,7 +5878,7 @@ break; case 271: -#line 2638 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2642 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5884,7 +5888,7 @@ break; case 272: -#line 2644 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2648 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5901,7 +5905,7 @@ break; case 273: -#line 2657 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2661 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5917,7 +5921,7 @@ break; case 274: -#line 2669 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2673 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5926,7 +5930,7 @@ break; case 275: -#line 2674 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2678 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5942,7 +5946,7 @@ break; case 276: -#line 2686 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2690 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5952,7 +5956,7 @@ break; case 277: -#line 2692 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2696 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5960,7 +5964,7 @@ break; case 278: -#line 2696 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2700 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5970,7 +5974,7 @@ break; case 279: -#line 2706 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2710 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5978,7 +5982,7 @@ break; case 280: -#line 2710 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5986,7 +5990,7 @@ break; case 281: -#line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2718 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5995,7 +5999,7 @@ break; case 282: -#line 2719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2723 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -6004,7 +6008,7 @@ break; case 285: -#line 2732 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2736 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -6015,7 +6019,7 @@ break; case 286: -#line 2741 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2745 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -6024,7 +6028,7 @@ break; case 287: -#line 2746 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2750 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -6032,7 +6036,7 @@ break; case 288: -#line 2751 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2755 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6040,7 +6044,7 @@ break; case 289: -#line 2755 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2759 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6048,7 +6052,7 @@ break; case 290: -#line 2764 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2768 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -6060,7 +6064,7 @@ break; case 291: -#line 2773 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2777 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -6075,7 +6079,7 @@ break; case 292: -#line 2786 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2790 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -6088,7 +6092,7 @@ break; case 293: -#line 2795 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -6096,7 +6100,7 @@ break; case 294: -#line 2799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2803 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -6106,7 +6110,7 @@ break; case 295: -#line 2807 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2811 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6130,7 +6134,7 @@ break; case 296: -#line 2827 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2831 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -6138,7 +6142,7 @@ break; case 297: -#line 2831 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2835 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6147,7 +6151,7 @@ break; case 298: -#line 2836 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2840 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6162,7 +6166,7 @@ break; case 299: -#line 2847 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2851 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6185,7 +6189,7 @@ break; case 300: -#line 2866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2870 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6198,7 +6202,7 @@ break; case 301: -#line 2876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2880 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6305,7 +6309,7 @@ break; case 302: -#line 2979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6313,7 +6317,7 @@ break; case 303: -#line 2983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2987 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6321,7 +6325,7 @@ break; case 304: -#line 2990 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2994 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6336,7 +6340,7 @@ break; case 305: -#line 3001 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3005 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6352,7 +6356,7 @@ break; case 306: -#line 3014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3018 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6364,7 +6368,7 @@ break; case 307: -#line 3023 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3027 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6379,7 +6383,7 @@ break; case 308: -#line 3036 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3040 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6394,7 +6398,7 @@ break; case 309: -#line 3047 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3051 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6406,7 +6410,7 @@ break; case 310: -#line 3057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3061 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6421,7 +6425,7 @@ break; case 311: -#line 3068 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3072 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6433,7 +6437,7 @@ break; case 312: -#line 3076 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3080 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mist