aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index c8b6ea6..a718bde 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2807,6 +2807,23 @@ build_decl_stat (enum tree_code code, tree name, tree type MEM_STAT_DECL)
return t;
}
+
+/* Builds and returns function declaration with NAME and TYPE. */
+
+tree
+build_fn_decl (const char *name, tree type)
+{
+ tree id = get_identifier (name);
+ tree decl = build_decl (FUNCTION_DECL, id, type);
+
+ DECL_EXTERNAL (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ TREE_NOTHROW (decl) = 1;
+
+ return decl;
+}
+
/* BLOCK nodes are used to represent the structure of binding contours
and declarations, once those contours have been exited and their contents