front-end: compilation fails - how to fix 'use poisoned USE_MAPPED_LOCATION'

2008-09-07 Thread Lemaitre Laurent-R29173
Hi All,
I am building a new gcc front-end based on the treelang example.
I recently updated my gcc local SVN repository.
When I compile my front-end I get the following errors:
../../svn/gcc/laurent/lex.l:6:8: error: attempt to use poisoned
"USE_MAPPED_LOCATION"
../../svn/gcc/laurent/lex.l:26:8: error: attempt to use poisoned
"USE_MAPPED_LOCATION"
../../svn/gcc/laurent/lex.l: In function 'update_locus':
../../svn/gcc/laurent/lex.l:42: error: lvalue required as left operand
of assignment
../../svn/gcc/laurent/lex.l:60:11: error: attempt to use poisoned
"USE_MAPPED_LOCATION"
I used to refer to the treelang example in order to adapt my front-end
and make
it compile with the latest SVN version of gcc.
However I just found out that treelang is no more maintained (since a
few months).
Is-there a good (wiki) place where I can get some info on how to fix my
issue with 
USE_MAPPED_LOCATION?
Thanks for your help!
Laurent 


front-end: can I remove 'dummy' extra code - keep front-end coding very simple

2008-09-11 Thread Lemaitre Laurent-R29173
Hi Tom,
Thanks for your help.
Now my front-end (so far based on treelang) parses fine and I can run
some simple examples.
I am trying to keep it as simple as possible.
Any idea why the following declarations are required:
#include "diagnostic.h"
#include "convert.h"
tree convert (tree type ATTRIBUTE_UNUSED, tree expr ATTRIBUTE_UNUSED)
{return error_mark_node;}
/*libbackend.a(gtype-desc.o): In function `gt_pch_nx_function':*/
void gt_ggc_mx_language_function (ATTRIBUTE_UNUSED void *x_p) { }
void gt_pch_nx_language_function (ATTRIBUTE_UNUSED void *x_p) { }
void gt_ggc_mx_lang_tree_node (ATTRIBUTE_UNUSED void *x_p) { }
void gt_pch_nx_lang_tree_node (ATTRIBUTE_UNUSED void *x_p) { }
/*required in libbackend.a(ggc-common.o): In function `ggc_mark_roots'*/
const struct ggc_root_tab * const gt_ggc_deletable_rtab[] = { NULL };
const struct ggc_root_tab * const gt_ggc_rtab[] = { NULL };
const struct ggc_root_tab * const gt_pch_scalar_rtab[] = { NULL };
const struct ggc_root_tab * const gt_pch_cache_rtab[] = { NULL };
const struct ggc_cache_tab * const gt_ggc_cache_rtab[] = { NULL };

Thanks,
Laurent

> -Original Message-
> From: Tom Tromey [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, September 07, 2008 5:45 PM
> To: Lemaitre Laurent-R29173
> Cc: gcc@gcc.gnu.org
> Subject: Re: front-end: compilation fails - how to fix 'use 
> poisoned USE_MAPPED_LOCATION'
> 
> >>>>> "Laurent" == Lemaitre Laurent-R29173 
> <[EMAIL PROTECTED]> writes:
> 
> Laurent> Is-there a good (wiki) place where I can get some info on how
> Laurent> to fix my issue with USE_MAPPED_LOCATION?
> 
> USE_MAPPED_LOCATION was removed.  Only mapped locations remain.
> So, you can fix your issue by removing the not-mapped code.
> 
> Tom
> 


treelang: can we replace 'unsigned char *chars' by 'char *chars'?

2007-08-15 Thread Lemaitre Laurent-r29173
Hi All,

In file treelang.h structure token_part is defined as follows:
struct token_part GTY(())
{
  location_t location;
  unsigned int charno;
  unsigned int length; /* The value.  */
  const unsigned char *chars;  <-- HERE
};

'unsigned char *chars' is used instead of just 'char *chars'.
Is-there any reason (speed, memory) why 'unsigned' is used?

I am building an autogenerated version of 'treelang' and I am trying
to generate directly 'tree' node in file parse.y. That
is the reasoin why I am asking.

Thanks,

Laurent