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
This commit is contained in:
Zack Weinberg 2003-07-13 17:34:18 +00:00 committed by Zack Weinberg
parent 0acf4f8857
commit 438396422c
20 changed files with 56 additions and 55 deletions

View File

@ -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

View File

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

View File

@ -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')

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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;

View File

@ -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 *);

View File

@ -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);

View File

@ -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"

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

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

View File

@ -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));

View File

@ -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. */

View File

@ -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"

View File

@ -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