private static IParsingService GetParser(OptionSet options) { var lang = options.GetValue <string>(Options.InputLanguage); switch (lang.ToLowerInvariant()) { case "ecs": return(EcsLanguageService.Value); case "les": return(LesLanguageService.Value); case "les2": return(Les2LanguageService.Value); case "les3": return(Les3LanguageService.Value); default: Log.Log( new LogEntry( Pixie.Severity.Error, "unknown input language", "input language ", Quotation.CreateBoldQuotation(lang), " could not be matched to a known input language.", new Paragraph("Option usage:"), new Paragraph( new OptionHelp( Options.InputLanguage, GnuOptionPrinter.Instance)))); return(EcsLanguageService.Value); } }
private static void PrintIr( ClrMethodDefinition method, MethodBody sourceBody, MethodBody optBody) { var sourceIr = FormatIr(sourceBody); var optIr = FormatIr(optBody); log.Log( new LogEntry( Severity.Message, "method body IR", "optimized Flame IR for ", Quotation.CreateBoldQuotation(method.FullName.ToString()), ": ", new Paragraph(new WrapBox(optIr, 0, -optIr.Length)), CreateRemark( "unoptimized Flame IR:", new Paragraph(new WrapBox(sourceIr, 0, -sourceIr.Length))))); }