aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2003-07-13 17:34:18 +0000
committerZack Weinberg <zack@gcc.gnu.org>2003-07-13 17:34:18 +0000
commit438396422cf866b96ccdb10c32875e425b37c0ac (patch)
treea7cccc1c8ac0a9c5388a19e98814b9a1cc541648
parent0acf4f8857224501ab8bd97bf0146f7cb766441e (diff)
downloadgcc-438396422cf866b96ccdb10c32875e425b37c0ac.zip
gcc-438396422cf866b96ccdb10c32875e425b37c0ac.tar.gz
gcc-438396422cf866b96ccdb10c32875e425b37c0ac.tar.bz2
Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
* Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H). (hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency list. Move these all together down by cpplib. * cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining definition of CPPCHAR_SIGNED_T. * cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c * cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c * line-map.c, mkdeps.c: Don't include coretypes.h or tm.h. * cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init. * cppinit.c (cpp_create_reader): Likewise. * cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line. * cpptrad.c: Likewise. All callers changed. * cpplib.c: All callers changed. * c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout. * hashtable.h: Define GTY(x) to nothing here too. From-SVN: r69298
-rw-r--r--gcc/ChangeLog22
-rw-r--r--gcc/Makefile.in10
-rw-r--r--gcc/c-ppoutput.c4
-rw-r--r--gcc/cppcharset.c2
-rw-r--r--gcc/cpperror.c2
-rw-r--r--gcc/cppexp.c2
-rw-r--r--gcc/cppfiles.c2
-rw-r--r--gcc/cpphash.c7
-rw-r--r--gcc/cpphash.h2
-rw-r--r--gcc/cppinit.c6
-rw-r--r--gcc/cpplex.c2
-rw-r--r--gcc/cpplib.c5
-rw-r--r--gcc/cpplib.h20
-rw-r--r--gcc/cppmacro.c2
-rw-r--r--gcc/cpppch.c1
-rw-r--r--gcc/cpptrad.c10
-rw-r--r--gcc/hashtable.c7
-rw-r--r--gcc/hashtable.h1
-rw-r--r--gcc/line-map.c2
-rw-r--r--gcc/mkdeps.c2
20 files changed, 56 insertions, 55 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9cda02..d95408b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,25 @@
+2003-07-13 Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
+ (hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency
+ list. Move these all together down by cpplib.
+
+ * cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining
+ definition of CPPCHAR_SIGNED_T.
+
+ * cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c
+ * cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c
+ * line-map.c, mkdeps.c: Don't include coretypes.h or tm.h.
+
+ * cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init.
+ * cppinit.c (cpp_create_reader): Likewise.
+
+ * cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line.
+ * cpptrad.c: Likewise. All callers changed.
+ * cpplib.c: All callers changed.
+ * c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout.
+ * hashtable.h: Define GTY(x) to nothing here too.
+
2003-07-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c (compute_record_mode): Remove very obsolete test
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3573a3e..ed2a23a 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1450,10 +1450,6 @@ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TR
stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(GGC_H) gt-stringpool.h
-hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H)
-
-line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
-
ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -2356,7 +2352,7 @@ LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
hashtable.o line-map.o mkdeps.o cpppch.o
LIBCPP_DEPS = $(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
- $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
+ $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H)
# Most of the other archives built/used by this makefile are for
# targets. This one is strictly for the host.
@@ -2383,7 +2379,9 @@ cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(PREPROCESSOR_DEFINES) \
-c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
-mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) mkdeps.h
+mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
+hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
+line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
# Note for the stamp targets, we run the program `true' instead of
# having an empty command (nothing following the semicolon).
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index 333da30..c37435f 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -42,7 +42,7 @@ static struct
/* General output routines. */
static void scan_translation_unit (cpp_reader *);
static void scan_translation_unit_trad (cpp_reader *);
-static void account_for_newlines (const uchar *, size_t);
+static void account_for_newlines (const unsigned char *, size_t);
static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
static void print_line (const struct line_map *, unsigned int,
@@ -174,7 +174,7 @@ scan_translation_unit (cpp_reader *pfile)
/* Adjust print.line for newlines embedded in output. */
static void
-account_for_newlines (const uchar *str, size_t len)
+account_for_newlines (const unsigned char *str, size_t len)
{
while (len--)
if (*str++ == '\n')
diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c
index 0fc87f2c..b38eea0 100644
--- a/gcc/cppcharset.c
+++ b/gcc/cppcharset.c
@@ -20,8 +20,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "cppucnid.h"
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index cb681f0..ceb4b93 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -25,8 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 16082ef..b558b3e 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -20,8 +20,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 019b005..742e5f1 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -23,8 +23,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include <dirent.h>
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 01cd0a4..8016189 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -25,8 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -57,7 +55,10 @@ _cpp_init_hashtable (cpp_reader *pfile, hash_table *table)
pfile->our_hashtable = 1;
table = ht_create (13); /* 8K (=2^13) entries. */
table->alloc_node = (hashnode (*) (hash_table *)) alloc_node;
- gcc_obstack_init (&pfile->hash_ob);
+
+ _obstack_begin (&pfile->hash_ob, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
}
table->pfile = pfile;
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 0e1bb39..f814b9f 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -552,7 +552,7 @@ extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *,
extern void _cpp_pop_buffer (cpp_reader *);
/* In cpptrad.c. */
-extern bool scan_out_logical_line (cpp_reader *, cpp_macro *);
+extern bool _cpp_scan_out_logical_line (cpp_reader *, cpp_macro *);
extern bool _cpp_read_logical_line_trad (cpp_reader *);
extern void _cpp_overlay_buffer (cpp_reader *pfile, const uchar *, size_t);
extern void _cpp_remove_overlay (cpp_reader *);
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index f12cf1c..0c107b7 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
#include "mkdeps.h"
@@ -194,7 +192,9 @@ cpp_create_reader (enum c_lang lang, hash_table *table)
_cpp_expand_op_stack (pfile);
/* Initialize the buffer obstack. */
- gcc_obstack_init (&pfile->buffer_ob);
+ _obstack_begin (&pfile->buffer_ob, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
_cpp_init_includes (pfile);
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 4630645..a7f13e7 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index bbd6d01..3169f36 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -21,9 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
#include "cpplib.h"
#include "cpphash.h"
#include "obstack.h"
@@ -280,7 +277,7 @@ prepare_directive_trad (cpp_reader *pfile)
|| pfile->directive == &dtable[T_ELIF]);
if (no_expand)
pfile->state.prevent_expansion++;
- scan_out_logical_line (pfile, NULL);
+ _cpp_scan_out_logical_line (pfile, NULL);
if (no_expand)
pfile->state.prevent_expansion--;
pfile->state.skipping = was_skipping;
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 661bbe5..434e455 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -191,18 +191,18 @@ struct cpp_token
/* A type wide enough to hold any multibyte source character.
cpplib's character constant interpreter requires an unsigned type.
- Also, a typedef for the signed equivalent. */
-#ifndef MAX_WCHAR_TYPE_SIZE
-# define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
-#endif
-#if CHAR_BIT * SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE
+ Also, a typedef for the signed equivalent.
+ The width of this type is capped at 32 bits; there do exist targets
+ where wchar_t is 64 bits, but only in a non-default mode, and there
+ would be no meaningful interpretation for a wchar_t value greater
+ than 2^32 anyway -- the widest wide-character encoding around is
+ ISO 10646, which stops at 2^31. */
+#if CHAR_BIT * SIZEOF_INT >= 32
# define CPPCHAR_SIGNED_T int
+#elif CHAR_BIT * SIZEOF_LONG >= 32
+# define CPPCHAR_SIGNED_T long
#else
-# if CHAR_BIT * SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG
-# define CPPCHAR_SIGNED_T long
-# else
-# define CPPCHAR_SIGNED_T long long
-# endif
+# error "Cannot find a least-32-bit signed integer type"
#endif
typedef unsigned CPPCHAR_SIGNED_T cppchar_t;
typedef CPPCHAR_SIGNED_T cppchar_signed_t;
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 2b9c9b5..87ad592 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -25,8 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
diff --git a/gcc/cpppch.c b/gcc/cpppch.c
index 6b60c57..bdb7d16 100644
--- a/gcc/cpppch.c
+++ b/gcc/cpppch.c
@@ -17,7 +17,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
#include "cpplib.h"
#include "cpphash.h"
#include "intl.h"
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c
index 9b08e31..152bc0f 100644
--- a/gcc/cpptrad.c
+++ b/gcc/cpptrad.c
@@ -18,8 +18,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
@@ -305,7 +303,7 @@ _cpp_read_logical_line_trad (cpp_reader *pfile)
if (pfile->buffer->need_line && !_cpp_get_fresh_line (pfile))
return false;
}
- while (!scan_out_logical_line (pfile, NULL) || pfile->state.skipping);
+ while (!_cpp_scan_out_logical_line (pfile, NULL) || pfile->state.skipping);
return true;
}
@@ -343,7 +341,7 @@ save_argument (struct fun_macro *macro, size_t offset)
MACRO, and we call save_replacement_text() every time we meet an
argument. */
bool
-scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
+_cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
{
bool result = true;
cpp_context *context;
@@ -982,7 +980,7 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
if (* CUR (context) == '(')
{
/* Setting macro to NULL indicates an error occurred, and
- prevents unnecessary work in scan_out_logical_line. */
+ prevents unnecessary work in _cpp_scan_out_logical_line. */
if (!scan_parameters (pfile, macro))
macro = NULL;
else
@@ -1000,7 +998,7 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
CPP_OPTION (pfile, discard_comments_in_macro_exp));
pfile->state.prevent_expansion++;
- scan_out_logical_line (pfile, macro);
+ _cpp_scan_out_logical_line (pfile, macro);
pfile->state.prevent_expansion--;
if (!macro)
diff --git a/gcc/hashtable.c b/gcc/hashtable.c
index 88b1a29..fafa100 100644
--- a/gcc/hashtable.c
+++ b/gcc/hashtable.c
@@ -21,8 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "hashtable.h"
/* The code below is a specialization of Vladimir Makarov's expandable
@@ -63,7 +61,10 @@ ht_create (unsigned int order)
memset (table, 0, sizeof (hash_table));
/* Strings need no alignment. */
- gcc_obstack_init (&table->stack);
+ _obstack_begin (&table->stack, 0, 0,
+ (void *(*) (long)) xmalloc,
+ (void (*) (void *)) free);
+
obstack_alignment_mask (&table->stack) = 0;
table->entries = (hashnode *) xcalloc (nslots, sizeof (hashnode));
diff --git a/gcc/hashtable.h b/gcc/hashtable.h
index 47ec1cc..b14ab18 100644
--- a/gcc/hashtable.h
+++ b/gcc/hashtable.h
@@ -19,6 +19,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define GCC_HASHTABLE_H
#include "obstack.h"
+#define GTY(x) /* nothing */
/* This is what each hash table entry points to. It may be embedded
deeply within another object. */
diff --git a/gcc/line-map.c b/gcc/line-map.c
index 8bbe863..1023b91 100644
--- a/gcc/line-map.c
+++ b/gcc/line-map.c
@@ -22,8 +22,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "line-map.h"
#include "intl.h"
diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c
index 71aab3d..bb084a5 100644
--- a/gcc/mkdeps.c
+++ b/gcc/mkdeps.c
@@ -22,8 +22,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
#include "mkdeps.h"
/* Keep this structure local to this file, so clients don't find it