summaryrefslogtreecommitdiffstats
path: root/gcc/c-family
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-11 19:55:09 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-11 19:55:09 +0000
commitb9a1687032fc1afb5f4e9d8dfa775a134abe21ba (patch)
tree304b794b6f6f0af1f79b00f4166b897337141fac /gcc/c-family
parent74fcb726ed12f7bce6ef94080d91b4e3cac61824 (diff)
downloadppe42-gcc-b9a1687032fc1afb5f4e9d8dfa775a134abe21ba.tar.gz
ppe42-gcc-b9a1687032fc1afb5f4e9d8dfa775a134abe21ba.zip
Convert standard builtin functions from being arrays to using a functional interface
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179820 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog11
-rw-r--r--gcc/c-family/c-common.c11
-rw-r--r--gcc/c-family/c-omp.c8
3 files changed, 21 insertions, 9 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index e93b98dd451..3a26e170ecc 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,14 @@
+2011-10-11 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * c-common.c (def_builtin_1): Delete old interface with two
+ parallel arrays to hold standard builtin declarations, and replace
+ it with a function based interface that can support creating
+ builtins on the fly in the future. Change all uses, and poison
+ the old names. Make sure 0 is not a legitimate builtin index.
+ * c-omp.c (c_finish_omp_barrier): Ditto.
+ (c_finish_omp_taskwait): Ditto.
+ (c_finish_omp_flush): Ditto.
+
2011-10-11 Tristan Gingold <gingold@adacore.com>
* c.opt: (fallow-parameterless-variadic-functions): New.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 2c5a48916ff..0aa0fefbd7c 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5168,15 +5168,14 @@ def_builtin_1 (enum built_in_function fncode,
decl = add_builtin_function (name, fntype, fncode, fnclass,
(fallback_p ? libname : NULL),
fnattrs);
+
+ set_builtin_decl (fncode, decl, implicit_p);
+
if (both_p
&& !flag_no_builtin && !builtin_function_disabled_p (libname)
&& !(nonansi_p && flag_no_nonansi_builtin))
add_builtin_function (libname, libtype, fncode, fnclass,
NULL, fnattrs);
-
- built_in_decls[(int) fncode] = decl;
- if (implicit_p)
- implicit_built_in_decls[(int) fncode] = decl;
}
/* Nonzero if the type T promotes to int. This is (nearly) the
@@ -9144,11 +9143,13 @@ resolve_overloaded_builtin (location_t loc, tree function, VEC(tree,gc) *params)
{
int n = sync_resolve_size (function, params);
tree new_function, first_param, result;
+ enum built_in_function fncode;
if (n == 0)
return error_mark_node;
- new_function = built_in_decls[orig_code + exact_log2 (n) + 1];
+ fncode = (enum built_in_function)((int)orig_code + exact_log2 (n) + 1);
+ new_function = builtin_decl_explicit (fncode);
if (!sync_resolve_params (function, new_function, params))
return error_mark_node;
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 4a5b0ca928b..481211ed72d 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -77,7 +77,7 @@ c_finish_omp_barrier (location_t loc)
{
tree x;
- x = built_in_decls[BUILT_IN_GOMP_BARRIER];
+ x = builtin_decl_explicit (BUILT_IN_GOMP_BARRIER);
x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -91,7 +91,7 @@ c_finish_omp_taskwait (location_t loc)
{
tree x;
- x = built_in_decls[BUILT_IN_GOMP_TASKWAIT];
+ x = builtin_decl_explicit (BUILT_IN_GOMP_TASKWAIT);
x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -105,7 +105,7 @@ c_finish_omp_taskyield (location_t loc)
{
tree x;
- x = built_in_decls[BUILT_IN_GOMP_TASKYIELD];
+ x = builtin_decl_explicit (BUILT_IN_GOMP_TASKYIELD);
x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -260,7 +260,7 @@ c_finish_omp_flush (location_t loc)
{
tree x;
- x = built_in_decls[BUILT_IN_SYNC_SYNCHRONIZE];
+ x = builtin_decl_explicit (BUILT_IN_SYNC_SYNCHRONIZE);
x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
OpenPOWER on IntegriCloud