public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/lto-dump-garbagge)] lto-dump: Do not print output file
@ 2022-07-04 14:33 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-07-04 14:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:52bfc186efad3677bd8de8ddc5aeb51474161129

commit 52bfc186efad3677bd8de8ddc5aeb51474161129
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Jul 4 16:32:51 2022 +0200

    lto-dump: Do not print output file
    
    gcc/lto/ChangeLog:
    
            * lto-dump.cc (lto_main): Exit in the function
            as we don't want any LTO bytecode processing.
    
    gcc/ChangeLog:
    
            * toplev.cc (init_asm_output): Do not init asm_out_file.

Diff:
---
 gcc/lto/lto-dump.cc | 16 ++++++++++------
 gcc/toplev.cc       |  2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
index f88486b5143..f3d852df51f 100644
--- a/gcc/lto/lto-dump.cc
+++ b/gcc/lto/lto-dump.cc
@@ -316,7 +316,10 @@ lto_main (void)
 {
   quiet_flag = true;
   if (flag_lto_dump_tool_help)
-    dump_tool_help ();
+    {
+      dump_tool_help ();
+      exit (SUCCESS_EXIT_CODE);
+    }
 
   /* LTO is called as a front end, even though it is not a front end.
      Because it is called as a front end, TV_PHASE_PARSING and
@@ -369,11 +372,12 @@ lto_main (void)
     {
       /* Dump specific gimple body of specified function.  */
       dump_body ();
-      return;
     }
   else if (flag_dump_callgraph)
-    {
-      dump_symtab_graphviz ();
-      return;
-    }
+    dump_symtab_graphviz ();
+  else
+    dump_tool_help ();
+
+  /* Exit right now.  */
+  exit (SUCCESS_EXIT_CODE);
 }
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index a24ad5db438..1ee6882435d 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -721,7 +721,7 @@ init_asm_output (const char *name)
 		     "cannot open %qs for writing: %m", asm_file_name);
     }
 
-  if (!flag_syntax_only)
+  if (!flag_syntax_only && !(global_dc->lang_mask | CL_LTODump))
     {
       targetm.asm_out.file_start ();


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/marxin/heads/lto-dump-garbagge)] lto-dump: Do not print output file
@ 2022-07-07 12:13 Martin Liska
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2022-07-07 12:13 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:be2631d9f1ea8ebc7e31d2a978e37d3d0be628cc

commit be2631d9f1ea8ebc7e31d2a978e37d3d0be628cc
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Jul 4 16:32:51 2022 +0200

    lto-dump: Do not print output file
    
    gcc/lto/ChangeLog:
    
            * lto-dump.cc (lto_main): Exit in the function
            as we don't want any LTO bytecode processing.
    
    gcc/ChangeLog:
    
            * toplev.cc (init_asm_output): Do not init asm_out_file.

Diff:
---
 gcc/lto/lto-dump.cc | 16 ++++++++++------
 gcc/toplev.cc       |  2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
index f88486b5143..f3d852df51f 100644
--- a/gcc/lto/lto-dump.cc
+++ b/gcc/lto/lto-dump.cc
@@ -316,7 +316,10 @@ lto_main (void)
 {
   quiet_flag = true;
   if (flag_lto_dump_tool_help)
-    dump_tool_help ();
+    {
+      dump_tool_help ();
+      exit (SUCCESS_EXIT_CODE);
+    }
 
   /* LTO is called as a front end, even though it is not a front end.
      Because it is called as a front end, TV_PHASE_PARSING and
@@ -369,11 +372,12 @@ lto_main (void)
     {
       /* Dump specific gimple body of specified function.  */
       dump_body ();
-      return;
     }
   else if (flag_dump_callgraph)
-    {
-      dump_symtab_graphviz ();
-      return;
-    }
+    dump_symtab_graphviz ();
+  else
+    dump_tool_help ();
+
+  /* Exit right now.  */
+  exit (SUCCESS_EXIT_CODE);
 }
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index a24ad5db438..61d234a9ef4 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -721,7 +721,7 @@ init_asm_output (const char *name)
 		     "cannot open %qs for writing: %m", asm_file_name);
     }
 
-  if (!flag_syntax_only)
+  if (!flag_syntax_only && !(global_dc->lang_mask & CL_LTODump))
     {
       targetm.asm_out.file_start ();


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-07 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 14:33 [gcc(refs/users/marxin/heads/lto-dump-garbagge)] lto-dump: Do not print output file Martin Liska
2022-07-07 12:13 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).