OSDN Git Service

* Makefile.in: Remove pointless setting of CXXFLAGS for dejagnu
[pf3gnuchains/gcc-fork.git] / gcc / langhooks.c
index 79eb7f4..912d5db 100644 (file)
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "toplev.h"
 #include "tree.h"
 #include "c-tree.h"
@@ -175,6 +177,13 @@ lhd_set_decl_assembler_name (decl)
     abort ();
 }
 
+/* By default we always allow bit-field based optimizations.  */
+bool
+lhd_can_use_bit_fields_p ()
+{
+  return true;
+}
+
 /* Provide a default routine to clear the binding stack.  This is used
    by languages that don't need to do anything special.  */
 void
@@ -253,7 +262,7 @@ lhd_decl_printable_name (decl, verbosity)
    completely handled within this function, it should set *SUBTREES to
    0, so that generic handling isn't attempted.  For language-specific
    tree codes, generic handling would abort(), so make sure it is set
-   properly.  Both SUBTREES and *SUBTREES is guaranteed to be non-zero
+   properly.  Both SUBTREES and *SUBTREES is guaranteed to be nonzero
    when the function is called.  */
 
 tree
@@ -347,13 +356,17 @@ lhd_tree_inlining_auto_var_in_fn_p (var, fn)
 
 tree
 lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
-                                             dm, ndp, texps)
+                                             dm, ndp, return_slot_addr)
      tree res, fn, caller;
      void *dm ATTRIBUTE_UNUSED;
      int *ndp ATTRIBUTE_UNUSED;
-     void *texps ATTRIBUTE_UNUSED;
+     tree return_slot_addr ATTRIBUTE_UNUSED;
 {
-  return copy_decl_for_inlining (res, fn, caller);
+  if (return_slot_addr)
+    return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (return_slot_addr)),
+                  return_slot_addr);
+  else
+    return copy_decl_for_inlining (res, fn, caller);
 }
 
 /* lang_hooks.tree_inlining.anon_aggr_type_p determines whether T is a
@@ -369,7 +382,7 @@ lhd_tree_inlining_anon_aggr_type_p (t)
 
 /* lang_hooks.tree_inlining.start_inlining and end_inlining perform any
    language-specific bookkeeping necessary for processing
-   FN. start_inlining returns non-zero if inlining should proceed, zero if
+   FN. start_inlining returns nonzero if inlining should proceed, zero if
    not.
 
    For instance, the C++ version keeps track of template instantiations to
@@ -401,7 +414,7 @@ lhd_tree_inlining_convert_parm_for_inlining (parm, value, fndecl)
 }
 
 /* lang_hooks.tree_dump.dump_tree:  Dump language-specific parts of tree
-   nodes.  Returns non-zero if it does not want the usual dumping of the
+   nodes.  Returns nonzero if it does not want the usual dumping of the
    second argument.  */
 
 int
@@ -421,3 +434,17 @@ lhd_tree_dump_type_quals (t)
 {
   return TYPE_QUALS (t);
 }
+
+/* lang_hooks.expr_size: Determine the size of the value of an expression T
+   in a language-specific way.  Returns a tree for the size in bytes.  */
+
+tree
+lhd_expr_size (exp)
+     tree exp;
+{
+  if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
+      && DECL_SIZE_UNIT (exp) != 0)
+    return DECL_SIZE_UNIT (exp);
+  else
+    return size_in_bytes (TREE_TYPE (exp));
+}