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);
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;
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;
}
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;
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);
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) \