]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.h (lang_expand_constant): Declare.
authorMark Mitchell <mark@codesourcery.com>
Thu, 20 May 1999 10:37:50 +0000 (10:37 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 20 May 1999 10:37:50 +0000 (10:37 +0000)
* expr.h (lang_expand_constant): Declare.
* toplev.c (lang_expand_constant): Define it.
* varasm.c (output_constant): Use it.

From-SVN: r27058

gcc/ChangeLog
gcc/expr.h
gcc/toplev.c
gcc/varasm.c

index d93448684d25ac18606e08146a11dcf5965499d2..82c95ac1cae8235a401d4f2cb3625addffabe532 100644 (file)
@@ -1,3 +1,9 @@
+Thu May 20 10:38:43 1999  Mark Mitchell  <mark@codesourcery.com>
+
+       * expr.h (lang_expand_constant): Declare.
+       * toplev.c (lang_expand_constant): Define it.
+       * varasm.c (output_constant): Use it.
+
 Thu May 20 11:28:53 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * optabs.c (expand_cmplxdiv_straight, expand_cmplxdiv_wide):
index 1a6008a8f019067f4c3d2444e78dc6dc839e3f02..2164ccd9d06452f112b9d473029651427ab9436b 100644 (file)
@@ -1015,6 +1015,12 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx,
                                       enum machine_mode,
                                       enum expand_modifier modifier));
 
+/* Hook called by output_constant for language-specific tree codes.
+   It is up to the language front-end to install a hook if it has any
+   such codes that output_constant needs to know about.  Returns a
+   language-independent constant equivalent to its input.  */
+extern union tree_node * (*lang_expand_constant) PROTO((tree));
+
 extern void init_all_optabs                    PROTO ((void));
 extern void init_mov_optab                     PROTO ((void));
 extern void do_jump_by_parts_equality_rtx      PROTO((rtx, rtx, rtx));
index 194535116b3db8fce23f313cf80de1fb0ed8189a..92617f799dc007ff86fd66eff33f9de478c16037 100644 (file)
@@ -375,6 +375,8 @@ typedef rtx (*lang_expand_expr_t)
 
 lang_expand_expr_t lang_expand_expr = 0;
 
+tree (*lang_expand_constant) PROTO((tree)) = 0;
+
 /* Pointer to function to finish handling an incomplete decl at the
    end of compilation.  */
 
index e4eef2d9b4951d66efd50c65e179ba6a1fa4bf20..4f9229053256d91ae2cec6f81074c90e19313d9a 100644 (file)
@@ -3897,6 +3897,13 @@ output_constant (exp, size)
 {
   register enum tree_code code = TREE_CODE (TREE_TYPE (exp));
 
+  /* Some front-ends use constants other than the standard
+     language-indepdent varieties, but which may still be output
+     directly.  Give the front-end a chance to convert EXP to a
+     language-independent representation.  */
+  if (lang_expand_constant)
+    exp = (*lang_expand_constant) (exp);
+
   if (size == 0 || flag_syntax_only)
     return;