diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-23 16:45:49 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-23 16:45:49 +0000 |
commit | 089179c59caa87c0c3e9e42fce87d4704ade0121 (patch) | |
tree | 4d7bd2336dc69811c6d2c705e2530c80e67ef921 | |
parent | db2f4233715de70f87ae0ba8a07d563b23fcaf3d (diff) | |
download | gcc-089179c59caa87c0c3e9e42fce87d4704ade0121.tar.gz |
2011-06-22 Pierre Vittet <piervit@pvittet.com>
* melt-runtime.c (load_melt_modules_and_do_mode): load extra
module before setting options.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@175337 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.MELT | 5 | ||||
-rw-r--r-- | gcc/melt-runtime.c | 118 |
2 files changed, 64 insertions, 59 deletions
diff --git a/gcc/ChangeLog.MELT b/gcc/ChangeLog.MELT index 9e2b6f9d508..1d02dcf9cdd 100644 --- a/gcc/ChangeLog.MELT +++ b/gcc/ChangeLog.MELT @@ -1,4 +1,9 @@ +2011-06-22 Pierre Vittet <piervit@pvittet.com> + + * melt-runtime.c (load_melt_modules_and_do_mode): load extra + module before setting options. + 2011-06-21 Pierre Vittet <piervit@pvittet.com> * melt-runtime.c (meltgc_new_split_string): Add comment. diff --git a/gcc/melt-runtime.c b/gcc/melt-runtime.c index 8d3d40844c5..6297ff5c9d5 100644 --- a/gcc/melt-runtime.c +++ b/gcc/melt-runtime.c @@ -8721,65 +8721,6 @@ load_melt_modules_and_do_mode (void) } /** - * Then we set MELT options. - **/ - MELT_LOCATION_HERE ("before setting options"); - optstr = melt_argument ("option"); - debugeprintf ("load_initial_melt_modules optstr %s", optstr); - if (optstr && optstr[0] - && (optsetv=melt_get_inisysdata (FSYSDAT_OPTION_SET)) != NULL - && melt_magic_discr ((melt_ptr_t) optsetv) == MELTOBMAG_CLOSURE) - { - char *optc = 0; - char *optname = 0; - char *optvalue = 0; - for (optc = CONST_CAST (char *, optstr); - optc && *optc; - ) - { - optname = optvalue = NULL; - if (!ISALPHA(*optc)) - melt_fatal_error ("invalid MELT option name %s [should start with letter]", - optc); - optname = optc; - while (*optc && (ISALNUM(*optc) || *optc=='_' || *optc=='-')) - optc++; - if (*optc == '=') { - *optc = (char)0; - optc++; - optvalue = optc; - while (*optc && *optc != ',') - optc++; - } - if (*optc==',') { - *optc = (char)0; - optc++; - } - optsymbv = meltgc_named_symbol (optname, MELT_CREATE); - { - union meltparam_un pararg[1]; - memset (¶rg, 0, sizeof (pararg)); - pararg[0].meltbp_cstring = optvalue; - MELT_LOCATION_HERE ("option set before apply"); - debugeprintf ("MELT option %s value %s", optname, - optvalue?optvalue:"_"); - optresv = - melt_apply ((meltclosure_ptr_t) optsetv, - (melt_ptr_t) optsymbv, - MELTBPARSTR_CSTRING, pararg, "", NULL); - if (!optresv) - warning (0, "unhandled MELT option %s", optname); - } - } - - /* after options setting, force a minor collection to ensure - nothing is left in young region */ - MELT_LOCATION_HERE ("option set done"); - melt_garbcoll (0, MELT_ONLY_MINOR); - } - MELT_LOCATION_HERE ("after setting options"); - - /** * Then we handle extra modules if given. **/ debugeprintf ("xtrastr %p %s", xtrastr, xtrastr); @@ -8845,6 +8786,65 @@ load_melt_modules_and_do_mode (void) debugeprintf ("no xtrastr %p", xtrastr); /** + * Then we set MELT options. + **/ + MELT_LOCATION_HERE ("before setting options"); + optstr = melt_argument ("option"); + debugeprintf ("load_initial_melt_modules optstr %s", optstr); + if (optstr && optstr[0] + && (optsetv=melt_get_inisysdata (FSYSDAT_OPTION_SET)) != NULL + && melt_magic_discr ((melt_ptr_t) optsetv) == MELTOBMAG_CLOSURE) + { + char *optc = 0; + char *optname = 0; + char *optvalue = 0; + for (optc = CONST_CAST (char *, optstr); + optc && *optc; + ) + { + optname = optvalue = NULL; + if (!ISALPHA(*optc)) + melt_fatal_error ("invalid MELT option name %s [should start with letter]", + optc); + optname = optc; + while (*optc && (ISALNUM(*optc) || *optc=='_' || *optc=='-')) + optc++; + if (*optc == '=') { + *optc = (char)0; + optc++; + optvalue = optc; + while (*optc && *optc != ',') + optc++; + } + if (*optc==',') { + *optc = (char)0; + optc++; + } + optsymbv = meltgc_named_symbol (optname, MELT_CREATE); + { + union meltparam_un pararg[1]; + memset (¶rg, 0, sizeof (pararg)); + pararg[0].meltbp_cstring = optvalue; + MELT_LOCATION_HERE ("option set before apply"); + debugeprintf ("MELT option %s value %s", optname, + optvalue?optvalue:"_"); + optresv = + melt_apply ((meltclosure_ptr_t) optsetv, + (melt_ptr_t) optsymbv, + MELTBPARSTR_CSTRING, pararg, "", NULL); + if (!optresv) + warning (0, "unhandled MELT option %s", optname); + } + } + + /* after options setting, force a minor collection to ensure + nothing is left in young region */ + MELT_LOCATION_HERE ("option set done"); + melt_garbcoll (0, MELT_ONLY_MINOR); + } + MELT_LOCATION_HERE ("after setting options"); + + /** * then we do the mode if needed **/ if (melt_get_inisysdata (FSYSDAT_MODE_DICT) && modstr |