mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
/* Dependency generator for Makefile fragments.
|
2015-01-05 13:33:28 +01:00
|
|
|
Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
Contributed by Zack Weinberg, Mar 2000
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published by the
|
2009-04-09 17:00:19 +02:00
|
|
|
Free Software Foundation; either version 3, or (at your option) any
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2009-04-09 17:00:19 +02:00
|
|
|
along with this program; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>.
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
In other words, you are welcome to use, share and improve this program.
|
|
|
|
You are forbidden to forbid anyone else to use, share and improve
|
|
|
|
what you give them. Help stamp out software-hoarding! */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "mkdeps.h"
|
|
|
|
|
2001-01-04 11:25:55 +01:00
|
|
|
/* Keep this structure local to this file, so clients don't find it
|
|
|
|
easy to start making assumptions. */
|
|
|
|
struct deps
|
|
|
|
{
|
|
|
|
const char **targetv;
|
|
|
|
unsigned int ntargets; /* number of slots actually occupied */
|
|
|
|
unsigned int targets_size; /* amt of allocated space - in words */
|
|
|
|
|
|
|
|
const char **depv;
|
|
|
|
unsigned int ndeps;
|
|
|
|
unsigned int deps_size;
|
2004-06-05 22:58:06 +02:00
|
|
|
|
|
|
|
const char **vpathv;
|
|
|
|
size_t *vpathlv;
|
|
|
|
unsigned int nvpaths;
|
|
|
|
unsigned int vpaths_size;
|
2001-01-04 11:25:55 +01:00
|
|
|
};
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
static const char *munge (const char *);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
/* Given a filename, quote characters in that filename which are
|
|
|
|
significant to Make. Note that it's not possible to quote all such
|
|
|
|
characters - e.g. \n, %, *, ?, [, \ (in some contexts), and ~ are
|
|
|
|
not properly handled. It isn't possible to get this right in any
|
|
|
|
current version of Make. (??? Still true? Old comment referred to
|
|
|
|
3.76.1.) */
|
2003-07-06 11:56:09 +02:00
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
static const char *
|
2003-07-06 11:56:09 +02:00
|
|
|
munge (const char *filename)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
|
|
|
int len;
|
|
|
|
const char *p, *q;
|
|
|
|
char *dst, *buffer;
|
|
|
|
|
|
|
|
for (p = filename, len = 0; *p; p++, len++)
|
|
|
|
{
|
|
|
|
switch (*p)
|
|
|
|
{
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
/* GNU make uses a weird quoting scheme for white space.
|
|
|
|
A space or tab preceded by 2N+1 backslashes represents
|
|
|
|
N backslashes followed by space; a space or tab
|
|
|
|
preceded by 2N backslashes represents N backslashes at
|
|
|
|
the end of a file name; and backslashes in other
|
|
|
|
contexts should not be doubled. */
|
2000-03-08 00:11:06 +01:00
|
|
|
for (q = p - 1; filename <= q && *q == '\\'; q--)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
len++;
|
|
|
|
len++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '$':
|
2001-01-05 08:50:24 +01:00
|
|
|
/* '$' is quoted by doubling it. */
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
len++;
|
|
|
|
break;
|
2008-03-06 19:08:40 +01:00
|
|
|
|
|
|
|
case '#':
|
|
|
|
/* '#' is quoted with a backslash. */
|
|
|
|
len++;
|
|
|
|
break;
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now we know how big to make the buffer. */
|
2005-05-28 17:52:48 +02:00
|
|
|
buffer = XNEWVEC (char, len + 1);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
for (p = filename, dst = buffer; *p; p++, dst++)
|
|
|
|
{
|
|
|
|
switch (*p)
|
|
|
|
{
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
2000-03-08 00:11:06 +01:00
|
|
|
for (q = p - 1; filename <= q && *q == '\\'; q--)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
*dst++ = '\\';
|
|
|
|
*dst++ = '\\';
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '$':
|
|
|
|
*dst++ = '$';
|
|
|
|
break;
|
|
|
|
|
2008-03-06 19:08:40 +01:00
|
|
|
case '#':
|
|
|
|
*dst++ = '\\';
|
|
|
|
break;
|
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
default:
|
|
|
|
/* nothing */;
|
|
|
|
}
|
|
|
|
*dst = *p;
|
|
|
|
}
|
|
|
|
|
|
|
|
*dst = '\0';
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
/* If T begins with any of the partial pathnames listed in d->vpathv,
|
|
|
|
then advance T to point beyond that pathname. */
|
|
|
|
static const char *
|
|
|
|
apply_vpath (struct deps *d, const char *t)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
2004-06-05 22:58:06 +02:00
|
|
|
if (d->vpathv)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < d->nvpaths; i++)
|
|
|
|
{
|
2011-03-25 20:11:26 +01:00
|
|
|
if (!filename_ncmp (d->vpathv[i], t, d->vpathlv[i]))
|
2004-06-05 22:58:06 +02:00
|
|
|
{
|
|
|
|
const char *p = t + d->vpathlv[i];
|
|
|
|
if (!IS_DIR_SEPARATOR (*p))
|
|
|
|
goto not_this_one;
|
|
|
|
|
|
|
|
/* Do not simplify $(vpath)/../whatever. ??? Might not
|
|
|
|
be necessary. */
|
|
|
|
if (p[1] == '.' && p[2] == '.' && IS_DIR_SEPARATOR (p[3]))
|
|
|
|
goto not_this_one;
|
|
|
|
|
|
|
|
/* found a match */
|
|
|
|
t = t + d->vpathlv[i] + 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
not_this_one:;
|
|
|
|
}
|
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
/* Remove leading ./ in any case. */
|
|
|
|
while (t[0] == '.' && IS_DIR_SEPARATOR (t[1]))
|
2007-01-30 16:50:00 +01:00
|
|
|
{
|
|
|
|
t += 2;
|
|
|
|
/* If we removed a leading ./, then also remove any /s after the
|
|
|
|
first. */
|
|
|
|
while (IS_DIR_SEPARATOR (t[0]))
|
|
|
|
++t;
|
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
return t;
|
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
/* Public routines. */
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
struct deps *
|
|
|
|
deps_init (void)
|
|
|
|
{
|
2005-05-28 17:52:48 +02:00
|
|
|
return XCNEW (struct deps);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_free (struct deps *d)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
|
|
|
unsigned int i;
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
2001-01-06 01:15:29 +01:00
|
|
|
if (d->targetv)
|
|
|
|
{
|
|
|
|
for (i = 0; i < d->ntargets; i++)
|
decl.c, [...]: Don't use the PTR macro.
cp:
* cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
macro.
gcc:
* bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
function.c, gcc.c, genoutput.c, gensupport.c, global.c,
haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
the PTR macro.
From-SVN: r68043
2003-06-16 23:41:10 +02:00
|
|
|
free ((void *) d->targetv[i]);
|
2001-01-06 01:15:29 +01:00
|
|
|
free (d->targetv);
|
|
|
|
}
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
2001-01-06 01:15:29 +01:00
|
|
|
if (d->depv)
|
|
|
|
{
|
|
|
|
for (i = 0; i < d->ndeps; i++)
|
decl.c, [...]: Don't use the PTR macro.
cp:
* cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
macro.
gcc:
* bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
function.c, gcc.c, genoutput.c, gensupport.c, global.c,
haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
the PTR macro.
From-SVN: r68043
2003-06-16 23:41:10 +02:00
|
|
|
free ((void *) d->depv[i]);
|
2001-01-06 01:15:29 +01:00
|
|
|
free (d->depv);
|
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
if (d->vpathv)
|
|
|
|
{
|
|
|
|
for (i = 0; i < d->nvpaths; i++)
|
|
|
|
free ((void *) d->vpathv[i]);
|
|
|
|
free (d->vpathv);
|
|
|
|
free (d->vpathlv);
|
|
|
|
}
|
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
free (d);
|
|
|
|
}
|
|
|
|
|
2001-01-05 08:50:24 +01:00
|
|
|
/* Adds a target T. We make a copy, so it need not be a permanent
|
|
|
|
string. QUOTE is true if the string should be quoted. */
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_add_target (struct deps *d, const char *t, int quote)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
|
|
|
if (d->ntargets == d->targets_size)
|
|
|
|
{
|
2001-01-06 01:15:29 +01:00
|
|
|
d->targets_size = d->targets_size * 2 + 4;
|
2005-05-28 17:52:48 +02:00
|
|
|
d->targetv = XRESIZEVEC (const char *, d->targetv, d->targets_size);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
t = apply_vpath (d, t);
|
2001-01-05 08:50:24 +01:00
|
|
|
if (quote)
|
|
|
|
t = munge (t); /* Also makes permanent copy. */
|
|
|
|
else
|
|
|
|
t = xstrdup (t);
|
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
d->targetv[d->ntargets++] = t;
|
|
|
|
}
|
|
|
|
|
2001-01-04 11:25:55 +01:00
|
|
|
/* Sets the default target if none has been given already. An empty
|
2001-01-05 08:50:24 +01:00
|
|
|
string as the default target in interpreted as stdin. The string
|
|
|
|
is quoted for MAKE. */
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_add_default_target (struct deps *d, const char *tgt)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
2001-01-04 11:25:55 +01:00
|
|
|
/* Only if we have no targets. */
|
|
|
|
if (d->ntargets)
|
|
|
|
return;
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
2001-01-04 11:25:55 +01:00
|
|
|
if (tgt[0] == '\0')
|
2001-01-05 08:50:24 +01:00
|
|
|
deps_add_target (d, "-", 1);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
else
|
2001-01-04 11:25:55 +01:00
|
|
|
{
|
2001-04-19 22:28:05 +02:00
|
|
|
#ifndef TARGET_OBJECT_SUFFIX
|
|
|
|
# define TARGET_OBJECT_SUFFIX ".o"
|
2001-01-04 11:25:55 +01:00
|
|
|
#endif
|
2001-08-03 17:42:25 +02:00
|
|
|
const char *start = lbasename (tgt);
|
2005-05-28 17:52:48 +02:00
|
|
|
char *o = (char *) alloca (strlen (start)
|
|
|
|
+ strlen (TARGET_OBJECT_SUFFIX) + 1);
|
2001-02-12 15:06:22 +01:00
|
|
|
char *suffix;
|
2001-01-04 11:25:55 +01:00
|
|
|
|
2001-02-12 15:06:22 +01:00
|
|
|
strcpy (o, start);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
2001-02-12 15:06:22 +01:00
|
|
|
suffix = strrchr (o, '.');
|
|
|
|
if (!suffix)
|
|
|
|
suffix = o + strlen (o);
|
2001-04-19 22:28:05 +02:00
|
|
|
strcpy (suffix, TARGET_OBJECT_SUFFIX);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
2001-01-05 08:50:24 +01:00
|
|
|
deps_add_target (d, o, 1);
|
2001-01-04 11:25:55 +01:00
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_add_dep (struct deps *d, const char *t)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
2004-06-05 22:58:06 +02:00
|
|
|
t = munge (apply_vpath (d, t)); /* Also makes permanent copy. */
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
if (d->ndeps == d->deps_size)
|
|
|
|
{
|
2001-01-06 12:08:49 +01:00
|
|
|
d->deps_size = d->deps_size * 2 + 8;
|
2005-05-28 17:52:48 +02:00
|
|
|
d->depv = XRESIZEVEC (const char *, d->depv, d->deps_size);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
|
|
|
d->depv[d->ndeps++] = t;
|
|
|
|
}
|
|
|
|
|
2004-06-05 22:58:06 +02:00
|
|
|
void
|
|
|
|
deps_add_vpath (struct deps *d, const char *vpath)
|
|
|
|
{
|
|
|
|
const char *elem, *p;
|
|
|
|
char *copy;
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
for (elem = vpath; *elem; elem = p)
|
|
|
|
{
|
|
|
|
for (p = elem; *p && *p != ':'; p++);
|
|
|
|
len = p - elem;
|
2005-05-28 17:52:48 +02:00
|
|
|
copy = XNEWVEC (char, len + 1);
|
2004-06-05 22:58:06 +02:00
|
|
|
memcpy (copy, elem, len);
|
|
|
|
copy[len] = '\0';
|
|
|
|
if (*p == ':')
|
|
|
|
p++;
|
|
|
|
|
|
|
|
if (d->nvpaths == d->vpaths_size)
|
|
|
|
{
|
|
|
|
d->vpaths_size = d->vpaths_size * 2 + 8;
|
2005-05-28 17:52:48 +02:00
|
|
|
d->vpathv = XRESIZEVEC (const char *, d->vpathv, d->vpaths_size);
|
|
|
|
d->vpathlv = XRESIZEVEC (size_t, d->vpathlv, d->vpaths_size);
|
2004-06-05 22:58:06 +02:00
|
|
|
}
|
|
|
|
d->vpathv[d->nvpaths] = copy;
|
|
|
|
d->vpathlv[d->nvpaths] = len;
|
|
|
|
d->nvpaths++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_write (const struct deps *d, FILE *fp, unsigned int colmax)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
|
|
|
unsigned int size, i, column;
|
|
|
|
|
|
|
|
column = 0;
|
|
|
|
if (colmax && colmax < 34)
|
|
|
|
colmax = 34;
|
|
|
|
|
|
|
|
for (i = 0; i < d->ntargets; i++)
|
|
|
|
{
|
|
|
|
size = strlen (d->targetv[i]);
|
|
|
|
column += size;
|
|
|
|
if (i)
|
|
|
|
{
|
2008-02-27 22:42:23 +01:00
|
|
|
if (colmax && column > colmax)
|
|
|
|
{
|
|
|
|
fputs (" \\\n ", fp);
|
|
|
|
column = 1 + size;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
putc (' ', fp);
|
|
|
|
column++;
|
|
|
|
}
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
}
|
|
|
|
fputs (d->targetv[i], fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
putc (':', fp);
|
2008-02-27 22:42:23 +01:00
|
|
|
column++;
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
for (i = 0; i < d->ndeps; i++)
|
|
|
|
{
|
|
|
|
size = strlen (d->depv[i]);
|
|
|
|
column += size;
|
|
|
|
if (colmax && column > colmax)
|
|
|
|
{
|
|
|
|
fputs (" \\\n ", fp);
|
|
|
|
column = 1 + size;
|
|
|
|
}
|
2008-02-27 22:42:23 +01:00
|
|
|
else
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
|
|
|
putc (' ', fp);
|
|
|
|
column++;
|
|
|
|
}
|
|
|
|
fputs (d->depv[i], fp);
|
|
|
|
}
|
|
|
|
putc ('\n', fp);
|
|
|
|
}
|
2003-07-06 11:56:09 +02:00
|
|
|
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_phony_targets (const struct deps *d, FILE *fp)
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
{
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
unsigned int i;
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
|
|
|
|
for (i = 1; i < d->ndeps; i++)
|
|
|
|
{
|
2001-01-05 08:50:24 +01:00
|
|
|
putc ('\n', fp);
|
mkdeps.c, mkdeps.h: New files.
* mkdeps.c, mkdeps.h: New files.
* po/POTFILES.in: Add them.
* Makefile.in (LIBCPP_OBJS): Add mkdeps.o.
(cpplib.o, cppinit.o): Depend on mkdeps.h.
(mkdeps.o): New target.
* cppfiles.c: Delete deps_output.
* cppinit.c: Include mkdeps.h. Delete known_suffixes,
OBJECT_SUFFIX, and base_name.
(cpp_cleanup): Use deps_free. Free ihash->name when clearing
the include hash.
(initialize_dependency_output): Use deps_init,
deps_add_target, deps_calc_target, and deps_add_dep. Remove
all the unnecessary string bashing.
(cpp_finish): Use deps_write. Remove an unnecessary nesting
level.
* cpplib.c (do_include): Use deps_add_dep.
* cpplib.h (struct cpp_reader): Replace deps_buffer,
deps_allocated_size, deps_size, deps_column members with
single pointer to a struct deps. Delete prototype of
deps_output.
From-SVN: r32329
2000-03-04 20:42:04 +01:00
|
|
|
fputs (d->depv[i], fp);
|
|
|
|
putc (':', fp);
|
|
|
|
putc ('\n', fp);
|
|
|
|
}
|
|
|
|
}
|
2003-01-10 03:22:34 +01:00
|
|
|
|
|
|
|
/* Write out a deps buffer to a file, in a form that can be read back
|
|
|
|
with deps_restore. Returns nonzero on error, in which case the
|
|
|
|
error number will be in errno. */
|
|
|
|
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_save (struct deps *deps, FILE *f)
|
2003-01-10 03:22:34 +01:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
/* The cppreader structure contains makefile dependences. Write out this
|
|
|
|
structure. */
|
|
|
|
|
|
|
|
/* The number of dependences. */
|
|
|
|
if (fwrite (&deps->ndeps, sizeof (deps->ndeps), 1, f) != 1)
|
|
|
|
return -1;
|
|
|
|
/* The length of each dependence followed by the string. */
|
|
|
|
for (i = 0; i < deps->ndeps; i++)
|
|
|
|
{
|
|
|
|
size_t num_to_write = strlen (deps->depv[i]);
|
|
|
|
if (fwrite (&num_to_write, sizeof (size_t), 1, f) != 1)
|
|
|
|
return -1;
|
|
|
|
if (fwrite (deps->depv[i], num_to_write, 1, f) != 1)
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read back dependency information written with deps_save into
|
|
|
|
the deps buffer. The third argument may be NULL, in which case
|
|
|
|
the dependency information is just skipped, or it may be a filename,
|
|
|
|
in which case that filename is skipped. */
|
|
|
|
|
|
|
|
int
|
2003-07-06 11:56:09 +02:00
|
|
|
deps_restore (struct deps *deps, FILE *fd, const char *self)
|
2003-01-10 03:22:34 +01:00
|
|
|
{
|
|
|
|
unsigned int i, count;
|
|
|
|
size_t num_to_read;
|
|
|
|
size_t buf_size = 512;
|
2012-10-15 22:08:57 +02:00
|
|
|
char *buf;
|
2003-01-10 03:22:34 +01:00
|
|
|
|
|
|
|
/* Number of dependences. */
|
|
|
|
if (fread (&count, 1, sizeof (count), fd) != sizeof (count))
|
|
|
|
return -1;
|
|
|
|
|
2012-10-15 22:08:57 +02:00
|
|
|
buf = XNEWVEC (char, buf_size);
|
|
|
|
|
2003-01-10 03:22:34 +01:00
|
|
|
/* The length of each dependence string, followed by the string. */
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
/* Read in # bytes in string. */
|
|
|
|
if (fread (&num_to_read, 1, sizeof (size_t), fd) != sizeof (size_t))
|
2012-10-15 22:08:57 +02:00
|
|
|
{
|
|
|
|
free (buf);
|
|
|
|
return -1;
|
|
|
|
}
|
2003-01-10 03:22:34 +01:00
|
|
|
if (buf_size < num_to_read + 1)
|
|
|
|
{
|
|
|
|
buf_size = num_to_read + 1 + 127;
|
2005-05-28 17:52:48 +02:00
|
|
|
buf = XRESIZEVEC (char, buf, buf_size);
|
2003-01-10 03:22:34 +01:00
|
|
|
}
|
|
|
|
if (fread (buf, 1, num_to_read, fd) != num_to_read)
|
2012-10-15 22:08:57 +02:00
|
|
|
{
|
|
|
|
free (buf);
|
|
|
|
return -1;
|
|
|
|
}
|
2003-01-10 03:22:34 +01:00
|
|
|
buf[num_to_read] = '\0';
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
/* Generate makefile dependencies from .pch if -nopch-deps. */
|
2011-03-25 20:11:26 +01:00
|
|
|
if (self != NULL && filename_cmp (buf, self) != 0)
|
2003-01-10 03:22:34 +01:00
|
|
|
deps_add_dep (deps, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
free (buf);
|
|
|
|
return 0;
|
|
|
|
}
|