From: Aldy Hernandez Date: Mon, 4 Nov 2019 19:52:06 +0000 (+0000) Subject: Implement debugging functions for assert_info's. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbb640fa1cbf1a9590178d277d2b1cd110923e6e;p=gcc.git Implement debugging functions for assert_info's. From-SVN: r277790 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d90105c8c3..dd1b042a470 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-04 Aldy Hernandez + + * tree-vrp.c (dump_assert_info): New. + (dump_asserts_info): New. + 2019-11-04 Jan Hubicka * ipa-inline-transform.c: Include ipa-utils.h diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index da6b6151b4a..7c35802dacc 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2114,6 +2114,45 @@ debug_all_asserts (void) dump_all_asserts (stderr); } +/* Dump assert_info structure. */ + +void +dump_assert_info (FILE *file, const assert_info &assert) +{ + fprintf (file, "Assert for: "); + print_generic_expr (file, assert.name); + fprintf (file, "\n\tPREDICATE: expr=["); + print_generic_expr (file, assert.expr); + fprintf (file, "] %s ", get_tree_code_name (assert.comp_code)); + fprintf (file, "val=["); + print_generic_expr (file, assert.val); + fprintf (file, "]\n\n"); +} + +DEBUG_FUNCTION void +debug (const assert_info &assert) +{ + dump_assert_info (stderr, assert); +} + +/* Dump a vector of assert_info's. */ + +void +dump_asserts_info (FILE *file, const vec &asserts) +{ + for (unsigned i = 0; i < asserts.length (); ++i) + { + dump_assert_info (file, asserts[i]); + fprintf (file, "\n"); + } +} + +DEBUG_FUNCTION void +debug (const vec &asserts) +{ + dump_asserts_info (stderr, asserts); +} + /* Push the assert info for NAME, EXPR, COMP_CODE and VAL to ASSERTS. */ static void