public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>,
	    Michael Collison <michael.collison@linaro.org>,
	    Andrew MacLeod <amacleod@redhat.com>,
	    Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>,
	Jeff Law <law@redhat.com>
Subject: Re: flatten expr.h (version 2)
Date: Tue, 13 Jan 2015 10:36:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1501131058220.12482@zhemvz.fhfr.qr> (raw)
In-Reply-To: <CAAgBjMm5JiL2Eh8X3rsybCYWFCuTBLTyJT4jk9yKo6SS70sJmQ@mail.gmail.com>

On Sun, 11 Jan 2015, Prathamesh Kulkarni wrote:

> Hi,
> This is a revamped expr.h flattening flattening patch rebased on
> tree.h and tree-core.h flattening patch (r219402).
> It depends upon the following patch to get committed.
> https://gcc.gnu.org/ml/gcc-patches/2015-01/msg00565.html
> 
> Changes:
> * Removed all includes except tree-core.h. Put includes required by
> expr.h in a comment.
> * Moved stmt.c, expmed.c prototypes to stmt.h, expmed.h respectively.
> * Adjusted generator programs: genemit.c, gengtype.c, genopinit.c, genoutput.c.
> * Did not put includes in gcc-plugin.h since expr.h cannot be included
> by plugins
> (putting them broke building a file in c-family/ since expr.h is not
> allowed in front-ends)
> * Affects java front-end (expr.h is allowed in java front-end).
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu with languages:
> all,go,ada,jit
> Built on all targets in config-list.mk with languages: all, go.
> OK to commit ?

diff --git a/gcc/expr.c b/gcc/expr.c
index fc22862..824541e 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -41,11 +41,17 @@ along with GCC; see the file COPYING3.  If not see
 #include "regs.h"
 #include "hard-reg-set.h"
 #include "except.h"
-#include "input.h"
 #include "function.h"
 #include "insn-config.h"
 #include "insn-attr.h"
 /* Include expr.h after insn-config.h so we get HAVE_conditional_move.  
*/
+#include "hashtab.h"
+#include "emit-rtl.h"
+#include "expmed.h"
+#include "stmt.h"
+#include "statistics.h"
+#include "real.h"
+#include "fixed-value.h"
 #include "expr.h"

Please move the comment to the proper place

diff --git a/gcc/expr.h b/gcc/expr.h
index a7638b8..f1be8dc 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -20,7 +20,8 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_EXPR_H
 #define GCC_EXPR_H

-/* For inhibit_defer_pop */
+/* expr.h required includes */
+#if 0
 #include "hashtab.h"
 #include "hash-set.h"
 #include "vec.h"
@@ -29,15 +30,17 @@ along with GCC; see the file COPYING3.  If not see
 #include "hard-reg-set.h"
 #include "input.h"
 #include "function.h"
-/* For XEXP, GEN_INT, rtx_code */
 #include "rtl.h"
-/* For optimize_size */
 #include "flags.h"
-/* For tree_fits_[su]hwi_p, tree_to_[su]hwi, fold_convert, size_binop,
-   ssize_int, TREE_CODE, TYPE_SIZE, int_size_in_bytes,    */
 #include "tree-core.h"
-/* For GET_MODE_BITSIZE, word_mode */
 #include "insn-config.h"
+#include "alias.h"
+#include "emit-rtl.h"
+#include "expmed.h"
+#include "stmt.h"
+#endif

Err, please remove the #if 0 section

+
+#include "tree-core.h"

Why?  The original comment says

-/* For tree_fits_[su]hwi_p, tree_to_[su]hwi, fold_convert, size_binop,
-   ssize_int, TREE_CODE, TYPE_SIZE, int_size_in_bytes,    */

but all those are declared in tree.h.  Which means the files including
expr.h must already include tree.h.

If that's not the reason we need to include tree-core.h from expr.c
please add a comment explaining why.

-/* Definitions from emit-rtl.c */
-#include "emit-rtl.h"
-
 /* Return a memory reference like MEMREF, but with its mode widened to
    MODE and adjusted by OFFSET.  */
 extern rtx widen_memory_access (rtx, machine_mode, HOST_WIDE_INT);

err - functions defined in emit-rtl.c should be declared in emit-rtl.h.
Please fix that first.  expr.h should _only_ contain prototypes
for stuff defined in expr.c.

Andrew did a good job with this, first cleaning up a header moving
declarations to proper places and only after that flattening it.

The rest of the patch looks good to me but expr.h isn't in a good
shape after it.

Thanks,
Richard.

  reply	other threads:[~2015-01-13 10:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12  0:23 Prathamesh Kulkarni
2015-01-13 10:36 ` Richard Biener [this message]
2015-01-13 10:47   ` Prathamesh Kulkarni
2015-01-13 16:38     ` Prathamesh Kulkarni
2015-01-13 20:42       ` Prathamesh Kulkarni
2015-01-14  9:43         ` Richard Biener
2015-01-14 11:16           ` Prathamesh Kulkarni
2015-01-14 11:18             ` Prathamesh Kulkarni
2015-01-14 12:09               ` Prathamesh Kulkarni
2015-01-14 12:17                 ` Richard Biener
2015-01-14 12:23                   ` Prathamesh Kulkarni
2015-01-14 12:24                     ` Richard Biener
2015-01-15 14:10                       ` Prathamesh Kulkarni
2015-01-21 18:00                         ` Eric Botcazou
2015-01-22 22:17                           ` Prathamesh Kulkarni
2015-01-23  1:19                             ` Eric Botcazou
2015-01-23 10:14                             ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.11.1501131058220.12482@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=michael.collison@linaro.org \
    --cc=prathamesh.kulkarni@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).