aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-pretty-print.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2016-09-27 16:46:21 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2016-09-27 16:46:21 +0000
commit4d58c533a8a54cfd07f617fd4cfa91e67e51c57d (patch)
tree84caeb9c679772ac95d97b5cecf4031d435f5bed /gcc/gimple-pretty-print.c
parent20fba714a24284d708324e293da17355cbfb9fe9 (diff)
downloadgcc-4d58c533a8a54cfd07f617fd4cfa91e67e51c57d.zip
gcc-4d58c533a8a54cfd07f617fd4cfa91e67e51c57d.tar.gz
gcc-4d58c533a8a54cfd07f617fd4cfa91e67e51c57d.tar.bz2
internal-fn.h (IFN_UNIQUE_CODES, [...]): New.
* internal-fn.h (IFN_UNIQUE_CODES, IFN_GOACC_LOOP_CODES, IFN_GOACC_REDUCTION_CODES): New. (enum ifn_unique_kind, enum ifn_goacc_loop_kind, enum ifn_goacc_reduction_kind): Use them. * gimple-pretty-print.c (dump_gimple_call_args): Decode first arg of internal functions, when applicable. From-SVN: r240552
Diffstat (limited to 'gcc/gimple-pretty-print.c')
-rw-r--r--gcc/gimple-pretty-print.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 12d9a9c..10cb168 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -599,9 +599,63 @@ dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc, int flags)
static void
dump_gimple_call_args (pretty_printer *buffer, gcall *gs, int flags)
{
- size_t i;
+ size_t i = 0;
+
+ /* Pretty print first arg to certain internal fns. */
+ if (gimple_call_internal_p (gs))
+ {
+ const char *const *enums = NULL;
+ unsigned limit = 0;
+
+ switch (gimple_call_internal_fn (gs))
+ {
+ case IFN_UNIQUE:
+#define DEF(X) #X
+ static const char *const unique_args[] = {IFN_UNIQUE_CODES};
+#undef DEF
+ enums = unique_args;
+
+ limit = ARRAY_SIZE (unique_args);
+ break;
+
+ case IFN_GOACC_LOOP:
+#define DEF(X) #X
+ static const char *const loop_args[] = {IFN_GOACC_LOOP_CODES};
+#undef DEF
+ enums = loop_args;
+ limit = ARRAY_SIZE (loop_args);
+ break;
+
+ case IFN_GOACC_REDUCTION:
+#define DEF(X) #X
+ static const char *const reduction_args[]
+ = {IFN_GOACC_REDUCTION_CODES};
+#undef DEF
+ enums = reduction_args;
+ limit = ARRAY_SIZE (reduction_args);
+ break;
+
+ default:
+ break;
+ }
+ if (limit)
+ {
+ tree arg0 = gimple_call_arg (gs, 0);
+ HOST_WIDE_INT v;
+
+ if (TREE_CODE (arg0) == INTEGER_CST
+ && tree_fits_shwi_p (arg0)
+ && (v = tree_to_shwi (arg0)) >= 0 && v < limit)
+ {
+ i++;
+ pp_string (buffer, enums[v]);
+ if (i < gimple_call_num_args (gs))
+ pp_string (buffer, ", ");
+ }
+ }
+ }
- for (i = 0; i < gimple_call_num_args (gs); i++)
+ for (; i < gimple_call_num_args (gs); i++)
{
dump_generic_node (buffer, gimple_call_arg (gs, i), 0, flags, false);
if (i < gimple_call_num_args (gs) - 1)