diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2012-10-30 08:38:11 +0000 |
---|---|---|
committer | H.J. Lu <hongjiu.lu@intel.com> | 2012-10-30 08:38:11 +0000 |
commit | daf6d1aee0ada8f463cfc742b025c449d50171d8 (patch) | |
tree | 154a7356848a26b5bf889ee2f3c948b857383eb8 /gcc/gimple-pretty-print.c | |
parent | 1a1282330a3cfdb4241a52aa762b66d2d7723712 (diff) |
Remove alloca from dump_gimple_bb_header
* gimple-pretty-print.c (dump_gimple_bb_header): Avoid alloca.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192981 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-pretty-print.c')
-rw-r--r-- | gcc/gimple-pretty-print.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c index 4b3235edf56..a5a493a0888 100644 --- a/gcc/gimple-pretty-print.c +++ b/gcc/gimple-pretty-print.c @@ -2068,9 +2068,6 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags) if (flags & TDF_LINENO) { gimple_stmt_iterator gsi; - char *s_indent = (char *) alloca ((size_t) indent + 1); - memset (s_indent, ' ', (size_t) indent); - s_indent[indent] = '\0'; if (flags & TDF_COMMENT) fputs (";; ", outf); @@ -2079,8 +2076,8 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags) if (!is_gimple_debug (gsi_stmt (gsi)) && get_lineno (gsi_stmt (gsi)) != UNKNOWN_LOCATION) { - fprintf (outf, "%sstarting at line %d", - s_indent, get_lineno (gsi_stmt (gsi))); + fprintf (outf, "%*sstarting at line %d", + indent, "", get_lineno (gsi_stmt (gsi))); break; } if (bb->discriminator) @@ -2092,12 +2089,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, int flags) { gimple stmt = first_stmt (bb); if (!stmt || gimple_code (stmt) != GIMPLE_LABEL) - { - char *s_indent = (char *) alloca ((size_t) indent - 2 + 1); - memset (s_indent, ' ', (size_t) indent); - s_indent[indent] = '\0'; - fprintf (outf, "%s<bb %d>:\n", s_indent, bb->index); - } + fprintf (outf, "%*s<bb %d>:\n", indent, "", bb->index); } } |