rs6000-protos.h (altivec_resolve_overloaded_builtin): Change first argument type...
authorAldy Hernandez <aldyh@redhat.com>
Sat, 13 Jun 2009 21:27:56 +0000 (21:27 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Sat, 13 Jun 2009 21:27:56 +0000 (21:27 +0000)
        * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin):
        Change first argument type to location_t.
        * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Same.
        Do not set input_location.
        Use loc instead of input_location throughout.
objcp/
        * objcp-decl.h (start_struct): Add location argument.
        (finish_struct): Same.
        (finish_decl): New.

From-SVN: r148461

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000-protos.h
gcc/objcp/ChangeLog
gcc/objcp/objcp-decl.h

index cc32b118b5d9eb0ae52bf96217855b2c3169c481..0fe65b23ea38b50b126ea4a859df70dc3af729c1 100644 (file)
@@ -1,3 +1,11 @@
+2009-06-13  Aldy Hernandez  <aldyh@redhat.com>
+
+       * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin):
+       Change first argument type to location_t.
+       * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Same.
+       Do not set input_location.
+       Use loc instead of input_location throughout.
+
 2009-06-13  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/40389
index cd5c4708a3a3d1641f9eabdc45f42e4da78c3c60..8a39b9e9f8458a2355199d8801288a077bd063a9 100644 (file)
@@ -3001,10 +3001,9 @@ altivec_build_resolved_builtin (tree *args, int n,
    support Altivec's overloaded builtins.  */
 
 tree
-altivec_resolve_overloaded_builtin (unsigned int loc, tree fndecl,
+altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
                                    void *passed_arglist)
 {
-  location_t input_location = (location_t) loc;
   VEC(tree,gc) *arglist = (VEC(tree,gc) *) passed_arglist;
   unsigned int nargs = VEC_length (tree, arglist);
   unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
@@ -3115,11 +3114,11 @@ altivec_resolve_overloaded_builtin (unsigned int loc, tree fndecl,
        goto bad; 
       /* Build *(((arg1_inner_type*)&(vector type){arg1})+arg2). */
       arg1_inner_type = TREE_TYPE (arg1_type);
-      arg2 = build_binary_op (input_location, BIT_AND_EXPR, arg2,
+      arg2 = build_binary_op (loc, BIT_AND_EXPR, arg2,
                              build_int_cst (TREE_TYPE (arg2),
                                             TYPE_VECTOR_SUBPARTS (arg1_type)
                                             - 1), 0);
-      decl = build_decl (input_location, VAR_DECL, NULL_TREE, arg1_type);
+      decl = build_decl (loc, VAR_DECL, NULL_TREE, arg1_type);
       DECL_EXTERNAL (decl) = 0;
       TREE_PUBLIC (decl) = 0;
       DECL_CONTEXT (decl) = current_function_decl;
@@ -3129,15 +3128,15 @@ altivec_resolve_overloaded_builtin (unsigned int loc, tree fndecl,
       DECL_INITIAL (decl) = arg1;
       stmt = build1 (DECL_EXPR, arg1_type, decl);
       TREE_ADDRESSABLE (decl) = 1;
-      SET_EXPR_LOCATION (stmt, input_location);
+      SET_EXPR_LOCATION (stmt, loc);
       stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
 
       innerptrtype = build_pointer_type (arg1_inner_type);
 
-      stmt = build_unary_op (input_location, ADDR_EXPR, stmt, 0);
+      stmt = build_unary_op (loc, ADDR_EXPR, stmt, 0);
       stmt = convert (innerptrtype, stmt);
-      stmt = build_binary_op (input_location, PLUS_EXPR, stmt, arg2, 1);
-      stmt = build_indirect_ref (input_location, stmt, NULL);
+      stmt = build_binary_op (loc, PLUS_EXPR, stmt, arg2, 1);
+      stmt = build_indirect_ref (loc, stmt, NULL);
 
       return stmt;
     }
@@ -3171,11 +3170,11 @@ altivec_resolve_overloaded_builtin (unsigned int loc, tree fndecl,
        goto bad; 
       /* Build *(((arg1_inner_type*)&(vector type){arg1})+arg2) = arg0. */
       arg1_inner_type = TREE_TYPE (arg1_type);
-      arg2 = build_binary_op (input_location, BIT_AND_EXPR, arg2,
+      arg2 = build_binary_op (loc, BIT_AND_EXPR, arg2,
                              build_int_cst (TREE_TYPE (arg2),
                                             TYPE_VECTOR_SUBPARTS (arg1_type)
                                             - 1), 0);
-      decl = build_decl (input_location, VAR_DECL, NULL_TREE, arg1_type);
+      decl = build_decl (loc, VAR_DECL, NULL_TREE, arg1_type);
       DECL_EXTERNAL (decl) = 0;
       TREE_PUBLIC (decl) = 0;
       DECL_CONTEXT (decl) = current_function_decl;
@@ -3185,15 +3184,15 @@ altivec_resolve_overloaded_builtin (unsigned int loc, tree fndecl,
       DECL_INITIAL (decl) = arg1;
       stmt = build1 (DECL_EXPR, arg1_type, decl);
       TREE_ADDRESSABLE (decl) = 1;
-      SET_EXPR_LOCATION (stmt, input_location);
+      SET_EXPR_LOCATION (stmt, loc);
       stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
 
       innerptrtype = build_pointer_type (arg1_inner_type);
 
-      stmt = build_unary_op (input_location, ADDR_EXPR, stmt, 0);
+      stmt = build_unary_op (loc, ADDR_EXPR, stmt, 0);
       stmt = convert (innerptrtype, stmt);
-      stmt = build_binary_op (input_location, PLUS_EXPR, stmt, arg2, 1);
-      stmt = build_indirect_ref (input_location, stmt, NULL);
+      stmt = build_binary_op (loc, PLUS_EXPR, stmt, arg2, 1);
+      stmt = build_indirect_ref (loc, stmt, NULL);
       stmt = build2 (MODIFY_EXPR, TREE_TYPE (stmt), stmt,
                     convert (TREE_TYPE (stmt), arg0));
       stmt = build2 (COMPOUND_EXPR, arg1_type, stmt, decl);
index 0c5dad67339e69c2f868f9f019e3aa1d1b78fc62..1b68d440eb8ade399ea0a8db1a3525f9ca19f710 100644 (file)
@@ -132,7 +132,7 @@ extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                  tree, int, int);
 extern int function_arg_boundary (enum machine_mode, tree);
 extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
-extern tree altivec_resolve_overloaded_builtin (unsigned int, tree, void *);
+extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
 extern rtx rs6000_function_value (const_tree, const_tree);
 extern rtx rs6000_libcall_value (enum machine_mode);
 extern rtx rs6000_va_arg (tree, tree);
index fcb4a6419bec70236116476e6f39b1854da47c98..45985f8db0bb1658d6effe4fd15449d67cce4541 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-13  Aldy Hernandez  <aldyh@redhat.com>
+
+       * objcp-decl.h (start_struct): Add location argument.
+       (finish_struct): Same.
+       (finish_decl): New.
+
 2009-06-12  Aldy Hernandez  <aldyh@redhat.com>
 
        * objcp-decl.h (c_end_compound_stmt): New argument.
index e335149e0e596801182f1e069ef957ac397c3c35..07d39abaf8f5ea377a9dbaf67f096d08c2bac4f2 100644 (file)
@@ -37,12 +37,14 @@ extern tree objcp_end_compound_stmt (tree, int);
    invoke the original C++ functions if needed).  */
 #ifdef OBJCP_REMAP_FUNCTIONS
 
-#define start_struct(code, name, in_struct, struct_types, loc) \
-       objcp_start_struct (code, name)
-#define finish_struct(t, fieldlist, attributes, in_struct, struct_types) \
-       objcp_finish_struct (t, fieldlist, attributes)
+#define start_struct(loc, code, name, in_struct, struct_types) \
+       objcp_start_struct (loc, code, name)
+#define finish_struct(loc, t, fieldlist, attributes, in_struct, struct_types) \
+       objcp_finish_struct (loc, t, fieldlist, attributes)
 #define finish_function() \
        objcp_finish_function ()
+#define finish_decl(decl, loc, init, origtype, asmspec) \
+       cp_finish_decl (decl, init, false, asmspec, 0)
 #define xref_tag(code, name) \
        objcp_xref_tag (code, name)
 #define comptypes(type1, type2) \