aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog12
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c7
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/name-lookup.c2
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/cp/rtti.c4
-rw-r--r--gcc/cp/semantics.c12
-rw-r--r--gcc/cp/typeck.c28
10 files changed, 60 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index dbbea2d..0d014f5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,17 @@
2009-04-20 Ian Lance Taylor <iant@google.com>
+ * typeck.c (build_function_call_vec): New function.
+ (cp_build_function_call): Only pass first parameter to
+ objc_rewrite_function_call.
+ (build_modify_expr): Add rhs_origtype parameter. Change all
+ callers.
+ * decl.c (finish_decl): Add origtype parameter. Change all
+ callers.
+ * semantics.c (finish_call_expr): Pass VEC to
+ resolve_overloaded_builtin.
+
+2009-04-20 Ian Lance Taylor <iant@google.com>
+
* cp-tree.h (base_access): Change typedef to int.
* parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
(cp_parser_omp_threadprivate): Likewise.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 76e6398..a20b8c4 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -774,7 +774,7 @@ get_vtable_decl (tree type, int complete)
if (complete)
{
DECL_EXTERNAL (decl) = 1;
- finish_decl (decl, NULL_TREE, NULL_TREE);
+ finish_decl (decl, NULL_TREE, NULL_TREE, NULL_TREE);
}
return decl;
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index c96e575..e3fed77 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4346,7 +4346,7 @@ extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int,
extern void start_decl_1 (tree, bool);
extern bool check_array_initializer (tree, tree, tree);
extern void cp_finish_decl (tree, tree, bool, tree, int);
-extern void finish_decl (tree, tree, tree);
+extern void finish_decl (tree, tree, tree, tree);
extern int cp_complete_array_type (tree *, tree, bool);
extern tree build_ptrmemfunc_type (tree);
extern tree build_ptrmem_type (tree, tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cd550f2..9aebe2a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5868,7 +5868,8 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
/* This is here for a midend callback from c-common.c. */
void
-finish_decl (tree decl, tree init, tree asmspec_tree)
+finish_decl (tree decl, tree init, tree origtype ATTRIBUTE_UNUSED,
+ tree asmspec_tree)
{
cp_finish_decl (decl, init, /*init_const_expr_p=*/false, asmspec_tree, 0);
}
@@ -5895,7 +5896,7 @@ declare_global_var (tree name, tree type)
library), then it is possible that our declaration will be merged
with theirs by pushdecl. */
decl = pushdecl (decl);
- finish_decl (decl, NULL_TREE, NULL_TREE);
+ finish_decl (decl, NULL_TREE, NULL_TREE, NULL_TREE);
pop_from_top_level ();
return decl;
@@ -12480,7 +12481,7 @@ start_method (cp_decl_specifier_seq *declspecs,
}
}
- finish_decl (fndecl, NULL_TREE, NULL_TREE);
+ finish_decl (fndecl, NULL_TREE, NULL_TREE, NULL_TREE);
/* Make a place for the parms. */
begin_scope (sk_function_parms, fndecl);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 91c707d..12876ad 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1001,7 +1001,7 @@ grokbitfield (const cp_declarator *declarator,
error ("static member %qD cannot be a bit-field", value);
return NULL_TREE;
}
- finish_decl (value, NULL_TREE, NULL_TREE);
+ finish_decl (value, NULL_TREE, NULL_TREE, NULL_TREE);
if (width != error_mark_node)
{
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index b47c0c5..d8b2e7c 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3556,7 +3556,7 @@ pushdecl_top_level_1 (tree x, tree *init, bool is_friend)
push_to_top_level ();
x = pushdecl_namespace_level (x, is_friend);
if (init)
- finish_decl (x, *init, NULL_TREE);
+ finish_decl (x, *init, NULL_TREE, NULL_TREE);
pop_from_top_level ();
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x);
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2ee3d18..b58b9f1 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10774,7 +10774,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
init = t;
}
- finish_decl (decl, init, NULL_TREE);
+ finish_decl (decl, init, NULL_TREE, NULL_TREE);
}
}
}
@@ -15577,7 +15577,7 @@ instantiate_decl (tree d, int defer_ok,
/* Enter the scope of D so that access-checking works correctly. */
push_nested_class (DECL_CONTEXT (d));
- finish_decl (d, init, NULL_TREE);
+ finish_decl (d, init, NULL_TREE, NULL_TREE);
pop_nested_class ();
}
else if (TREE_CODE (d) == FUNCTION_DECL)
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 1d5da67..68419fa 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1,6 +1,6 @@
/* RunTime Type Identification
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008
+ 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Mostly written by Jason Merrill (jason@cygnus.com).
@@ -1519,7 +1519,7 @@ emit_tinfo_decl (tree decl)
init = get_pseudo_ti_init (type, get_pseudo_ti_index (type));
DECL_INITIAL (decl) = init;
mark_used (decl);
- finish_decl (decl, init, NULL_TREE);
+ finish_decl (decl, init, NULL_TREE, NULL_TREE);
return true;
}
else
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 337b637..0183239 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1987,7 +1987,15 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p,
if (TREE_CODE (fn) == FUNCTION_DECL
&& (DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL
|| DECL_BUILT_IN_CLASS (fn) == BUILT_IN_MD))
- result = resolve_overloaded_builtin (fn, args);
+ {
+ VEC(tree,gc)* vec = VEC_alloc (tree, gc, list_length (args));
+ tree p;
+
+ for (p = args; p != NULL_TREE; p = TREE_CHAIN (p))
+ VEC_quick_push (tree, vec, TREE_VALUE (p));
+ result = resolve_overloaded_builtin (fn, vec);
+ VEC_free (tree, gc, vec);
+ }
if (!result)
/* A call to a namespace-scope function. */
@@ -4121,7 +4129,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
cond = cp_build_binary_op (elocus,
TREE_CODE (cond), decl, diff,
tf_warning_or_error);
- incr = build_modify_expr (elocus, decl, PLUS_EXPR, incr);
+ incr = build_modify_expr (elocus, decl, PLUS_EXPR, incr, NULL_TREE);
orig_body = *body;
*body = push_stmt_list ();
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index fe791f3..9084b5e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -2857,6 +2857,28 @@ build_function_call (tree function, tree params)
return cp_build_function_call (function, params, tf_warning_or_error);
}
+/* Used by the C-common bits. */
+tree
+build_function_call_vec (tree function, VEC(tree,gc) *params,
+ VEC(tree,gc) *origtypes ATTRIBUTE_UNUSED)
+{
+ tree p;
+ tree *pp;
+ unsigned int i;
+ tree t;
+
+ /* FIXME: Should just change cp_build_function_call to use a
+ VEC. */
+ p = NULL_TREE;
+ pp = &p;
+ for (i = 0; VEC_iterate (tree, params, i, t); ++i)
+ {
+ *pp = build_tree_list (NULL, t);
+ pp = &TREE_CHAIN (*pp);
+ }
+ return cp_build_function_call (function, p, tf_warning_or_error);
+}
+
tree
cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
{
@@ -2870,7 +2892,8 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
/* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF
expressions, like those used for ObjC messenger dispatches. */
- function = objc_rewrite_function_call (function, params);
+ if (params != NULL_TREE)
+ function = objc_rewrite_function_call (function, TREE_VALUE (params));
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */
@@ -5840,7 +5863,8 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
/* For use from the C common bits. */
tree
build_modify_expr (location_t location ATTRIBUTE_UNUSED,
- tree lhs, enum tree_code modifycode, tree rhs)
+ tree lhs, enum tree_code modifycode, tree rhs,
+ tree rhs_origtype ATTRIBUTE_UNUSED)
{
return cp_build_modify_expr (lhs, modifycode, rhs, tf_warning_or_error);
}