aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-05-20 10:37:50 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-05-20 10:37:50 +0000
commite697e20a892668e5a9189980193e23412a0cc221 (patch)
tree63b68f9258232c111fa185a58bb0c65f557a3d2a
parentf96b337ae42e599a58d93473061854c2fb34d749 (diff)
downloadgcc-e697e20a892668e5a9189980193e23412a0cc221.zip
gcc-e697e20a892668e5a9189980193e23412a0cc221.tar.gz
gcc-e697e20a892668e5a9189980193e23412a0cc221.tar.bz2
expr.h (lang_expand_constant): Declare.
* expr.h (lang_expand_constant): Declare. * toplev.c (lang_expand_constant): Define it. * varasm.c (output_constant): Use it. From-SVN: r27058
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.h6
-rw-r--r--gcc/toplev.c2
-rw-r--r--gcc/varasm.c7
4 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d934486..82c95ac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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):
diff --git a/gcc/expr.h b/gcc/expr.h
index 1a6008a..2164ccd 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -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));
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1945351..92617f7 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -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. */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index e4eef2d..4f92290 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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;