gcc-8.3/gcc/rtx_writer/print_rtx()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#y7e1dadd]
#backlinks
*説明 [#k919c621]
-パス: [[gcc-8.3/gcc/print-rtl.c]]
-FIXME: これは何?
--説明
**引数 [#e6a1cc8f]
-const_rtx in_rtx
--
--[[gcc-8.3/gcc/const_rtx]]
**返り値 [#le747610]
-なし
**参考 [#mf7f1a4d]
*実装 [#r81bd2b6]
/* Print IN_RTX onto m_outfile. This is the recursive p...
void
rtx_writer::print_rtx (const_rtx in_rtx)
{
int idx = 0;
if (m_sawclose)
{
if (m_simple)
fputc (' ', m_outfile);
else
fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent...
m_sawclose = 0;
}
if (in_rtx == 0)
{
fputs ("(nil)", m_outfile);
m_sawclose = 1;
return;
}
else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
{
fprintf (m_outfile, "(??? bad code %d\n%s%*s)", G...
print_rtx_head, m_indent * 2, "");
m_sawclose = 1;
return;
}
-
--[[gcc-8.3/gcc/GET_CODE()]]
fputc ('(', m_outfile);
/* Print name of expression code. */
/* Handle reuse. */
#ifndef GENERATOR_FILE
if (m_rtx_reuse_manager)
{
-
--[[gcc-8.3/gcc/m_rtx_reuse_manager(global)]]
int reuse_id;
if (m_rtx_reuse_manager->has_reuse_id (in_rtx, &re...
{
/* Have we already seen the defn of this rtx? */
if (m_rtx_reuse_manager->seen_def_p (reuse_id))
{
fprintf (m_outfile, "reuse_rtx %i)", reuse_id);
m_sawclose = 1;
return;
}
else
{
/* First time we've seen this reused-rtx. */
fprintf (m_outfile, "%i|", reuse_id);
m_rtx_reuse_manager->set_seen_def (reuse_id);
}
}
}
#endif /* #ifndef GENERATOR_FILE */
/* In compact mode, prefix the code of insns with "c",
giving "cinsn", "cnote" etc. */
if (m_compact && is_a <const rtx_insn *, const struct ...
{
/* "ccode_label" is slightly awkward, so special-c...
just "clabel". */
rtx_code code = GET_CODE (in_rtx);
if (code == CODE_LABEL)
fprintf (m_outfile, "clabel");
else
fprintf (m_outfile, "c%s", GET_RTX_NAME (code));
-
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/GET_RTX_NAME()]]
}
else if (m_simple && CONST_INT_P (in_rtx))
; /* no code. */
-
--[[gcc-8.3/gcc/CONST_INT_P()]]
else
fprintf (m_outfile, "%s", GET_RTX_NAME (GET_CODE (in...
if (! m_simple)
{
if (RTX_FLAG (in_rtx, in_struct))
fputs ("/s", m_outfile);
if (RTX_FLAG (in_rtx, volatil))
fputs ("/v", m_outfile);
if (RTX_FLAG (in_rtx, unchanging))
fputs ("/u", m_outfile);
if (RTX_FLAG (in_rtx, frame_related))
fputs ("/f", m_outfile);
if (RTX_FLAG (in_rtx, jump))
fputs ("/j", m_outfile);
if (RTX_FLAG (in_rtx, call))
fputs ("/c", m_outfile);
if (RTX_FLAG (in_rtx, return_val))
fputs ("/i", m_outfile);
-
--[[gcc-8.3/gcc/RTX_FLAG()]]
/* Print REG_NOTE names for EXPR_LIST and INSN_LIS...
if ((GET_CODE (in_rtx) == EXPR_LIST
|| GET_CODE (in_rtx) == INSN_LIST
|| GET_CODE (in_rtx) == INT_LIST)
&& (int)GET_MODE (in_rtx) < REG_NOTE_MAX
&& !m_in_call_function_usage)
fprintf (m_outfile, ":%s",
GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
-
--[[gcc-8.3/gcc/EXPR_LIST]]
--[[gcc-8.3/gcc/INSN_LIST]]
--[[gcc-8.3/gcc/INT_LIST]]
--[[gcc-8.3/gcc/REG_NOTE_MAX]]
--[[gcc-8.3/gcc/GET_MODE()]]
--[[gcc-8.3/gcc/GET_REG_NOTE_NAME()]]
/* For other rtl, print the mode if it's not VOID....
else if (GET_MODE (in_rtx) != VOIDmode)
fprintf (m_outfile, ":%s", GET_MODE_NAME (GET_MODE (in_...
#ifndef GENERATOR_FILE
if (GET_CODE (in_rtx) == VAR_LOCATION)
{
if (TREE_CODE (PAT_VAR_LOCATION_DECL (in_rtx)) == STR...
fputs (" <debug string placeholder>", m_outfile);
else
print_mem_expr (m_outfile, PAT_VAR_LOCATION_DECL (i...
fputc (' ', m_outfile);
print_rtx (PAT_VAR_LOCATION_LOC (in_rtx));
if (PAT_VAR_LOCATION_STATUS (in_rtx)
== VAR_INIT_STATUS_UNINITIALIZED)
fprintf (m_outfile, " [uninit]");
m_sawclose = 1;
idx = GET_RTX_LENGTH (VAR_LOCATION);
}
#endif
}
-
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_DECL()]]
--[[gcc-8.3/gcc/STRING_CST]]
--[[gcc-8.3/gcc/print_mem_expr()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_DECL()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_LOC()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_STATUS()]]
--[[gcc-8.3/gcc/VAR_INIT_STATUS_UNINITIALIZED]]
--[[gcc-8.3/gcc/GET_RTX_LENGTH()]]
#ifndef GENERATOR_FILE
if (CONST_DOUBLE_AS_FLOAT_P (in_rtx))
idx = 5;
#endif
-
--[[gcc-8.3/gcc/CONST_DOUBLE_AS_FLOAT_P()]]
/* For insns, print the INSN_UID. */
if (INSN_CHAIN_CODE_P (GET_CODE (in_rtx)))
{
if (flag_dump_unnumbered)
fprintf (m_outfile, " #");
else
fprintf (m_outfile, " %d", INSN_UID (in_rtx));
}
-
--[[gcc-8.3/gcc/INSN_CHAIN_CODE_P()]]
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/INSN_UID()]]
/* Determine which is the final operand to print.
In compact mode, skip trailing operands that have t...
e.g. trailing "(nil)" values. */
int limit = GET_RTX_LENGTH (GET_CODE (in_rtx));
if (m_compact)
while (limit > idx && operand_has_default_value_p (i...
limit--;
-
--[[gcc-8.3/gcc/GET_RTX_LENGTH()]]
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/operand_has_default_value_p()]]
/* Get the format string and skip the first elements i...
them already. */
for (; idx < limit; idx++)
print_rtx_operand (in_rtx, idx);
-
--[[gcc-8.3/gcc/rtx_writer/print_rtx_operand()]]
switch (GET_CODE (in_rtx))
{
#ifndef GENERATOR_FILE
case MEM:
if (__builtin_expect (final_insns_dump_p, false))
fprintf (m_outfile, " [");
else
fprintf (m_outfile, " [" HOST_WIDE_INT_PRINT_DEC,
(HOST_WIDE_INT) MEM_ALIAS_SET (in_rtx));
if (MEM_EXPR (in_rtx))
print_mem_expr (m_outfile, MEM_EXPR (in_rtx));
else
fputc (' ', m_outfile);
-
--[[gcc-8.3/gcc/HOST_WIDE_INT_PRINT_DEC]]
--[[gcc-8.3/gcc/HOST_WIDE_INT]]
--[[gcc-8.3/gcc/MEM_ALIAS_SET()]]
--[[gcc-8.3/gcc/MEM_EXPR()]]
--[[gcc-8.3/gcc/print_mem_expr()]]
if (MEM_OFFSET_KNOWN_P (in_rtx))
{
fprintf (m_outfile, "+");
print_poly_int (m_outfile, MEM_OFFSET (in_rtx));
}
if (MEM_SIZE_KNOWN_P (in_rtx))
{
fprintf (m_outfile, " S");
print_poly_int (m_outfile, MEM_SIZE (in_rtx));
}
-
--[[gcc-8.3/gcc/MEM_OFFSET_KNOWN_P()]]
--[[gcc-8.3/gcc/MEM_SIZE_KNWON_P()]]
--[[gcc-8.3/gcc/print_poly_int()]]
if (MEM_ALIGN (in_rtx) != 1)
fprintf (m_outfile, " A%u", MEM_ALIGN (in_rtx));
if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (in_rtx)))
fprintf (m_outfile, " AS%u", MEM_ADDR_SPACE (in_rtx));
-
--[[gcc-8.3/gcc/MEM_ALIGN()]]
--[[gcc-8.3/gcc/ADDR_SPACE_GENERIC_P()]]
--[[gcc-8.3/gcc/MEM_ADDR_SPACE()]]
fputc (']', m_outfile);
break;
case CONST_DOUBLE:
if (FLOAT_MODE_P (GET_MODE (in_rtx)))
{
char s[60];
real_to_decimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
sizeof (s), 0, 1);
fprintf (m_outfile, " %s", s);
real_to_hexadecimal (s, CONST_DOUBLE_REAL_VALUE (in_r...
sizeof (s), 0, 1);
fprintf (m_outfile, " [%s]", s);
}
break;
-
--[[gcc-8.3/gcc/FLOAT_MODE_P()]]
--[[gcc-8.3/gcc/GET_MODE()]]
--[[gcc-8.3/gcc/real_to_decimal()]]
--[[gcc-8.3/gcc/CONST_DOUBLE_REAL_VALUE()]]
--[[gcc-8.3/gcc/real_to_hexadecimal()]]
case CONST_WIDE_INT:
fprintf (m_outfile, " ");
cwi_output_hex (m_outfile, in_rtx);
break;
-
--[[gcc-8.3/gcc/cwi_output_hex()]]
case CONST_POLY_INT:
fprintf (m_outfile, " [");
print_dec (CONST_POLY_INT_COEFFS (in_rtx)[0], m_ou...
for (unsigned int i = 1; i < NUM_POLY_INT_COEFFS; ...
{
fprintf (m_outfile, ", ");
print_dec (CONST_POLY_INT_COEFFS (in_rtx)[i], m_outfi...
}
fprintf (m_outfile, "]");
break;
#endif
-
--[[gcc-8.3/gcc/print_dec()]]
--[[gcc-8.3/gcc/CONST_POLY_INT_COEFFS()]]
--[[gcc-8.3/gcc/NUM_POLY_INT_COEFFS]]
case CODE_LABEL:
if (!m_compact)
fprintf (m_outfile, " [%d uses]", LABEL_NUSES (in_rtx));
switch (LABEL_KIND (in_rtx))
{
case LABEL_NORMAL: break;
case LABEL_STATIC_ENTRY: fputs (" [entry]", m_outfile...
case LABEL_GLOBAL_ENTRY: fputs (" [global entry]", m_...
case LABEL_WEAK_ENTRY: fputs (" [weak entry]", m_outf...
default: gcc_unreachable ();
}
break;
-
--[[gcc-8.3/gcc/LABEL_KIND()]]
default:
break;
}
fputc (')', m_outfile);
m_sawclose = 1;
}
*コメント [#e9733ba0]
終了行:
*参照元 [#y7e1dadd]
#backlinks
*説明 [#k919c621]
-パス: [[gcc-8.3/gcc/print-rtl.c]]
-FIXME: これは何?
--説明
**引数 [#e6a1cc8f]
-const_rtx in_rtx
--
--[[gcc-8.3/gcc/const_rtx]]
**返り値 [#le747610]
-なし
**参考 [#mf7f1a4d]
*実装 [#r81bd2b6]
/* Print IN_RTX onto m_outfile. This is the recursive p...
void
rtx_writer::print_rtx (const_rtx in_rtx)
{
int idx = 0;
if (m_sawclose)
{
if (m_simple)
fputc (' ', m_outfile);
else
fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent...
m_sawclose = 0;
}
if (in_rtx == 0)
{
fputs ("(nil)", m_outfile);
m_sawclose = 1;
return;
}
else if (GET_CODE (in_rtx) > NUM_RTX_CODE)
{
fprintf (m_outfile, "(??? bad code %d\n%s%*s)", G...
print_rtx_head, m_indent * 2, "");
m_sawclose = 1;
return;
}
-
--[[gcc-8.3/gcc/GET_CODE()]]
fputc ('(', m_outfile);
/* Print name of expression code. */
/* Handle reuse. */
#ifndef GENERATOR_FILE
if (m_rtx_reuse_manager)
{
-
--[[gcc-8.3/gcc/m_rtx_reuse_manager(global)]]
int reuse_id;
if (m_rtx_reuse_manager->has_reuse_id (in_rtx, &re...
{
/* Have we already seen the defn of this rtx? */
if (m_rtx_reuse_manager->seen_def_p (reuse_id))
{
fprintf (m_outfile, "reuse_rtx %i)", reuse_id);
m_sawclose = 1;
return;
}
else
{
/* First time we've seen this reused-rtx. */
fprintf (m_outfile, "%i|", reuse_id);
m_rtx_reuse_manager->set_seen_def (reuse_id);
}
}
}
#endif /* #ifndef GENERATOR_FILE */
/* In compact mode, prefix the code of insns with "c",
giving "cinsn", "cnote" etc. */
if (m_compact && is_a <const rtx_insn *, const struct ...
{
/* "ccode_label" is slightly awkward, so special-c...
just "clabel". */
rtx_code code = GET_CODE (in_rtx);
if (code == CODE_LABEL)
fprintf (m_outfile, "clabel");
else
fprintf (m_outfile, "c%s", GET_RTX_NAME (code));
-
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/GET_RTX_NAME()]]
}
else if (m_simple && CONST_INT_P (in_rtx))
; /* no code. */
-
--[[gcc-8.3/gcc/CONST_INT_P()]]
else
fprintf (m_outfile, "%s", GET_RTX_NAME (GET_CODE (in...
if (! m_simple)
{
if (RTX_FLAG (in_rtx, in_struct))
fputs ("/s", m_outfile);
if (RTX_FLAG (in_rtx, volatil))
fputs ("/v", m_outfile);
if (RTX_FLAG (in_rtx, unchanging))
fputs ("/u", m_outfile);
if (RTX_FLAG (in_rtx, frame_related))
fputs ("/f", m_outfile);
if (RTX_FLAG (in_rtx, jump))
fputs ("/j", m_outfile);
if (RTX_FLAG (in_rtx, call))
fputs ("/c", m_outfile);
if (RTX_FLAG (in_rtx, return_val))
fputs ("/i", m_outfile);
-
--[[gcc-8.3/gcc/RTX_FLAG()]]
/* Print REG_NOTE names for EXPR_LIST and INSN_LIS...
if ((GET_CODE (in_rtx) == EXPR_LIST
|| GET_CODE (in_rtx) == INSN_LIST
|| GET_CODE (in_rtx) == INT_LIST)
&& (int)GET_MODE (in_rtx) < REG_NOTE_MAX
&& !m_in_call_function_usage)
fprintf (m_outfile, ":%s",
GET_REG_NOTE_NAME (GET_MODE (in_rtx)));
-
--[[gcc-8.3/gcc/EXPR_LIST]]
--[[gcc-8.3/gcc/INSN_LIST]]
--[[gcc-8.3/gcc/INT_LIST]]
--[[gcc-8.3/gcc/REG_NOTE_MAX]]
--[[gcc-8.3/gcc/GET_MODE()]]
--[[gcc-8.3/gcc/GET_REG_NOTE_NAME()]]
/* For other rtl, print the mode if it's not VOID....
else if (GET_MODE (in_rtx) != VOIDmode)
fprintf (m_outfile, ":%s", GET_MODE_NAME (GET_MODE (in_...
#ifndef GENERATOR_FILE
if (GET_CODE (in_rtx) == VAR_LOCATION)
{
if (TREE_CODE (PAT_VAR_LOCATION_DECL (in_rtx)) == STR...
fputs (" <debug string placeholder>", m_outfile);
else
print_mem_expr (m_outfile, PAT_VAR_LOCATION_DECL (i...
fputc (' ', m_outfile);
print_rtx (PAT_VAR_LOCATION_LOC (in_rtx));
if (PAT_VAR_LOCATION_STATUS (in_rtx)
== VAR_INIT_STATUS_UNINITIALIZED)
fprintf (m_outfile, " [uninit]");
m_sawclose = 1;
idx = GET_RTX_LENGTH (VAR_LOCATION);
}
#endif
}
-
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/TREE_CODE()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_DECL()]]
--[[gcc-8.3/gcc/STRING_CST]]
--[[gcc-8.3/gcc/print_mem_expr()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_DECL()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_LOC()]]
--[[gcc-8.3/gcc/PAT_VAR_LOCATION_STATUS()]]
--[[gcc-8.3/gcc/VAR_INIT_STATUS_UNINITIALIZED]]
--[[gcc-8.3/gcc/GET_RTX_LENGTH()]]
#ifndef GENERATOR_FILE
if (CONST_DOUBLE_AS_FLOAT_P (in_rtx))
idx = 5;
#endif
-
--[[gcc-8.3/gcc/CONST_DOUBLE_AS_FLOAT_P()]]
/* For insns, print the INSN_UID. */
if (INSN_CHAIN_CODE_P (GET_CODE (in_rtx)))
{
if (flag_dump_unnumbered)
fprintf (m_outfile, " #");
else
fprintf (m_outfile, " %d", INSN_UID (in_rtx));
}
-
--[[gcc-8.3/gcc/INSN_CHAIN_CODE_P()]]
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/INSN_UID()]]
/* Determine which is the final operand to print.
In compact mode, skip trailing operands that have t...
e.g. trailing "(nil)" values. */
int limit = GET_RTX_LENGTH (GET_CODE (in_rtx));
if (m_compact)
while (limit > idx && operand_has_default_value_p (i...
limit--;
-
--[[gcc-8.3/gcc/GET_RTX_LENGTH()]]
--[[gcc-8.3/gcc/GET_CODE()]]
--[[gcc-8.3/gcc/operand_has_default_value_p()]]
/* Get the format string and skip the first elements i...
them already. */
for (; idx < limit; idx++)
print_rtx_operand (in_rtx, idx);
-
--[[gcc-8.3/gcc/rtx_writer/print_rtx_operand()]]
switch (GET_CODE (in_rtx))
{
#ifndef GENERATOR_FILE
case MEM:
if (__builtin_expect (final_insns_dump_p, false))
fprintf (m_outfile, " [");
else
fprintf (m_outfile, " [" HOST_WIDE_INT_PRINT_DEC,
(HOST_WIDE_INT) MEM_ALIAS_SET (in_rtx));
if (MEM_EXPR (in_rtx))
print_mem_expr (m_outfile, MEM_EXPR (in_rtx));
else
fputc (' ', m_outfile);
-
--[[gcc-8.3/gcc/HOST_WIDE_INT_PRINT_DEC]]
--[[gcc-8.3/gcc/HOST_WIDE_INT]]
--[[gcc-8.3/gcc/MEM_ALIAS_SET()]]
--[[gcc-8.3/gcc/MEM_EXPR()]]
--[[gcc-8.3/gcc/print_mem_expr()]]
if (MEM_OFFSET_KNOWN_P (in_rtx))
{
fprintf (m_outfile, "+");
print_poly_int (m_outfile, MEM_OFFSET (in_rtx));
}
if (MEM_SIZE_KNOWN_P (in_rtx))
{
fprintf (m_outfile, " S");
print_poly_int (m_outfile, MEM_SIZE (in_rtx));
}
-
--[[gcc-8.3/gcc/MEM_OFFSET_KNOWN_P()]]
--[[gcc-8.3/gcc/MEM_SIZE_KNWON_P()]]
--[[gcc-8.3/gcc/print_poly_int()]]
if (MEM_ALIGN (in_rtx) != 1)
fprintf (m_outfile, " A%u", MEM_ALIGN (in_rtx));
if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (in_rtx)))
fprintf (m_outfile, " AS%u", MEM_ADDR_SPACE (in_rtx));
-
--[[gcc-8.3/gcc/MEM_ALIGN()]]
--[[gcc-8.3/gcc/ADDR_SPACE_GENERIC_P()]]
--[[gcc-8.3/gcc/MEM_ADDR_SPACE()]]
fputc (']', m_outfile);
break;
case CONST_DOUBLE:
if (FLOAT_MODE_P (GET_MODE (in_rtx)))
{
char s[60];
real_to_decimal (s, CONST_DOUBLE_REAL_VALUE (in_rtx),
sizeof (s), 0, 1);
fprintf (m_outfile, " %s", s);
real_to_hexadecimal (s, CONST_DOUBLE_REAL_VALUE (in_r...
sizeof (s), 0, 1);
fprintf (m_outfile, " [%s]", s);
}
break;
-
--[[gcc-8.3/gcc/FLOAT_MODE_P()]]
--[[gcc-8.3/gcc/GET_MODE()]]
--[[gcc-8.3/gcc/real_to_decimal()]]
--[[gcc-8.3/gcc/CONST_DOUBLE_REAL_VALUE()]]
--[[gcc-8.3/gcc/real_to_hexadecimal()]]
case CONST_WIDE_INT:
fprintf (m_outfile, " ");
cwi_output_hex (m_outfile, in_rtx);
break;
-
--[[gcc-8.3/gcc/cwi_output_hex()]]
case CONST_POLY_INT:
fprintf (m_outfile, " [");
print_dec (CONST_POLY_INT_COEFFS (in_rtx)[0], m_ou...
for (unsigned int i = 1; i < NUM_POLY_INT_COEFFS; ...
{
fprintf (m_outfile, ", ");
print_dec (CONST_POLY_INT_COEFFS (in_rtx)[i], m_outfi...
}
fprintf (m_outfile, "]");
break;
#endif
-
--[[gcc-8.3/gcc/print_dec()]]
--[[gcc-8.3/gcc/CONST_POLY_INT_COEFFS()]]
--[[gcc-8.3/gcc/NUM_POLY_INT_COEFFS]]
case CODE_LABEL:
if (!m_compact)
fprintf (m_outfile, " [%d uses]", LABEL_NUSES (in_rtx));
switch (LABEL_KIND (in_rtx))
{
case LABEL_NORMAL: break;
case LABEL_STATIC_ENTRY: fputs (" [entry]", m_outfile...
case LABEL_GLOBAL_ENTRY: fputs (" [global entry]", m_...
case LABEL_WEAK_ENTRY: fputs (" [weak entry]", m_outf...
default: gcc_unreachable ();
}
break;
-
--[[gcc-8.3/gcc/LABEL_KIND()]]
default:
break;
}
fputc (')', m_outfile);
m_sawclose = 1;
}
*コメント [#e9733ba0]
ページ名: