This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gsoc2015] Is Gimple FE eligible for gsoc this year?
- From: Trevor Saunders <tbsaunde at tbsaunde dot org>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 22 Mar 2015 03:00:55 -0400
- Subject: Re: [gsoc2015] Is Gimple FE eligible for gsoc this year?
- Authentication-results: sourceware.org; auth=none
- References: <BLU437-SMTP924BE38545D1FC0F43C1F485000 at phx dot gbl> <CAD_=9DQy5CYZqzCbZTA0=quGBk2xLsiC1M=DJd1xdib8yQT6Cg at mail dot gmail dot com> <BLU436-SMTP473D7ECF26024D76C7370985000 at phx dot gbl> <20150319035737 dot GA8662 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <BLU436-SMTP216700B45A5B1355CBDAEA485010 at phx dot gbl> <20150319173621 dot GA21536 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <BLU436-SMTP2350E4A76211FC73B1DF97E850C0 at phx dot gbl>
On Sun, Mar 22, 2015 at 02:36:31PM +0800, xue yinsong wrote:
> I add the following code in parser.c to replace htab:
>
> â
> struct gimple_symtab_hasher : ggc_cache_hasher<struct gimple_symtab_entry_def *>
> {
> /* Return the hash value of the declaration name of a gimple_symtab_entry_def
> object pointed by ENTRY. */
> static hashval_t hash(struct gimple_symtab_entry_def *base){return IDENTIFIER_HASH_VALUE(base->id);}
> /* Returns non-zero if ENTRY1 and ENTRY2 point to gimple_symtab_entry_def
> objects corresponding to the same declaration. */
> static bool equal (const struct gimple_symtab_entry_def *base1, const struct gimple_symtab_entry_def *base2){return base1->id == base2->id;}
> static void
> handle_cache_entry(struct gimple_symtab_entry_def *&m)
> {
> extern void gt_ggc_mx (struct gimple_symtab_entry_def *&);
> if (m == HTAB_EMPTY_ENTRY || m == HTAB_DELETED_ENTRY)
> return;
> else if (ggc_marked_p (m->id))
> gt_ggc_mx (m);
> else
> m = static_cast<struct gimple_symtab_entry_def *> (HTAB_DELETED_ENTRY);
> }
> };
>
> /* Gimple symbol table. */
> static GTY((cache)) hash_table<gimple_symtab_hasher> *gimple_symtab;
> â
>
> But I got undefined symbols when compiling it:
> â
> Undefined symbols for architecture x86_64:
> "gt_ggc_mx(gimple_symtab_entry_def*&)", referenced from:
> gt_clear_caches_gt_gimple_parser_h() in parser.o
> "gt_pch_nx(gimple_symtab_entry_def*&)", referenced from:
> gt_pch_nx_hash_table_gimple_symtab_hasher_(void*) in parser.o
> "_c_global_trees", referenced from:
> gimple_main() in parser.o
> ld: symbol(s) not found for architecture x86_64
> collect2: error: ld returned 1 exit status
> make[3]: *** [gimple1] Error 1
> make[2]: *** [all-stage2-gcc] Error 2
> make[1]: *** [stage2-bubble] Error 2
> make: *** [all] Error 2
>
> Could someone tell me how to fix this?
I believe making the GTY marker for gimple_symtab_entry_def GTY
((for_user)) will cause gengtype to generate the needed marking routines
and so fix the link error.
Trev
>
>
>
> â
> Regards,
> Yinsong
> >
>