This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: new gcc front end question
- From: Philip Herron <redbrain at gcc dot gnu dot org>
- To: charfi asma <charfiasma at yahoo dot fr>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 13 Dec 2010 19:49:44 +0000
- Subject: Re: new gcc front end question
- References: <252828.45708.qm@web28515.mail.ukl.yahoo.com>
On 13 December 2010 11:33, charfi asma <charfiasma@yahoo.fr> wrote:
> Hello,
>
> I build a new gcc front end for my language called "uml",
> I do not use a parser or a lexer, I generate the GENRIC form directly from
> another tool that parse my source file "test.uml". in a txt file that I include
> in my compiler parse_file hook.
>
> void uml_parse_file (int debug_flag ATTRIBUTE_UNUSED)
> {
> .....
> #include "/export/home/charfi/test.txt";
> .....
> gimplify_function_tree(main_fn_decl);
> cgraph_node(main_fn_decl);
> cgraph_finalize_function(main_fn_decl, false);
> }my test.txt looks contains all the tree that correspond to my source file
>
> ( for example if I have int x ;
> my test.txt contains :
> tree x_tree = build_decl(BUILTINS_LOCATION, VAR_DECL, get_identifier("x"),
> integer_type_node); )
>
> this works perfectly when I compile test.uml after generating the test.txt by
> calling : guml test.uml -S -fdump-tree-all
>
> however, when I try to compile another file test2.uml that need to read
> test2.txt , I have to re make , re make install my front end. and modify the
> uml_parse_file hook to modify the name of the text file .. #include
> "/export/home/charfi/test2.txt";
>
> I can modify this langhook by recovering the name using in_fnames[0] (first
> argument of guml command)
> but I can not pass this argument to the include command that requires only
> <FILENAME> or "filename". (i,e. #include in_fnames[0] ; did not works )
>
> my question is:
>
> 1. How can I modify my front end in order to not re make and remake install each
> time I want to compile a new file (knowing that I want to keep my method that
> build the Generic form first )?
>
Hey
I feel a little confused reading that, are you in your gcc front-end
doing #include <bla> which is c-code generated from this 3rd tool
which generates the generic you want within your front-end? So
basically that means you need to re-compile your front-end every time
you want to compile a new file. I really dont understand why you would
do this approach to be honest. It means you basically have a
hard-coded input and output each time you compile your front-end.
Maybe i am missing something but i dont see why you would do this.
--Phil