+/* extern void __mf_init (); */
+static GTY (()) tree mf_init_fndecl;
+
+/* extern int __mf_set_options (const char*); */
+static GTY (()) tree mf_set_options_fndecl;
+
+
+/* Helper for mudflap_init: construct a decl with the given category,
+ name, and type, mark it an external reference, and pushdecl it. */
+static inline tree
+mf_make_builtin (enum tree_code category, const char *name, tree type)
+{
+ tree decl = mf_mark (build_decl (category, get_identifier (name), type));
+ TREE_PUBLIC (decl) = 1;
+ DECL_EXTERNAL (decl) = 1;
+ lang_hooks.decls.pushdecl (decl);
+ return decl;
+}
+
+/* Helper for mudflap_init: construct a tree corresponding to the type
+ struct __mf_cache { uintptr_t low; uintptr_t high; };
+ where uintptr_t is the FIELD_TYPE argument. */
+static inline tree
+mf_make_mf_cache_struct_type (tree field_type)
+{
+ /* There is, abominably, no language-independent way to construct a
+ RECORD_TYPE. So we have to call the basic type construction
+ primitives by hand. */
+ tree fieldlo = build_decl (FIELD_DECL, get_identifier ("low"), field_type);
+ tree fieldhi = build_decl (FIELD_DECL, get_identifier ("high"), field_type);
+
+ tree struct_type = make_node (RECORD_TYPE);
+ DECL_CONTEXT (fieldlo) = struct_type;
+ DECL_CONTEXT (fieldhi) = struct_type;
+ TREE_CHAIN (fieldlo) = fieldhi;
+ TYPE_FIELDS (struct_type) = fieldlo;
+ TYPE_NAME (struct_type) = get_identifier ("__mf_cache");
+ layout_type (struct_type);
+
+ return struct_type;
+}
+
+#define build_function_type_0(rtype) \
+ build_function_type (rtype, void_list_node)
+#define build_function_type_1(rtype, arg1) \
+ build_function_type (rtype, tree_cons (0, arg1, void_list_node))
+#define build_function_type_3(rtype, arg1, arg2, arg3) \
+ build_function_type (rtype, tree_cons (0, arg1, tree_cons (0, arg2, \
+ tree_cons (0, arg3, void_list_node))))
+#define build_function_type_4(rtype, arg1, arg2, arg3, arg4) \
+ build_function_type (rtype, tree_cons (0, arg1, tree_cons (0, arg2, \
+ tree_cons (0, arg3, tree_cons (0, arg4, \
+ void_list_node)))))