#endif
-static const OptFunc
-opt_funcs [sizeof (int) * 8] = {
- NULL
-};
-
#ifdef __native_client__
extern char *nacl_mono_path;
#endif
{
guint32 exclude = 0;
const char *n;
- int i, invert, len;
+ int i, invert;
+ char **parts, **ptr;
/* Initialize the hwcap module if necessary. */
mono_hwcap_init ();
if (!p)
return opt;
- while (*p) {
+ parts = g_strsplit (p, ",", -1);
+ for (ptr = parts; ptr && *ptr; ptr ++) {
+ char *arg = *ptr;
+ char *p = arg;
+
if (*p == '-') {
p++;
invert = TRUE;
}
for (i = 0; i < G_N_ELEMENTS (opt_names) && optflag_get_name (i); ++i) {
n = optflag_get_name (i);
- len = strlen (n);
- if (strncmp (p, n, len) == 0) {
+ if (!strcmp (p, n)) {
if (invert)
opt &= ~ (1 << i);
else
opt |= 1 << i;
- p += len;
- if (*p == ',') {
- p++;
- break;
- } else if (*p == '=') {
- p++;
- if (opt_funcs [i])
- opt_funcs [i] (p);
- while (*p && *p++ != ',');
- break;
- }
- /* error out */
break;
}
}
opt = 0;
else
opt = ~(EXCLUDED_FROM_ALL | exclude);
- p += 3;
- if (*p == ',')
- p++;
} else {
fprintf (stderr, "Invalid optimization name `%s'\n", p);
exit (1);
}
}
+
+ g_free (arg);
}
+ g_free (parts);
+
return opt;
}
OPTFLAG(SSAPRE ,19, "ssapre", "SSA based Partial Redundancy Elimination (obsolete)")
OPTFLAG(EXCEPTION,20, "exception", "Optimize exception catch blocks")
OPTFLAG(SSA ,21, "ssa", "Use plain SSA form")
+OPTFLAG(FLOAT32 ,22, "float32", "Use 32 bit float arithmetic if possible")
OPTFLAG(SSE2 ,23, "sse2", "SSE2 instructions on x86")
-/* The id has to be smaller than gshared's, the parser code depends on this */
OPTFLAG(GSHAREDVT,24, "gsharedvt", "Generic sharing for valuetypes")
-OPTFLAG (GSHARED, 25, "gshared", "Generic Sharing")
+OPTFLAG (GSHARED, 25, "gshared", "Generic Sharing")
OPTFLAG(SIMD ,26, "simd", "Simd intrinsics")
OPTFLAG(UNSAFE ,27, "unsafe", "Remove bound checks and perform other dangerous changes")
OPTFLAG(ALIAS_ANALYSIS ,28, "alias-analysis", "Alias analysis of locals")
-OPTFLAG(FLOAT32 ,29, "float32", "Use 32 bit float arithmetic if possible")
-