This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gimplefe] Parsing __GIMPLE function body
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>, Prasad Ghangal <prasad dot ghangal at gmail dot com>
- Cc: gcc Mailing List <gcc at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Wed, 01 Jun 2016 09:16:42 -0400
- Subject: Re: [gimplefe] Parsing __GIMPLE function body
- Authentication-results: sourceware.org; auth=none
- References: <CAE+uiWYTNOnK-MWB8qicpVU9aO-ZX0praDmTyzO4ipv=UqBrwA at mail dot gmail dot com> <CAAgBjMnQikO8UhNMDnEd5POm4CuWeWomCWf5ohAHkNE79yV8XQ at mail dot gmail dot com>
On Wed, 2016-06-01 at 12:49 +0530, Prathamesh Kulkarni wrote:
> On 30 May 2016 at 20:45, Prasad Ghangal <prasad.ghangal@gmail.com>
> wrote:
> > Hi,
> >
> > As David suggested in his rtlfe patch,
> > this patch recognizes __GIMPLE keyword and switches to
> > c_parser_parse_gimple_body by providing -fgimple option.
> >
[snip]
> >
> > +/* Parse the body of a function declaration marked with
> > "__GIMPLE". */
> > +
> > +void
> > +c_parser_parse_gimple_body (c_parser *parser)
> > +{
> > + if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected
> > %<{%>"))
> > + return;
> > +
> > + location_t loc1 = c_parser_peek_token (parser)->location;
> > + inform (loc1, "start of GIMPLE");
> > +
> > + while (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE))
> Could this possibly go into infinite loop if '}' is not present in
> the source ?
Given that right now all it does is consume the input without doing
anything with it, that's hardly a problem ;) I'm sure that as Prasad
expands this function to actually parse statements that he'll handle
this case (an explicit test case for it would be appropriate).
> Thanks,
> Prathamesh
> > + {
> > + c_parser_consume_token (parser);
> > + }
> > +
> > + c_parser_consume_token (parser);
> > +}
> > +
[snip]