Hi Sylvestre, I agree with this change, too many people still believe that -O20 will give them 7x better code than -O3... sigh...
Some comments below: On 8 November 2013 06:05, Sylvestre Ledru <[email protected]> wrote: > unsigned OptLevel = getOptimizationLevel(Args, IK, Diags); > if (OptLevel > 3) { > - Diags.Report(diag::err_drv_invalid_value) > - << Args.getLastArg(OPT_O)->getAsString(Args) << OptLevel; > - OptLevel = 3; > - Success = false; > + unsigned DefaultOptLevel = 3; > + Diags.Report(diag::warn_drv_invalid_value) > + << Args.getLastArg(OPT_O)->getAsString(Args) << OptLevel << > DefaultOptLevel; > + OptLevel = DefaultOptLevel; > } > Opts.OptimizationLevel = OptLevel; > This seems slightly redundant. Either you use literal 3 all over, or set the DefaultOptLevel on a higher place. Also, this is not the "default" level, but the fall-back level for high levels, maybe a better word would be "MaxOptLevel", if there isn't one already (I don't know). If there isn't, than maybe you could create a MaxOptLevel on a higher level and change all comparisons "OptLevel > 3" for "OptLevel > MaxOptLevel". cheers, --renato
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
