]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-modref: Fix dumping
authorMartin Jambor <mjambor@suse.cz>
Tue, 3 Oct 2023 16:44:52 +0000 (18:44 +0200)
committerMartin Jambor <mjambor@suse.cz>
Tue, 3 Oct 2023 16:49:01 +0000 (18:49 +0200)
Function dump_lto_records ought to dump to its parameter OUT but was
dumping expressions to dump_file.  This is corrected by this patch and
while at at, I also made the modref_summary::dump member function
const so that it is callable from more contexts.

gcc/ChangeLog:

2023-09-21  Martin Jambor  <mjambor@suse.cz>

* ipa-modref.h (modref_summary::dump): Make const.
* ipa-modref.cc (modref_summary::dump): Likewise.
(dump_lto_records): Dump to out instead of dump_file.

gcc/ipa-modref.cc
gcc/ipa-modref.h

index c04f9f44c064d2f3aac9b611e45691c3059a390e..fe55621f0078858de96d1b913a2e14678a47e483 100644 (file)
@@ -474,7 +474,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out)
   FOR_EACH_VEC_SAFE_ELT (tt->bases, i, n)
     {
       fprintf (out, "      Base %i:", (int)i);
-      print_generic_expr (dump_file, n->base);
+      print_generic_expr (out, n->base);
       fprintf (out, " (alias set %i)\n",
               n->base ? get_alias_set (n->base) : 0);
       if (n->every_ref)
@@ -487,7 +487,7 @@ dump_lto_records (modref_records_lto *tt, FILE *out)
       FOR_EACH_VEC_SAFE_ELT (n->refs, j, r)
        {
          fprintf (out, "        Ref %i:", (int)j);
-         print_generic_expr (dump_file, r->ref);
+         print_generic_expr (out, r->ref);
          fprintf (out, " (alias set %i)\n",
                   r->ref ? get_alias_set (r->ref) : 0);
          if (r->every_access)
@@ -567,7 +567,7 @@ remove_modref_edge_summaries (cgraph_node *node)
 /* Dump summary.  */
 
 void
-modref_summary::dump (FILE *out)
+modref_summary::dump (FILE *out) const
 {
   if (loads)
     {
index 2a2d31e86dbeb87934ef0f9b3cd81620a2ea26fa..f7dedace2da9c9f8f3dd8053d0781a466bf801ec 100644 (file)
@@ -66,7 +66,7 @@ struct GTY(()) modref_summary
 
   modref_summary ();
   ~modref_summary ();
-  void dump (FILE *);
+  void dump (FILE *) const;
   bool useful_p (int ecf_flags, bool check_flags = true);
   void finalize (tree);
 };