diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-29 06:47:51 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-29 06:47:51 +0000 |
commit | 7f1c23c2e7981438c251121d85cf5d807b9a4f5d (patch) | |
tree | 9f3ca7251d38ea1a8534f97eeddbcb3d47f04fa5 | |
parent | 548b9a28ab604faba91e9edef26d662ea5f8f422 (diff) | |
download | gcc-7f1c23c2e7981438c251121d85cf5d807b9a4f5d.tar.gz |
2008-07-28 Basile Starynkevitch <basile@starynkevitch.net>
[added successfully location_t in MELT parsing & error reports]
* gcc/basilys.h: basilys_dynobjstruct_fieldoffset_at &
basilys_dynobjstruct_classlength_at are always declared.
* gcc/basilys.c:
(basilys_error_str, basilys_warning_str)
(basilys_inform_str) added casts.
(basilysgc_read_file) calling linemap_add on the complete MELT
source path.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@138230 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.melt | 12 | ||||
-rw-r--r-- | gcc/basilys.c | 69 | ||||
-rw-r--r-- | gcc/basilys.h | 3 |
3 files changed, 48 insertions, 36 deletions
diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt index 6d5be4ca538..d3cf69bd6a2 100644 --- a/gcc/ChangeLog.melt +++ b/gcc/ChangeLog.melt @@ -1,3 +1,15 @@ +2008-07-28 Basile Starynkevitch <basile@starynkevitch.net> + [added successfully location_t in MELT parsing & error reports] + + * basilys.h: basilys_dynobjstruct_fieldoffset_at & + basilys_dynobjstruct_classlength_at are always declared. + + * basilys.c: + (basilys_error_str, basilys_warning_str) + (basilys_inform_str) added casts. + (basilysgc_read_file) calling linemap_add on the complete MELT + source path. + 2008-07-27 Basile Starynkevitch <basile@starynkevitch.net> [adding location_t in MELT parsing & error reports] diff --git a/gcc/basilys.c b/gcc/basilys.c index 38e0e2dc846..6068bfb409d 100644 --- a/gcc/basilys.c +++ b/gcc/basilys.c @@ -1011,7 +1011,8 @@ forwarded_copy (basilys_ptr_t p) dst->entab = (struct entrybasicblocksbasilys_st *) ggc_alloc_cleared (siz * sizeof - (dst->entab + (dst-> + entab [0])); memcpy (dst->entab, src->entab, siz * sizeof (dst->entab[0])); } @@ -1468,15 +1469,15 @@ unsafe_index_mapobject (struct entryobjectsbasilys_st *tab, samehashcnt, (void *) attr, attr->obj_serial, (void *) curat, curat->obj_serial, curat->obj_hash, (void *) curat->obj_class, - basilys_string_str (curat->obj_class-> - obj_vartab[FNAMED_NAME])); + basilys_string_str (curat-> + obj_class->obj_vartab[FNAMED_NAME])); if (basilys_is_instance_of ((basilys_ptr_t) attr, (basilys_ptr_t) BASILYSGOB (CLASS_NAMED))) dbgprintf ("gotten attr named %s found attr named %s", basilys_string_str (attr->obj_vartab[FNAMED_NAME]), - basilys_string_str (curat-> - obj_vartab[FNAMED_NAME])); + basilys_string_str (curat->obj_vartab + [FNAMED_NAME])); basilys_dbgshortbacktrace ("gotten & found attr of same hash & class", 15); } @@ -1513,15 +1514,15 @@ unsafe_index_mapobject (struct entryobjectsbasilys_st *tab, samehashcnt, (void *) attr, attr->obj_serial, (void *) curat, curat->obj_serial, curat->obj_hash, (void *) curat->obj_class, - basilys_string_str (curat->obj_class-> - obj_vartab[FNAMED_NAME])); + basilys_string_str (curat-> + obj_class->obj_vartab[FNAMED_NAME])); if (basilys_is_instance_of ((basilys_ptr_t) attr, (basilys_ptr_t) BASILYSGOB (CLASS_NAMED))) dbgprintf ("gotten attr named %s found attr named %s", basilys_string_str (attr->obj_vartab[FNAMED_NAME]), - basilys_string_str (curat-> - obj_vartab[FNAMED_NAME])); + basilys_string_str (curat->obj_vartab + [FNAMED_NAME])); basilys_dbgshortbacktrace ("gotten & found attr of same hash & class", 15); } @@ -5146,8 +5147,6 @@ makesexpr (struct reading_st *rd, int lineno, basilys_ptr_t contents_p, #define locmixv curfram__.varptr[2] contsv = contents_p; gcc_assert (basilys_magic_discr ((basilys_ptr_t) contsv) == OBMAG_LIST); - loc = 0; -#warning loc temporarily cleared to ease compilation of melt-generated stuff if (loc == 0) locmixv = basilysgc_new_mixint (BASILYSGOB (DISCR_MIXEDINT), *rd->rpfilnam, (long) lineno); @@ -5955,15 +5954,15 @@ basilys_error_str (basilys_ptr_t mixloc_p, const char *msg, mixmag = basilys_magic_discr ((basilys_ptr_t) mixlocv); if (mixmag == OBMAG_MIXLOC) { - loc = basilys_location_mixloc (mixlocv); - finamv = basilys_val_mixloc (mixlocv); - lineno = basilys_num_mixloc (mixlocv); + loc = basilys_location_mixloc ((basilys_ptr_t) mixlocv); + finamv = basilys_val_mixloc ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixloc ((basilys_ptr_t) mixlocv); } else if (mixmag == OBMAG_MIXINT) { loc = 0; - finamv = basilys_val_mixint (mixlocv); - lineno = basilys_num_mixint (mixlocv); + finamv = basilys_val_mixint ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixint ((basilys_ptr_t) mixlocv); } else { @@ -5973,7 +5972,7 @@ basilys_error_str (basilys_ptr_t mixloc_p, const char *msg, } if (loc) { - char *cstr = basilys_string_str (strv); + char *cstr = basilys_string_str ((basilys_ptr_t) strv); if (cstr) error ("%H.Basilys Error[#%ld]: %s - %s", &loc, basilys_dbgcounter, msg, cstr); @@ -6027,15 +6026,15 @@ basilys_warning_str (int opt, basilys_ptr_t mixloc_p, const char *msg, mixmag = basilys_magic_discr ((basilys_ptr_t) mixlocv); if (mixmag == OBMAG_MIXLOC) { - loc = basilys_location_mixloc (mixlocv); - finamv = basilys_val_mixloc (mixlocv); - lineno = basilys_num_mixloc (mixlocv); + loc = basilys_location_mixloc ((basilys_ptr_t) mixlocv); + finamv = basilys_val_mixloc ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixloc ((basilys_ptr_t) mixlocv); } else if (mixmag == OBMAG_MIXINT) { loc = 0; - finamv = basilys_val_mixint (mixlocv); - lineno = basilys_num_mixint (mixlocv); + finamv = basilys_val_mixint ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixint ((basilys_ptr_t) mixlocv); } else { @@ -6055,8 +6054,8 @@ basilys_warning_str (int opt, basilys_ptr_t mixloc_p, const char *msg, } else { - char *cfilnam = basilys_string_str (finamv); - char *cstr = basilys_string_str (strv); + char *cfilnam = basilys_string_str ((basilys_ptr_t) finamv); + char *cstr = basilys_string_str ((basilys_ptr_t) strv); if (cfilnam) { if (cstr) @@ -6102,15 +6101,15 @@ basilys_inform_str (basilys_ptr_t mixloc_p, const char *msg, mixmag = basilys_magic_discr ((basilys_ptr_t) mixlocv); if (mixmag == OBMAG_MIXLOC) { - loc = basilys_location_mixloc (mixlocv); - finamv = basilys_val_mixloc (mixlocv); - lineno = basilys_num_mixloc (mixlocv); + loc = basilys_location_mixloc ((basilys_ptr_t) mixlocv); + finamv = basilys_val_mixloc ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixloc ((basilys_ptr_t) mixlocv); } else if (mixmag == OBMAG_MIXINT) { loc = 0; - finamv = basilys_val_mixint (mixlocv); - lineno = basilys_num_mixint (mixlocv); + finamv = basilys_val_mixint ((basilys_ptr_t) mixlocv); + lineno = basilys_num_mixint ((basilys_ptr_t) mixlocv); } else { @@ -6120,7 +6119,7 @@ basilys_inform_str (basilys_ptr_t mixloc_p, const char *msg, } if (loc) { - char *cstr = basilys_string_str (strv); + char *cstr = basilys_string_str ((basilys_ptr_t) strv); if (cstr) inform ("%H.Basilys Inform[#%ld]: %s - %s", &loc, basilys_dbgcounter, msg, cstr); @@ -6129,8 +6128,8 @@ basilys_inform_str (basilys_ptr_t mixloc_p, const char *msg, } else { - char *cfilnam = basilys_string_str (finamv); - char *cstr = basilys_string_str (strv); + char *cfilnam = basilys_string_str ((basilys_ptr_t) finamv); + char *cstr = basilys_string_str ((basilys_ptr_t) strv); if (cfilnam) { if (cstr) @@ -6165,7 +6164,7 @@ basilysgc_read_file (const char *filnam, const char *locnam) struct reading_st rds; FILE *fil = 0; struct reading_st *rd = 0; - char *locnamdup = 0; + char *filnamdup = 0; BASILYS_ENTERFRAME (4, NULL); #define genv curfram__.varptr[0] #define valv curfram__.varptr[1] @@ -6176,7 +6175,7 @@ basilysgc_read_file (const char *filnam, const char *locnam) goto end; if (!locnam || !locnam[0]) locnam = basename (filnam); - locnamdup = xstrdup (locnam); /* locnamdup is never freed */ + filnamdup = xstrdup (filnam); /* filnamdup is never freed */ debugeprintf ("basilysgc_read_file filnam %s locnam %s", filnam, locnam); fil = fopen (filnam, "rt"); if (!fil) @@ -6185,7 +6184,7 @@ basilysgc_read_file (const char *filnam, const char *locnam) rds.rfil = fil; rds.rpath = filnam; rds.rlineno = 0; - linemap_add (line_table, LC_RENAME, false, locnamdup, 0); + linemap_add (line_table, LC_RENAME, false, filnamdup, 0); rd = &rds; locnamv = basilysgc_new_stringdup (BASILYSGOB (DISCR_STRING), locnam); rds.rpfilnam = (basilys_ptr_t *) & locnamv; diff --git a/gcc/basilys.h b/gcc/basilys.h index c05a937a09d..3bcb48e7e77 100644 --- a/gcc/basilys.h +++ b/gcc/basilys.h @@ -1382,10 +1382,11 @@ void basilys_error_str(basilys_ptr_t mixloc_p, const char* msg, basilys_ptr_t st void basilys_warning_str(int opt, basilys_ptr_t mixloc_p, const char* msg, basilys_ptr_t str_p); void basilys_inform_str(basilys_ptr_t mixloc_p, const char* msg, basilys_ptr_t str_p); -#if MELTGCC_DYNAMIC_OBJSTRUCT int* basilys_dynobjstruct_fieldoffset_at(const char*fldnam, const char*fil, int lin); int* basilys_dynobjstruct_classlength_at(const char*clanam, const char* fil, int lin); +#if MELTGCC_DYNAMIC_OBJSTRUCT + static inline basilys_ptr_t basilys_dynobjstruct_getfield_object_at (basilys_ptr_t ob, unsigned off, const char*fldnam, const char*fil, int lin, int**poff) { |