ObjC/ObjC++: Tidy up #includes of objc-act.c

Nicola Pero nicola.pero@meta-innovation.com
Wed Dec 1 21:53:00 GMT 2010


This patch tidies up the list of #includes in objc-act.c.  For each file,
it adds an explanation of why it is included (as far as I could determine).

A few files were not needed and I could remove the line that #included them
(great).

A few other files are implicitly #included by tree.h or c-tree.h etc. and
I left them, commented out, but with a comment explaining what is happening.

I guess it's kind of a trivial patch, but as I did the cleanup, I'd like
to commit it.

Ok to commit ?

Thanks

Index: objc-act.c
===================================================================
--- objc-act.c  (revision 167353)
+++ objc-act.c  (working copy)
@@ -20,10 +20,10 @@ You should have received a copy of the GNU General
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+/* Basic includes.  */
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
 #include "tree.h"
 
 #ifdef OBJCPLUS
@@ -33,30 +33,49 @@ along with GCC; see the file COPYING3.  If not see
 #include "c-lang.h"
 #endif
 
+/* Declarations of most functions in this file.  */
 #include "c-family/c-common.h"
-#include "c-family/c-pragma.h"
-#include "c-family/c-format.h"
-#include "flags.h"
+
+/* For lang_hooks.  */
 #include "langhooks.h"
+
+/* Header associated with this file.  */
 #include "objc-act.h"
-#include "input.h"
-#include "function.h"
+
+/* For input_location.  Already included by tree.h.  */
+/* #include "input.h" */
+
+/* For assemble_external().  */
 #include "output.h"
+
+/* For warn_deprecated_use(), rest_of_decl_compilation().  */
 #include "toplev.h"
-#include "ggc.h"
+
+/* Already included by gimple.h.  */
+/* #include "ggc.h" */
+
+/* For debug_hooks, do_nothing_debug_hooks.  */
 #include "debug.h"
+
+/* For targetcm.  */
 #include "target.h"
-#include "diagnostic-core.h"
+
+/* For warning(), error(), etc.  Already included by c-tree.h or cp-tree.h.  */
+/* #include "diagnostic-core.h" */
+
+/* For _().  */
 #include "intl.h"
+
+/* For cgraph_mark_needed_node(), cgraph_node().  */
 #include "cgraph.h"
+
+/* For tree_stmt_iterator, append_to_statement_list().  */
 #include "tree-iterator.h"
-#include "hashtab.h"
-#include "langhooks-def.h"
 
-/* For default_tree_printer ().  */
-#include "tree-pretty-print.h"
+/* Already included by tree.h.  */
+/* #include "hashtab.h" */
 
-/* For enum gimplify_status */
+/* For enum gimplify_status, gimplify_expr(), is_gimple_val(), etc.  */
 #include "gimple.h"
 
 #define OBJC_VOID_AT_END       void_list_node
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 167353)
+++ ChangeLog   (working copy)
@@ -1,3 +1,10 @@
+2010-12-01  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       * objc-act.c: Do not include tm.h, c-family/c-pragma.h,
+       c-family/c-format.h, flags.h, input.h, function.h, gcc.h,
+       diagnostic-core.h, hashtab.h, langhooks-def.h and
+       tree-pretty-print.h.  Updated comments for #includes.
+
 2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>
 
        * objc-act.c (objc_build_volatilized_type): Removed.




More information about the Gcc-patches mailing list