]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.h (num_in_fnames): Declare.
authorGeoffrey Keating <geoffk@apple.com>
Mon, 21 Jul 2003 21:25:47 +0000 (21:25 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Mon, 21 Jul 2003 21:25:47 +0000 (21:25 +0000)
* c-common.h (num_in_fnames): Declare.
(c_static_assembler_name): Move from here...
* c-tree.h (c_static_assembler_name): ... to here.
* c-opts.c: Don't include langhooks-def.h.
(c_static_assembler_name): Move to c-decl.c.
(num_in_fnames): Make externally visible.
* c-decl.c: Include langhooks-def.h.
(c_static_assembler_name): Move from c-opts.c.
* Makefile.in (c-decl.o): Add $(LANGHOOKS_DEF_H).
(c-opts.o): Remove $(LANGHOOKS_DEF_H).

From-SVN: r69650

gcc/ChangeLog
gcc/Makefile.in
gcc/c-common.h
gcc/c-decl.c
gcc/c-opts.c
gcc/c-tree.h

index 87b9cc2d44ffd11387c3c4c01bf926817ad2bcbc..c36fb6f8920550a76187f1a40b34b4c7d143c90c 100644 (file)
@@ -5,6 +5,17 @@
 
 2003-07-21  Geoffrey Keating  <geoffk@apple.com>
 
+       * c-common.h (num_in_fnames): Declare.
+       (c_static_assembler_name): Move from here...
+       * c-tree.h (c_static_assembler_name): ... to here.
+       * c-opts.c: Don't include langhooks-def.h.
+       (c_static_assembler_name): Move to c-decl.c.
+       (num_in_fnames): Make externally visible.
+       * c-decl.c: Include langhooks-def.h.
+       (c_static_assembler_name): Move from c-opts.c.
+       * Makefile.in (c-decl.o): Add $(LANGHOOKS_DEF_H).
+       (c-opts.o): Remove $(LANGHOOKS_DEF_H).
+
        * c-pragma.c (maybe_apply_pragma_weak): Don't get DECL_ASSEMBLER_NAME
        when it's not needed.
 
index dcffe35f11c010d75c9eb50e14abda7cf16e4e83..384c0b78cb8fb9f28778dfdfd0d9d453ea8776d2 100644 (file)
@@ -1268,7 +1268,8 @@ c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
 c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
     $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) flags.h function.h output.h \
     $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) \
-    c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h
+    c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h \
+    $(LANGHOOKS_DEF_H)
 c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
     $(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
 c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
@@ -1323,8 +1324,7 @@ c-pretty-print.o : c-pretty-print.c c-pretty-print.h pretty-print.h \
 
 c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
         c-pragma.h flags.h toplev.h langhooks.h tree-inline.h diagnostic.h \
-       intl.h debug.h $(C_COMMON_H) opts.h options.h $(PARAMS_H) \
-       $(LANGHOOKS_DEF_H)
+       intl.h debug.h $(C_COMMON_H) opts.h options.h $(PARAMS_H)
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
                $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
 
index 6f579ac9ed1d597d819dc20aa5aa08c1f479476d..680774a8dcc16249e028f243b7774efaec434a2e 100644 (file)
@@ -856,6 +856,11 @@ extern int max_tinst_depth;
 
 extern int skip_evaluation;
 
+/* The count of input filenames.  Only really valid for comparisons
+   against 1.  */
+
+extern unsigned num_in_fnames;
+
 /* C types are partitioned into three subsets: object, function, and
    incomplete types.  */
 #define C_TYPE_OBJECT_P(type) \
@@ -905,7 +910,6 @@ extern void check_function_format (int *, tree, tree);
 extern void set_Wformat (int);
 extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
-extern void c_static_assembler_name (tree);
 extern void c_common_insert_default_attributes (tree);
 extern int c_common_handle_option (size_t code, const char *arg, int value);
 extern void c_common_handle_filename (const char *filename);
index 990b4efbf389ec6c68dafe78c0f2b578b154ee56..92a8d8586ff62848fc1d03ba42467516fef00067 100644 (file)
@@ -52,6 +52,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "hashtab.h"
 #include "libfuncs.h"
 #include "except.h"
+#include "langhooks-def.h"
 
 /* In grokdeclarator, distinguish syntactic contexts of declarators.  */
 enum decl_context
@@ -6771,6 +6772,22 @@ make_pointer_declarator (tree type_quals_attrs, tree target)
   return build1 (INDIRECT_REF, quals, itarget);
 }
 
+/* A wrapper around lhd_set_decl_assembler_name that gives static
+   variables their C names if they are at the top level and only one
+   translation unit is being compiled, for backwards compatibility
+   with certain bizzare assembler hacks (like crtstuff.c).  */
+
+void
+c_static_assembler_name (tree decl)
+{
+  if (num_in_fnames == 1
+      && TREE_STATIC (decl) && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl)
+      && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL)
+    SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+  else
+    lhd_set_decl_assembler_name (decl);
+}
+
 /* Hash and equality functions for link_hash_table: key off
    DECL_ASSEMBLER_NAME.  */
 
index 44b6c1abf1977b4348e25ba5faea95677195624c..34e1d060a4617c001a2aac0c25860c59d5664b60 100644 (file)
@@ -37,7 +37,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "debug.h"             /* For debug_hooks.  */
 #include "opts.h"
 #include "options.h"
-#include "langhooks-def.h"
 
 #ifndef DOLLARS_IN_IDENTIFIERS
 # define DOLLARS_IN_IDENTIFIERS true
@@ -54,7 +53,7 @@ static cpp_options *cpp_opts;
 
 /* Input filename.  */
 static const char **in_fnames;
-static unsigned num_in_fnames;
+unsigned num_in_fnames;
 static const char *this_input_filename;
 
 /* Filename and stream for preprocessed output.  */
@@ -1250,22 +1249,6 @@ c_common_finish (void)
     fatal_error ("when writing output to %s: %m", out_fname);
 }
 
-/* A wrapper around lhd_set_decl_assembler_name that gives static
-   variables their C names if they are at the top level and only one
-   translation unit is being compiled, for backwards compatibility
-   with certain bizzare assembler hacks (like crtstuff.c).  */
-
-void
-c_static_assembler_name (tree decl)
-{
-  if (num_in_fnames == 1
-      && TREE_STATIC (decl) && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl)
-      && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL)
-    SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
-  else
-    lhd_set_decl_assembler_name (decl);
-}
-
 /* Either of two environment variables can specify output of
    dependencies.  Their value is either "OUTPUT_FILE" or "OUTPUT_FILE
    DEPS_TARGET", where OUTPUT_FILE is the file to write deps info to
index fb12e7a8d00cd9aa04dab9e822e7b031e7b1fc34..0a36609093af40946371d059ddc32d2d3a1ec93a 100644 (file)
@@ -230,6 +230,7 @@ extern tree xref_tag (enum tree_code, tree);
 extern tree c_begin_compound_stmt (void);
 extern void c_expand_deferred_function (tree);
 extern void c_expand_decl_stmt (tree);
+extern void c_static_assembler_name (tree);
 extern tree make_pointer_declarator (tree, tree);
 extern void merge_translation_unit_decls (void);