public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] new -fdump flag
@ 2017-05-09 12:06 Nathan Sidwell
  2017-05-09 12:26 ` Richard Biener
  2017-05-16 18:33 ` Jason Merrill
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Sidwell @ 2017-05-09 12:06 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

This patch adds a new '-fdump-front-end' flag and associated dump 
machinery.  I use it on the modules branch, as that's sufficiently 
complex to need a dumper.  The dump file is unnumbered with a '.fe' 
suffix.  Perhaps it will be useful for other front ends too.

I'm also prepared to remove the -fdump-translation-unit dumper, which is 
a completely inscrutable c++ only dump, that I think is well past its 
best-before date. (Jason?)

If there's a preference to hold this off until merging modules, that's 
fine.  Just thought I'd float it now.

nathan
-- 
Nathan Sidwell

[-- Attachment #2: dfe.diff --]
[-- Type: text/x-patch, Size: 3280 bytes --]

2017-05-09  Nathan Sidwell  <nathan@acm.org>

	Front end dump file.
	gcc/
	* dumpfile.h (tree_dump_index): Add TDI_lang.
	(TDF_LANG): New.
	* dumpfile.c (dump_files): Add front-end.
	(dump_option_value_info): Add lang.  Adjust all.
	gcc/doc/
	* invoke.texi (-fdump-front-end): Document.

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 247784)
+++ doc/invoke.texi	(working copy)
@@ -542,6 +542,7 @@ Objective-C and Objective-C++ Dialects}.
 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
 -fdump-final-insns@r{[}=@var{file}@r{]}
+-fdump-front-end @gol
 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
 -fdump-passes @gol
 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
@@ -12948,6 +12953,11 @@ same directory as the output file.  If t
 is used, @var{options} controls the details of the dump as described
 for the @option{-fdump-tree} options.
 
+@item -fdump-front-end
+@opindex fdump-front-end
+Dump front-end-specific information.  The file name is made by appending
+@file{.fe} to the source file name.
+
 @item -fdump-ipa-@var{switch}
 @opindex fdump-ipa
 Control the dumping at various stages of inter-procedural analysis
Index: dumpfile.c
===================================================================
--- dumpfile.c	(revision 247784)
+++ dumpfile.c	(working copy)
@@ -51,6 +51,8 @@ int dump_flags;
 static struct dump_file_info dump_files[TDI_end] =
 {
   {NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, false, false},
+  {".fe", "front-end", NULL, NULL, NULL, NULL, NULL, TDF_LANG,
+   OPTGROUP_OTHER, 0, 0, 0, -1, false, false},
   {".cgraph", "ipa-cgraph", NULL, NULL, NULL, NULL, NULL, TDF_IPA,
    0, 0, 0, 0, 0, false, false},
   {".type-inheritance", "ipa-type-inheritance", NULL, NULL, NULL, NULL, NULL, TDF_IPA,
@@ -115,10 +117,11 @@ static const struct dump_option_value_in
   {"missed", MSG_MISSED_OPTIMIZATION},
   {"note", MSG_NOTE},
   {"optall", MSG_ALL},
+  {"lang", TDF_LANG},
   {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
 	    | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
 	    | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV
-	    | TDF_GIMPLE)},
+	    | TDF_GIMPLE | TDF_LANG)},
   {NULL, 0}
 };
 
Index: dumpfile.h
===================================================================
--- dumpfile.h	(revision 247784)
+++ dumpfile.h	(working copy)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.
 enum tree_dump_index
 {
   TDI_none,			/* No dump */
+  TDI_lang,			/* Lang-specific.  */
   TDI_cgraph,                   /* dump function call graph.  */
   TDI_inheritance,              /* dump type inheritance graph.  */
   TDI_clones,			/* dump IPA cloning decisions.  */
@@ -89,7 +90,7 @@ enum tree_dump_index
 #define MSG_NOTE                 (1 << 29)  /* general optimization info */
 #define MSG_ALL         (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
                          | MSG_NOTE)
-
+#define TDF_LANG	(1 << 30)	/* Lang-specific dumper.  */
 
 /* Flags to control high-level -fopt-info dumps.  Usually these flags
    define a group of passes.  An optimization pass can be part of

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

* Re: [PATCH] new -fdump flag
  2017-05-09 12:06 [PATCH] new -fdump flag Nathan Sidwell
@ 2017-05-09 12:26 ` Richard Biener
  2017-05-16 18:33 ` Jason Merrill
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2017-05-09 12:26 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: GCC Patches, Jason Merrill

On Tue, May 9, 2017 at 2:05 PM, Nathan Sidwell <nathan@acm.org> wrote:
> This patch adds a new '-fdump-front-end' flag and associated dump machinery.
> I use it on the modules branch, as that's sufficiently complex to need a
> dumper.  The dump file is unnumbered with a '.fe' suffix.  Perhaps it will
> be useful for other front ends too.
>
> I'm also prepared to remove the -fdump-translation-unit dumper, which is a
> completely inscrutable c++ only dump, that I think is well past its
> best-before date. (Jason?)
>
> If there's a preference to hold this off until merging modules, that's fine.
> Just thought I'd float it now.

Can you please use sth else than 'front-end', specifically sth without a dash?
Maybe simply 'lang'?  Why do you need a new sub-switch ('-lang')?  Is this
for dumping into other dump-files from, say, langhooks?

Richard.

> nathan
> --
> Nathan Sidwell

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

* Re: [PATCH] new -fdump flag
  2017-05-09 12:06 [PATCH] new -fdump flag Nathan Sidwell
  2017-05-09 12:26 ` Richard Biener
@ 2017-05-16 18:33 ` Jason Merrill
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Merrill @ 2017-05-16 18:33 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: GCC Patches

On Tue, May 9, 2017 at 8:05 AM, Nathan Sidwell <nathan@acm.org> wrote:
> I'm also prepared to remove the -fdump-translation-unit dumper, which is a
> completely inscrutable c++ only dump, that I think is well past its
> best-before date. (Jason?)

I think that's left over from previous modulesish work by Gaby and
Bjarne; tearing it out at this point seems fine.

Jason

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

end of thread, other threads:[~2017-05-16 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 12:06 [PATCH] new -fdump flag Nathan Sidwell
2017-05-09 12:26 ` Richard Biener
2017-05-16 18:33 ` Jason Merrill

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).