+tree
+lhd_make_node (enum tree_code code)
+{
+ return make_node (code);
+}
+
+HOST_WIDE_INT
+lhd_to_target_charset (HOST_WIDE_INT c)
+{
+ return c;
+}
+
+tree
+lhd_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED, bool *se ATTRIBUTE_UNUSED)
+{
+ return expr;
+}
+
+/* Return sharing kind if OpenMP sharing attribute of DECL is
+ predetermined, OMP_CLAUSE_DEFAULT_UNSPECIFIED otherwise. */
+
+enum omp_clause_default_kind
+lhd_omp_predetermined_sharing (tree decl ATTRIBUTE_UNUSED)
+{
+ if (DECL_ARTIFICIAL (decl))
+ return OMP_CLAUSE_DEFAULT_SHARED;
+ return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
+}
+
+/* Generate code to copy SRC to DST. */
+
+tree
+lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src)
+{
+ return build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
+}
+
+/* Register language specific type size variables as potentially OpenMP
+ firstprivate variables. */
+
+void
+lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED,
+ tree t ATTRIBUTE_UNUSED)
+{
+}
+
+/* Common function for add_builtin_function and
+ add_builtin_function_ext_scope. */
+static tree
+add_builtin_function_common (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs,
+ tree (*hook) (tree))
+{
+ tree id = get_identifier (name);
+ tree decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, id, type);
+
+ TREE_PUBLIC (decl) = 1;
+ DECL_EXTERNAL (decl) = 1;
+ DECL_BUILT_IN_CLASS (decl) = cl;
+
+ DECL_FUNCTION_CODE (decl) = (enum built_in_function) function_code;
+
+ /* DECL_FUNCTION_CODE is a bitfield; verify that the value fits. */
+ gcc_assert (DECL_FUNCTION_CODE (decl) == function_code);
+
+ if (library_name)
+ {
+ tree libname = get_identifier (library_name);
+ SET_DECL_ASSEMBLER_NAME (decl, libname);
+ }
+
+ /* Possibly apply some default attributes to this built-in function. */
+ if (attrs)
+ decl_attributes (&decl, attrs, ATTR_FLAG_BUILT_IN);
+ else
+ decl_attributes (&decl, NULL_TREE, 0);
+
+ return hook (decl);
+
+}
+
+/* Create a builtin function. */
+
+tree
+add_builtin_function (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs)
+{
+ return add_builtin_function_common (name, type, function_code, cl,
+ library_name, attrs,
+ lang_hooks.builtin_function);
+}
+
+/* Like add_builtin_function, but make sure the scope is the external scope.
+ This is used to delay putting in back end builtin functions until the ISA
+ that defines the builtin is declared via function specific target options,
+ which can save memory for machines like the x86_64 that have multiple ISAs.
+ If this points to the same function as builtin_function, the backend must
+ add all of the builtins at program initialization time. */
+
+tree
+add_builtin_function_ext_scope (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs)
+{
+ return add_builtin_function_common (name, type, function_code, cl,
+ library_name, attrs,
+ lang_hooks.builtin_function_ext_scope);
+}
+
+tree
+lhd_builtin_function (tree decl)
+{
+ lang_hooks.decls.pushdecl (decl);
+ return decl;
+}
+
+/* LTO hooks. */
+
+/* Used to save and restore any previously active section. */
+static section *saved_section;
+
+
+/* Begin a new LTO output section named NAME. This default implementation
+ saves the old section and emits assembly code to switch to the new
+ section. */
+
+void
+lhd_begin_section (const char *name)
+{
+ section *section;
+
+ /* Save the old section so we can restore it in lto_end_asm_section. */
+ gcc_assert (!saved_section);
+ saved_section = in_section;
+ if (!saved_section)
+ saved_section = text_section;
+
+ /* Create a new section and switch to it. */
+ section = get_section (name, SECTION_DEBUG, NULL);
+ switch_to_section (section);
+}
+
+
+/* Write DATA of length LEN to the current LTO output section. This default
+ implementation just calls assemble_string and frees BLOCK. */
+
+void
+lhd_append_data (const void *data, size_t len, void *block)
+{
+ if (data)
+ assemble_string ((const char *)data, len);
+ free (block);
+}
+
+
+/* Finish the current LTO output section. This default implementation emits
+ assembly code to switch to any section previously saved by
+ lhd_begin_section. */
+
+void
+lhd_end_section (void)
+{
+ if (saved_section)
+ {
+ switch_to_section (saved_section);
+ saved_section = NULL;
+ }
+}