aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredbrain <redbrain@gcc.gnu.org>2012-04-16 05:48:04 +0100
committerredbrain <redbrain@gcc.gnu.org>2012-04-16 05:48:04 +0100
commite78cbc9792166a08c076c86338b65aa33d116a0b (patch)
tree72f3684f5321735752adf276bc15b94050cbebda
parentbb3284e4c8685078609812eef30c911f35b42cf1 (diff)
need to autogen
-rw-r--r--gcc/python/py-dot-pass-genericify.c7
-rw-r--r--gcc/python/py-runtime.def23
-rw-r--r--gcc/python/py-runtime.tpl1
3 files changed, 19 insertions, 12 deletions
diff --git a/gcc/python/py-dot-pass-genericify.c b/gcc/python/py-dot-pass-genericify.c
index 2ae1329c64c..fd16c973432 100644
--- a/gcc/python/py-dot-pass-genericify.c
+++ b/gcc/python/py-dot-pass-genericify.c
@@ -1055,6 +1055,13 @@ VEC(tree,gc) * gpy_dot_pass_genericify_TU (gpy_hash_tab_t * modules,
VEC_safe_push (tree, gc, lowered_decls, t);
/* assign the function to the decl */
+ const char * funcid = DOT_IDENTIFIER_POINTER (DOT_FIELD (idtx));
+ tree funcdecl = gpy_dot_pass_decl_lookup (context, funcid);
+ append_to_statement_list (build2 (MODIFY_EXPR, gpy_object_type_ptr,
+ funcdecl,
+ GPY_RR_fold_func_decl (gpy_dot_type_const_string_tree (funcid),
+ t)),
+ &stmts);
}
break;
diff --git a/gcc/python/py-runtime.def b/gcc/python/py-runtime.def
index 0a6020edcc5..4994162a119 100644
--- a/gcc/python/py-runtime.def
+++ b/gcc/python/py-runtime.def
@@ -66,6 +66,18 @@ py-runtime = { code = GPY_RR_fold_class_decl;
build_call = build_call_expr;
build_call_args = "fndecl, 3, attrib_list, size, identifier";
};
+py-runtime = { code = GPY_RR_fold_func_decl;
+ arguments = "tree identifier, tree func";
+ proto = "tree, tree";
+ comment = "/* Fold func into decl <identifier><fndcel> */";
+ function_identifier = "gpy_rr_fold_class_decl";
+ fntype = "gpy_object_type_ptr
+ gpy_const_char_ptr,
+ ptr_type_node,
+ NULL_TREE";
+ build_call = build_call_expr;
+ build_call_args = "fndecl, 2, identifier, build_fold_addr_expr (func)";
+ };
py-runtime = { code = GPY_RR_fold_integer;
arguments = "tree integer";
proto = "tree";
@@ -77,17 +89,6 @@ py-runtime = { code = GPY_RR_fold_integer;
build_call = build_call_expr;
build_call_args = "fndecl, 1, integer";
};
-py-runtime = { code = GPY_RR_get_object_state;
- arguments = "tree obj";
- proto = "tree";
- comment = "/* get the current object state */";
- function_identifier = "gpy_rr_get_object_state";
- fntype = "ptr_type_node,
- gpy_object_type_ptr,
- NULL_TREE";
- build_call = build_call_expr;
- build_call_args = "fndecl, 1, obj";
- };
py-runtime = { code = GPY_RR_incr_ref_count;
arguments = "tree obj";
proto = "tree";
diff --git a/gcc/python/py-runtime.tpl b/gcc/python/py-runtime.tpl
index 970609bf44e..2f46578020d 100644
--- a/gcc/python/py-runtime.tpl
+++ b/gcc/python/py-runtime.tpl
@@ -38,7 +38,6 @@ along with GCC; see the file COPYING3. If not see
/* return a const string tree */
extern tree gpy_dot_type_const_string_tree (const char *);
-
[+ FOR py-runtime +]
[+ (get "comment") +]
extern tree [+ (get "code") +] ([+ (get "proto") +]);