This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Include facility in .md files


On Thu, 27 Sep 2001, Geoff Keating wrote:

> 
> Alan Matsuoka <alanm@cygnus.com> writes:
> 
> > The following patch is for the an internal project. This is 
> > implements a (include "filestuff") mechanism for splitting up 
> > md files.
> > 
> > (include "filestuff") expects the include file to be in gcc/config/{target}/filestuff
> > (include "BOGUS/filestuff") expects the include file to be in gcc/config/{target}/BOGUS/filestuff
> > (include "/u2/BOGUS/filestuff") expects the include file to be in /u2/BOGUS/filestuff
> > 
> > You can also run things like genrecog -I/p1/abc/proc1 -I/p2/abcd/pro2 target.md
> > 
> > This is used only at build time.
> > 
> > The DOS pathname style stuff may still need to be tweaked.
> 
> Hi Alan,
> 
> you didn't say how you tested it---even though it's not used in any
> existing port, it's still important to check it doesn't break at least
> one of them!
> 

It was bootstrapped on i686-pc-linux-gnu with no regressions.

> > 
> > 2001-08-29  Alan Matsuoka  <alanm@redhat.com>
> > 
> >         * rtl.def (INCLUDE) : Define.
> > 	* gensupport.c (init_include_reader, process_include, save_string) :  New functions to
> > 	  implement an include facility in .md files.
> > 	* gensupport.h : add prototype for init_md_reader_args
> > 	* genattr.c genattrtab.c gencodes.c genconfig.c genemit.c
> > 	  genextract.c genflags.c genopinit.c genoutput.c genpeep.c
> > 	  genrecog.c: Change call to init_md_reader to init_md_reader_args
> 
> ChangeLog entries should be full sentences, capitalised and with a
> period, like:
> 
> 	* gensupport.h: Add prototype for init_md_reader_args.

OK

> 
> [lots of OK parts of the patch removed]
> 
> > +       if (c == EOF)
> > + 	break;
> 
> There are a few places like this where the indentation is odd, is it
> possible that something mangled the whitespace in the patch?
> 

Probably my mailer.


> > +   if (IS_ABSOLUTE_PATHNAME (filename) || !stackp)
> > +     {
> > +       if (base_dir)
> > + 	{
> 
> This is another example.
> 
> > + 	  pathname = xmalloc (strlen (base_dir) + strlen (filename) + 1);
> > + 	  pathname = strcpy (pathname, base_dir);
> 
> Depending on the result of strcpy() like this is probably not portable...

OK I'll fix them.

> 
> > + 	  strcat (pathname, filename);
> > + 	  strcat (pathname, "\0");
> > + 	}
> > +       else
> > + 	pathname = xstrdup (filename);
> 
> This is really bad indentation.  It would be better to have { } around
> the last assignment to pathname.

It's the mailer again. I'll check to see what's happening. I'll bet you it's the tabbing.

> 
> [lots more basically OK parts of the patch removed]
> 
> This patch needs to add documentation, probably in rtl.texi, including
> a description of what paths are searched.

Is  it rtl.texi or tm.texi or both ? I'm in the process of generating them.

Thank's for the comments.

Alan

Alan Matsuoka
GCC Engineering
Red Hat Canada, Ltd
mailto:alanm@redhat.com Tel: (416) 482-2661 x250 / Fax: (416) 482-6299


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]