OSDN Git Service

* i386.c (legitimize_pic_address): Fix splitting of PLUS with
[pf3gnuchains/gcc-fork.git] / gcc / langhooks.c
index 8a28021..199c93e 100644 (file)
@@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA.  */
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "intl.h"
 #include "tm.h"
 #include "toplev.h"
 #include "tree.h"
@@ -60,7 +61,7 @@ lhd_do_nothing_i (int ARG_UNUSED (i))
 /* Do nothing (int, int, int).  Return NULL_TREE.  */
 
 tree
-lhd_do_nothing_iii_return_null_tree (int ARG_UNUSED (i), 
+lhd_do_nothing_iii_return_null_tree (int ARG_UNUSED (i),
                                     int ARG_UNUSED (j),
                                     int ARG_UNUSED (k))
 {
@@ -123,20 +124,12 @@ lhd_safe_from_p (rtx ARG_UNUSED (x), tree ARG_UNUSED (exp))
   return 1;
 }
 
-/* Called from unsafe_for_reeval.  */
-
-int
-lhd_unsafe_for_reeval (tree ARG_UNUSED (t))
-{
-  return -1;
-}
-
 /* Called from staticp.  */
 
-bool
+tree
 lhd_staticp (tree ARG_UNUSED (exp))
 {
-  return false;
+  return NULL;
 }
 
 /* Called from check_global_declarations.  */
@@ -175,7 +168,7 @@ lhd_set_decl_assembler_name (tree decl)
         same as that used in the source language.  (That's correct
         for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
         value as DECL_NAME in build_decl, so this choice provides
-        backwards compatibility with existing front-ends.  
+        backwards compatibility with existing front-ends.
 
          Can't use just the variable's own name for a variable whose
         scope is less than the whole compilation.  Concatenate a
@@ -214,7 +207,7 @@ lhd_type_promotes_to (tree ARG_UNUSED (type))
 
 /* Registration of machine- or os-specific builtin types.  */
 void
-lhd_register_builtin_type (tree ARG_UNUSED (type), 
+lhd_register_builtin_type (tree ARG_UNUSED (type),
                           const char * ARG_UNUSED (name))
 {
 }
@@ -275,6 +268,7 @@ lhd_expand_decl (tree ARG_UNUSED (t))
 const char *
 lhd_decl_printable_name (tree decl, int ARG_UNUSED (verbosity))
 {
+  gcc_assert (decl && DECL_NAME (decl));
   return IDENTIFIER_POINTER (DECL_NAME (decl));
 }
 
@@ -428,7 +422,7 @@ lhd_tree_dump_type_quals (tree t)
 tree
 lhd_expr_size (tree exp)
 {
-  if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
+  if (DECL_P (exp)
       && DECL_SIZE_UNIT (exp) != 0)
     return DECL_SIZE_UNIT (exp);
   else
@@ -445,8 +439,8 @@ lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED, tree *pre_p ATTRIBUTE_UNUSED,
 }
 
 /* lang_hooks.tree_size: Determine the size of a tree with code C,
-   which is a language-specific tree code in category 'x'.  The
-   default expects never to be called.  */
+   which is a language-specific tree code in category tcc_constant or
+   tcc_exceptional.  The default expects never to be called.  */
 size_t
 lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED)
 {
@@ -463,6 +457,14 @@ lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED)
   return true;
 }
 
+/* Return the COMDAT group into which DECL should be placed.  */
+
+const char *
+lhd_comdat_group (tree decl)
+{
+  return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+}
+
 /* lang_hooks.decls.final_write_globals: perform final processing on
    global variables.  */
 void
@@ -511,16 +513,16 @@ lhd_print_error_function (diagnostic_context *context, const char *file)
       pp_set_prefix (context->printer, new_prefix);
 
       if (current_function_decl == NULL)
-       pp_printf (context->printer, "At top level:");
+       pp_printf (context->printer, _("At top level:"));
       else
        {
          if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
            pp_printf
-             (context->printer, "In member function `%s':",
+             (context->printer, _("In member function %qs:"),
               lang_hooks.decl_printable_name (current_function_decl, 2));
          else
            pp_printf
-             (context->printer, "In function `%s':",
+             (context->printer, _("In function %qs:"),
               lang_hooks.decl_printable_name (current_function_decl, 2));
        }