Commit e697e20a by Mark Mitchell Committed by Mark Mitchell

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
parent f96b337a
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> Thu May 20 11:28:53 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* optabs.c (expand_cmplxdiv_straight, expand_cmplxdiv_wide): * optabs.c (expand_cmplxdiv_straight, expand_cmplxdiv_wide):
......
...@@ -1015,6 +1015,12 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx, ...@@ -1015,6 +1015,12 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx,
enum machine_mode, enum machine_mode,
enum expand_modifier modifier)); 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_all_optabs PROTO ((void));
extern void init_mov_optab PROTO ((void)); extern void init_mov_optab PROTO ((void));
extern void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx)); extern void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx));
......
...@@ -375,6 +375,8 @@ typedef rtx (*lang_expand_expr_t) ...@@ -375,6 +375,8 @@ typedef rtx (*lang_expand_expr_t)
lang_expand_expr_t lang_expand_expr = 0; 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 /* Pointer to function to finish handling an incomplete decl at the
end of compilation. */ end of compilation. */
......
...@@ -3897,6 +3897,13 @@ output_constant (exp, size) ...@@ -3897,6 +3897,13 @@ output_constant (exp, size)
{ {
register enum tree_code code = TREE_CODE (TREE_TYPE (exp)); 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) if (size == 0 || flag_syntax_only)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment