aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBasile Starynkevitch <basile@starynkevitch.net>2009-09-23 22:59:02 +0000
committerRafael Espindola <espindola@gcc.gnu.org>2009-09-23 22:59:02 +0000
commit9f78bf054129295c88572293f71941bd66e99b2e (patch)
tree39991adff191d396d120729174020451da5a9f25 /gcc
parent2b4fa409a97f9d398698dff291e4e7176747d6b4 (diff)
downloadgcc-9f78bf054129295c88572293f71941bd66e99b2e.zip
gcc-9f78bf054129295c88572293f71941bd66e99b2e.tar.gz
gcc-9f78bf054129295c88572293f71941bd66e99b2e.tar.bz2
gengtype.c (nb_plugin_files): Make it unsigned to match num_gt_files.
2009-09-23 Basile Starynkevitch <basile@starynkevitch.net> Rafael Avila de Espindola <espindola@google.com> * gengtype.c (nb_plugin_files): Make it unsigned to match num_gt_files. Adjust other variables to avoid warnings. (main): Allocate an all zero lang_bitmap before each plugin file name to match regular file names. Co-Authored-By: Rafael Avila de Espindola <espindola@google.com> From-SVN: r152106
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gengtype.c25
2 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 862f4bf..4c21097 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-23 Basile Starynkevitch <basile@starynkevitch.net>
+ Rafael Avila de Espindola <espindola@google.com>
+
+ * gengtype.c (nb_plugin_files): Make it unsigned to match
+ num_gt_files. Adjust other variables to avoid warnings.
+ (main): Allocate an all zero lang_bitmap before each plugin file name
+ to match regular file names.
+
2009-09-23 Richard Henderson <rth@redhat.com>
* doc/tm.texi (STATIC_CHAIN, STATIC_CHAIN_INCOMING): Remove.
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 7d7f9d1..26c7958 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -144,7 +144,7 @@ static outf_p output_files;
corresponding gt-<plugin>.h are generated in the current
directory. */
static char** plugin_files;
-static int nb_plugin_files;
+static size_t nb_plugin_files;
/* The output header file that is included into pretty much every
source file. */
@@ -464,7 +464,7 @@ read_input_list (const char *listname)
/* Add the plugin files if provided. */
if (plugin_files)
{
- int i;
+ size_t i;
for (i = 0; i < nb_plugin_files; i++)
gt_files[nfiles++] = plugin_files[i];
}
@@ -1716,7 +1716,8 @@ get_output_file_with_visibility (const char *input_file)
plugin_files. */
if (plugin_files && nb_plugin_files > 0)
{
- int ix= -1, i;
+ int ix= -1;
+ size_t i;
for (i = 0; i < nb_plugin_files && ix < 0; i++)
if (strcmp (input_file, plugin_files[i]) == 0)
ix = i;
@@ -3657,8 +3658,17 @@ main (int argc, char **argv)
{
srcdir = argv[2];
inputlist = argv[3];
- plugin_files = argv+4;
nb_plugin_files = argc-4;
+ plugin_files = XCNEWVEC (char *, nb_plugin_files);
+ for (i = 0; i < nb_plugin_files; i++)
+ {
+ /* Place an all zero lang_bitmap before the plugin file
+ name. */
+ char *name = argv[i + 4];
+ int len = strlen(name) + 1 + sizeof (lang_bitmap);
+ plugin_files[i] = XCNEWVEC (char, len) + sizeof (lang_bitmap);
+ strcpy (plugin_files[i], name);
+ }
}
else if (argc == 3)
{
@@ -3709,6 +3719,13 @@ main (int argc, char **argv)
write_rtx_next ();
close_output_files ();
+ if (plugin_files)
+ {
+ for (i = 0; i < nb_plugin_files; i++)
+ free (plugin_files[i] - sizeof (lang_bitmap));
+ free (plugin_files);
+ }
+
if (hit_error)
return 1;
return 0;