Home | History | Annotate | Download | only in Frontend

Lines Matching refs:Args

72 // Deserialization (from args)
81 static unsigned getOptimizationLevel(ArgList &Args, InputKind IK,
84 if (IK == IK_OpenCL && !Args.hasArg(OPT_cl_opt_disable))
87 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
100 return getLastArgIntValue(Args, OPT_O, DefaultOpt, Diags);
106 static unsigned getOptimizationLevelSize(ArgList &Args) {
107 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
122 static void addDiagnosticArgs(ArgList &Args, OptSpecifier Group,
125 for (Arg *A : Args.filtered(Group)) {
141 static void getAllNoBuiltinFuncValues(ArgList &Args,
144 for (const auto &Arg : Args) {
155 static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
159 if (Arg *A = Args.getLastArg(OPT_analyzer_store)) {
168 << A->getAsString(Args) << Name;
175 if (Arg *A = Args.getLastArg(OPT_analyzer_constraints)) {
184 << A->getAsString(Args) << Name;
191 if (Arg *A = Args.getLastArg(OPT_analyzer_output)) {
200 << A->getAsString(Args) << Name;
207 if (Arg *A = Args.getLastArg(OPT_analyzer_purge)) {
216 << A->getAsString(Args) << Name;
223 if (Arg *A = Args.getLastArg(OPT_analyzer_inlining_mode)) {
232 << A->getAsString(Args) << Name;
239 Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help);
240 Opts.DisableAllChecks = Args.hasArg(OPT_analyzer_disable_all_checks);
243 Args.hasArg(OPT_analyzer_viz_egraph_graphviz);
245 Args.hasArg(OPT_analyzer_viz_egraph_ubigraph);
246 Opts.NoRetryExhausted = Args.hasArg(OPT_analyzer_disable_retry_exhausted);
247 Opts.AnalyzeAll = Args.hasArg(OPT_analyzer_opt_analyze_headers);
248 Opts.AnalyzerDisplayProgress = Args.hasArg(OPT_analyzer_display_progress);
250 Args.hasArg(OPT_analyzer_opt_analyze_nested_blocks);
251 Opts.eagerlyAssumeBinOpBifurcation = Args.hasArg(OPT_analyzer_eagerly_assume);
252 Opts.AnalyzeSpecificFunction = Args.getLastArgValue(OPT_analyze_function);
253 Opts.UnoptimizedCFG = Args.hasArg(OPT_analysis_UnoptimizedCFG);
254 Opts.TrimGraph = Args.hasArg(OPT_trim_egraph);
256 getLastArgIntValue(Args, OPT_analyzer_max_loop, 4, Diags);
257 Opts.PrintStats = Args.hasArg(OPT_analyzer_stats);
259 getLastArgIntValue(Args, OPT_analyzer_inline_max_stack_depth,
264 Args.filtered(OPT_analyzer_checker, OPT_analyzer_disable_checker)) {
277 for (const Arg *A : Args.filtered(OPT_analyzer_config)) {
307 static bool ParseMigratorArgs(MigratorOptions &Opts, ArgList &Args) {
308 Opts.NoNSAllocReallocError = Args.hasArg(OPT_migrator_no_nsalloc_error);
309 Opts.NoFinalizeRemoval = Args.hasArg(OPT_migrator_no_finalize_removal);
313 static void ParseCommentArgs(CommentOptions &Opts, ArgList &Args) {
314 Opts.BlockCommandNames = Args.getAllArgValues(OPT_fcomment_block_commands);
315 Opts.ParseAllComments = Args.hasArg(OPT_fparse_all_comments);
318 static StringRef getCodeModel(ArgList &Args, DiagnosticsEngine &Diags) {
319 if (Arg *A = Args.getLastArg(OPT_mcode_model)) {
324 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Value;
332 GenerateOptimizationRemarkRegex(DiagnosticsEngine &Diags, ArgList &Args,
339 << RegexError << RpassArg->getAsString(Args);
381 static void setPGOInstrumentor(CodeGenOptions &Opts, ArgList &Args,
383 Arg *A = Args.getLastArg(OPT_fprofile_instrument_EQ);
393 Diags.Report(diag::err_drv_invalid_pgo_instrumentor) << A->getAsString(Args)
420 static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
427 unsigned OptimizationLevel = getOptimizationLevel(Args, IK, Diags);
434 << Args.getLastArg(OPT_O)->getAsString(Args) << "-O" << MaxOptLevel;
444 Opts.NoInline = Args.hasArg(OPT_fno_inline);
445 if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions,
457 if (Arg *A = Args.getLastArg(OPT_fveclib)) {
464 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
467 if (Arg *A = Args.getLastArg(OPT_debug_info_kind_EQ)) {
475 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
480 if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) {
487 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
492 Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags);
493 Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
494 Opts.EmitCodeView = Args.hasArg(OPT_gcodeview);
495 Opts.WholeProgramVTables = Args.hasArg(OPT_fwhole_program_vtables);
496 Opts.LTOVisibilityPublicStd = Args.hasArg(OPT_flto_visibility_public_std);
497 Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
498 Opts.DebugTypeExtRefs = Args.hasArg(OPT_dwarf_ext_refs);
501 for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ))
505 Args.getLastArg(OPT_emit_llvm_uselists, OPT_no_emit_llvm_uselists))
508 Opts.DisableLLVMOpts = Args.hasArg(OPT_disable_llvm_optzns);
509 Opts.DisableLLVMPasses = Args.hasArg(OPT_disable_llvm_passes);
510 Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone);
511 Opts.ForbidGuardVariables = Args.hasArg(OPT_fforbid_guard_variables);
512 Opts.UseRegisterSizedBitfieldAccess = Args.hasArg(
514 Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing);
515 Opts.StructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa);
516 Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags);
517 Opts.MergeAllConstants = !Args.hasArg(OPT_fno_merge_all_constants);
518 Opts.NoCommon = Args.hasArg(OPT_fno_common);
519 Opts.NoImplicitFloat = Args.hasArg(OPT_no_implicit_float);
520 Opts.OptimizeSize = getOptimizationLevelSize(Args);
521 Opts.SimplifyLibCalls = !(Args.hasArg(OPT_fno_builtin) ||
522 Args.hasArg(OPT_ffreestanding));
524 getAllNoBuiltinFuncValues(Args, Opts.NoBuiltinFuncs);
526 Args.hasFlag(OPT_funroll_loops, OPT_fno_unroll_loops,
528 Opts.RerollLoops = Args.hasArg(OPT_freroll_loops);
530 Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as);
531 Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
532 Opts.SampleProfileFile = Args.getLastArgValue(OPT_fprofile_sample_use_EQ);
534 setPGOInstrumentor(Opts, Args, Diags);
536 Args.getLastArgValue(OPT_fprofile_instrument_path_EQ);
538 Args.getLastArgValue(OPT_fprofile_instrument_use_path_EQ);
543 Args.hasFlag(OPT_fcoverage_mapping, OPT_fno_coverage_mapping, false);
544 Opts.DumpCoverageMapping = Args.hasArg(OPT_dump_coverage_mapping);
545 Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose);
546 Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new);
547 Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions);
548 Opts.CXAAtExit = !Args.hasArg(OPT_fno_use_cxa_atexit);
549 Opts.CXXCtorDtorAliases = Args.hasArg(OPT_mconstructor_aliases);
550 Opts.CodeModel = getCodeModel(Args, Diags);
551 Opts.DebugPass = Args.getLastArgValue(OPT_mdebug_pass);
553 (Args.hasArg(OPT_mdisable_fp_elim) || Args.hasArg(OPT_pg));
554 Opts.DisableFree = Args.hasArg(OPT_disable_free);
555 Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names);
556 Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);
557 Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
558 Opts.LessPreciseFPMAD = Args.hasArg(OPT_cl_mad_enable);
559 Opts.LimitFloatPrecision = Args.getLastArgValue(OPT_mlimit_float_precision);
560 Opts.NoInfsFPMath = (Args.hasArg(OPT_menable_no_infinities) ||
561 Args.hasArg(OPT_cl_finite_math_only) ||
562 Args.hasArg(OPT_cl_fast_relaxed_math));
563 Opts.NoNaNsFPMath = (Args.hasArg(OPT_menable_no_nans) ||
564 Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
565 Args.hasArg(OPT_cl_finite_math_only) ||
566 Args.hasArg(OPT_cl_fast_relaxed_math));
567 Opts.NoSignedZeros = (Args.hasArg(OPT_fno_signed_zeros) ||
568 Args.hasArg(OPT_cl_no_signed_zeros));
569 Opts.ReciprocalMath = Args.hasArg(OPT_freciprocal_math);
570 Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss);
571 Opts.BackendOptions = Args.getAllArgValues(OPT_backend_option);
572 Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags);
573 Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack);
574 Opts.FatalWarnings = Args.hasArg(OPT_massembler_fatal_warnings);
575 Opts.EnableSegmentedStacks = Args.hasArg(OPT_split_stacks);
576 Opts.RelaxAll = Args.hasArg(OPT_mrelax_all);
578 Args.hasArg(OPT_mincremental_linker_compatible);
579 Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer);
580 Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels);
581 Opts.NoDwarfDirectoryAsm = Args.hasArg(OPT_fno_dwarf_directory_asm);
582 Opts.SoftFloat = Args.hasArg(OPT_msoft_float);
583 Opts.StrictEnums = Args.hasArg(OPT_fstrict_enums);
584 Opts.StrictVTablePointers = Args.hasArg(OPT_fstrict_vtable_pointers);
585 Opts.UnsafeFPMath = Args.hasArg(OPT_menable_unsafe_fp_math) ||
586 Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
587 Args.hasArg(OPT_cl_fast_relaxed_math);
588 Opts.UnwindTables = Args.hasArg(OPT_munwind_tables);
589 Opts.RelocationModel = Args.getLastArgValue(OPT_mrelocation_model, "pic");
590 Opts.ThreadModel = Args.getLastArgValue(OPT_mthread_model, "posix");
593 << Args.getLastArg(OPT_mthread_model)->getAsString(Args)
595 Opts.TrapFuncName = Args.getLastArgValue(OPT_ftrap_function_EQ);
596 Opts.UseInitArray = Args.hasArg(OPT_fuse_init_array);
598 Opts.FunctionSections = Args.hasFlag(OPT_ffunction_sections,
600 Opts.DataSections = Args.hasFlag(OPT_fdata_sections,
602 Opts.UniqueSectionNames = Args.hasFlag(OPT_funique_section_names,
605 Opts.MergeFunctions = Args.hasArg(OPT_fmerge_functions);
607 Opts.NoUseJumpTables = Args.hasArg(OPT_fno_jump_tables);
609 Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ);
610 const Arg *A = Args.getLastArg(OPT_flto, OPT_flto_EQ);
612 if (Arg *A = Args.getLastArg(OPT_fthinlto_index_EQ)) {
615 << A->getAsString(Args) << "-x ir";
616 Opts.ThinLTOIndexFile = Args.getLastArgValue(OPT_fthinlto_index_EQ);
619 Opts.MSVolatile = Args.hasArg(OPT_fms_volatile);
621 Opts.VectorizeBB = Args.hasArg(OPT_vectorize_slp_aggressive);
622 Opts.VectorizeLoop = Args.hasArg(OPT_vectorize_loops);
623 Opts.VectorizeSLP = Args.hasArg(OPT_vectorize_slp);
625 Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
626 Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier);
628 Opts.DisableGCov = Args.hasArg(OPT_test_coverage);
629 Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
630 Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
632 Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
633 Opts.CoverageExtraChecksum = Args.hasArg(OPT_coverage_cfg_checksum);
635 Args.hasArg(OPT_coverage_no_function_names_in_data);
637 Args.hasArg(OPT_coverage_exit_block_before_body);
638 if (Args.hasArg(OPT_coverage_version_EQ)) {
639 StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ);
642 << Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args)
650 if (Arg *A = Args.getLastArg(OPT_fembed_bitcode_EQ)) {
659 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
669 for (const auto &A : Args) {
679 A->render(Args, ASL);
689 Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions);
690 Opts.XRayInstrumentFunctions = Args.hasArg(OPT_fxray_instrument);
692 getLastArgIntValue(Args, OPT_fxray_instruction_threshold_, 200, Diags);
693 Opts.InstrumentForProfiling = Args.hasArg(OPT_pg);
694 Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info);
695 Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections);
696 Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations);
697 Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir);
698 for (auto A : Args.filtered(OPT_mlink_bitcode_file, OPT_mlink_cuda_bitcode)) {
706 getLastArgIntValue(Args, OPT_fsanitize_coverage_type, 0, Diags);
708 Args.hasArg(OPT_fsanitize_coverage_indirect_calls);
709 Opts.SanitizeCoverageTraceBB = Args.hasArg(OPT_fsanitize_coverage_trace_bb);
710 Opts.SanitizeCoverageTraceCmp = Args.hasArg(OPT_fsanitize_coverage_trace_cmp);
712 Args.hasArg(OPT_fsanitize_coverage_8bit_counters);
713 Opts.SanitizeCoverageTracePC = Args.hasArg(OPT_fsanitize_coverage_trace_pc);
715 getLastArgIntValue(Args, OPT_fsanitize_memory_track_origins_EQ, 0, Diags);
717 Args.hasArg(OPT_fsanitize_memory_use_after_dtor);
718 Opts.SanitizeCfiCrossDso = Args.hasArg(OPT_fsanitize_cfi_cross_dso);
719 Opts.SanitizeStats = Args.hasArg(OPT_fsanitize_stats);
721 Args.hasArg(OPT_fsanitize_address_use_after_scope);
723 getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags);
724 Opts.StackRealignment = Args.hasArg(OPT_mstackrealign);
725 if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) {
732 if (Arg *A = Args.getLastArg(OPT_mstack_probe_size)) {
739 if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
747 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
756 Args.hasFlag(OPT_femulated_tls, OPT_fno_emulated_tls, false);
758 if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) {
767 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
774 if (Arg *A = Args.getLastArg(OPT_ffp_contract)) {
783 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
786 if (Arg *A = Args.getLastArg(OPT_fpcc_struct_return, OPT_freg_struct_return)) {
795 Opts.DependentLibraries = Args.getAllArgValues(OPT_dependent_lib);
796 Opts.LinkerOptions = Args.getAllArgValues(OPT_linker_option);
799 if (Arg *A = Args.getLastArg(OPT_Rpass_EQ)) {
801 GenerateOptimizationRemarkRegex(Diags, Args, A);
805 if (Arg *A = Args.getLastArg(OPT_Rpass_missed_EQ)) {
807 GenerateOptimizationRemarkRegex(Diags, Args, A);
811 if (Arg *A = Args.getLastArg(OPT_Rpass_analysis_EQ)) {
813 GenerateOptimizationRemarkRegex(Diags, Args, A);
828 Opts.RewriteMapFiles = Args.getAllArgValues(OPT_frewrite_map_file);
833 Args.getAllArgValues(OPT_fsanitize_recover_EQ), Diags,
836 Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags,
840 Args.getAllArgValues(OPT_fcuda_include_gpubinary);
842 Opts.Backchain = Args.hasArg(OPT_mbackchain);
845 Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags);
851 ArgList &Args) {
853 Opts.OutputFile = Args.getLastArgValue(OPT_dependency_file);
854 Opts.Targets = Args.getAllArgValues(OPT_MT);
855 Opts.IncludeSystemHeaders = Args.hasArg(OPT_sys_header_deps);
856 Opts.IncludeModuleFiles = Args.hasArg(OPT_module_file_deps);
857 Opts.UsePhonyTargets = Args.hasArg(OPT_MP);
858 Opts.ShowHeaderIncludes = Args.hasArg(OPT_H);
859 Opts.HeaderIncludeOutputFile = Args.getLastArgValue(OPT_header_include_file);
860 Opts.AddMissingHeaderDeps = Args.hasArg(OPT_MG);
861 Opts.PrintShowIncludes = Args.hasArg(OPT_show_includes);
862 Opts.DOTOutputFile = Args.getLastArgValue(OPT_dependency_dot);
864 Args.getLastArgValue(OPT_module_dependency_dir);
865 if (Args.hasArg(OPT_MV))
870 Opts.ExtraDeps = Args.getAllArgValues(OPT_fdepfile_entry);
871 auto ModuleFiles = Args.getAllArgValues(OPT_fmodule_file);
876 static bool parseShowColorsArgs(const ArgList &Args, bool DefaultColor) {
886 for (Arg *A : Args) {
918 bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
924 Opts.DiagnosticLogFile = Args.getLastArgValue(OPT_diagnostic_log_file);
926 Args.getLastArg(OPT_diagnostic_serialized_file, OPT__serialize_diags))
928 Opts.IgnoreWarnings = Args.hasArg(OPT_w);
929 Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros);
930 Opts.Pedantic = Args.hasArg(OPT_pedantic);
931 Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors);
932 Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics);
933 Opts.ShowColors = parseShowColorsArgs(Args, DefaultDiagColor);
934 Opts.ShowColumn = Args.hasFlag(OPT_fshow_column,
937 Opts.ShowFixits = !Args.hasArg(OPT_fno_diagnostics_fixit_info);
938 Opts.ShowLocation = !Args.hasArg(OPT_fno_show_source_location);
939 Opts.ShowOptionNames = Args.hasArg(OPT_fdiagnostics_show_option);
941 llvm::sys::Process::UseANSIEscapeCodes(Args.hasArg(OPT_fansi_escape_codes));
945 if (Arg *A = Args.getLastArg(OPT_fdiagnostics_show_note_include_stack,
951 Args.getLastArgValue(OPT_fshow_overloads_EQ, "all");
960 << Args.getLastArg(OPT_fshow_overloads_EQ)->getAsString(Args)
965 Args.getLastArgValue(OPT_fdiagnostics_show_category, "none");
976 << Args.getLastArg(OPT_fdiagnostics_show_category)->getAsString(Args)
981 Args.getLastArgValue(OPT_fdiagnostics_format, "clang");
995 << Args.getLastArg(OPT_fdiagnostics_format)->getAsString(Args)
999 Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info);
1000 Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits);
1001 Opts.ShowPresumedLoc = !Args.hasArg(OPT_fno_diagnostics_use_presumed_location);
1002 Opts.VerifyDiagnostics = Args.hasArg(OPT_verify);
1005 Args.getAllArgValues(OPT_verify_ignore_unexpected_EQ),
1007 if (Args.hasArg(OPT_verify_ignore_unexpected))
1010 Opts.ElideType = !Args.hasArg(OPT_fno_elide_type);
1011 Opts.ShowTemplateTree = Args.hasArg(OPT_fdiagnostics_show_template_tree);
1012 Opts.ErrorLimit = getLastArgIntValue(Args, OPT_ferror_limit, 0, Diags);
1014 getLastArgIntValue(Args, OPT_fmacro_backtrace_limit,
1017 Args, OPT_ftemplate_backtrace_limit,
1020 Args, OPT_fconstexpr_backtrace_limit,
1023 Args, OPT_fspell_checking_limit,
1025 Opts.TabStop = getLastArgIntValue(Args, OPT_ftabstop,
1033 Opts.MessageLength = getLastArgIntValue(Args, OPT_fmessage_length, 0, Diags);
1034 addDiagnosticArgs(Args, OPT_W_Group, OPT_W_value_Group, Opts.Warnings);
1035 addDiagnosticArgs(Args, OPT_R_Group, OPT_R_value_Group, Opts.Remarks);
1040 static void ParseFileSystemArgs(FileSystemOptions &Opts, ArgList &Args) {
1041 Opts.WorkingDir = Args.getLastArgValue(OPT_working_directory);
1054 SmallVector<StringRef, 5> Args;
1055 Arg.split(Args, ':', 5);
1056 if (Args.size() < 5)
1059 BlockName = Args[0];
1060 if (Args[1].getAsInteger(10, MajorVersion)) return true;
1061 if (Args[2].getAsInteger(10, MinorVersion)) return true;
1062 if (Args[3].getAsInteger(2, Hashed)) return true;
1063 if (Args.size() > 4)
1064 UserInfo = Args[4];
1068 static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
1072 if (const Arg *A = Args.getLastArg(OPT_Action_Group)) {
1143 if (const Arg* A = Args.getLastArg(OPT_plugin)) {
1148 Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin);
1149 for (const Arg *AA : Args.filtered(OPT_plugin_arg))
1153 Args.getAllArgValues(OPT_ftest_module_file_extension_EQ)) {
1172 if (const Arg *A = Args.getLastArg(OPT_code_completion_at)) {
1177 << A->getAsString(Args) << A->getValue();
1179 Opts.DisableFree = Args.hasArg(OPT_disable_free);
1181 Opts.OutputFile = Args.getLastArgValue(OPT_o);
1182 Opts.Plugins = Args.getAllArgValues(OPT_load);
1183 Opts.RelocatablePCH = Args.hasArg(OPT_relocatable_pch);
1184 Opts.ShowHelp = Args.hasArg(OPT_help);
1185 Opts.ShowStats = Args.hasArg(OPT_print_stats);
1186 Opts.ShowTimers = Args
1187 Opts.ShowVersion = Args.hasArg(OPT_version);
1188 Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge);
1189 Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm);
1190 Opts.FixWhatYouCan = Args.hasArg(OPT_fix_what_you_can);
1191 Opts.FixOnlyWarnings = Args.hasArg(OPT_fix_only_warnings);
1192 Opts.FixAndRecompile = Args.hasArg(OPT_fixit_recompile);
1193 Opts.FixToTemporaries = Args.hasArg(OPT_fixit_to_temp);
1194 Opts.ASTDumpDecls = Args.hasArg(OPT_ast_dump);
1195 Opts.ASTDumpFilter = Args.getLastArgValue(OPT_ast_dump_filter);
1196 Opts.ASTDumpLookups = Args.hasArg(OPT_ast_dump_lookups);
1197 Opts.UseGlobalModuleIndex = !Args.hasArg(OPT_fno_modules_global_index);
1199 Opts.ModuleMapFiles = Args.getAllArgValues(OPT_fmodule_map_file);
1200 Opts.ModuleFiles = Args.getAllArgValues(OPT_fmodule_file);
1201 Opts.ModulesEmbedFiles = Args.getAllArgValues(OPT_fmodules_embed_file_EQ);
1202 Opts.ModulesEmbedAllFiles = Args.hasArg(OPT_fmodules_embed_all_files);
1203 Opts.IncludeTimestamps = !Args.hasArg(OPT_fno_pch_timestamp);
1206 = Args.hasArg(OPT_code_completion_macros);
1208 = Args.hasArg(OPT_code_completion_patterns);
1210 = !Args.hasArg(OPT_no_code_completion_globals);
1212 = Args.hasArg(OPT_code_completion_brief_comments);
1215 = Args.getLastArgValue(OPT_foverride_record_layout_EQ);
1217 llvm::Triple::normalize(Args.getLastArgValue(OPT_aux_triple));
1218 Opts.FindPchSource = Args.getLastArgValue(OPT_find_pch_source_EQ);
1220 if (const Arg *A = Args.getLastArg(OPT_arcmt_check,
1237 Opts.MTMigrateDir = Args.getLastArgValue(OPT_mt_migrate_directory);
1239 = Args.getLastArgValue(OPT_arcmt_migrate_report_output);
1241 = Args.hasArg(OPT_arcmt_migrate_emit_arc_errors);
1243 if (Args.hasArg(OPT_objcmt_migrate_literals))
1245 if (Args.hasArg(OPT_objcmt_migrate_subscripting))
1247 if (Args.hasArg(OPT_objcmt_migrate_property_dot_syntax))
1249 if (Args.hasArg(OPT_objcmt_migrate_property))
1251 if (Args.hasArg(OPT_objcmt_migrate_readonly_property))
1253 if (Args.hasArg(OPT_objcmt_migrate_readwrite_property))
1255 if (Args.hasArg(OPT_objcmt_migrate_annotation))
1257 if (Args.hasArg(OPT_objcmt_returns_innerpointer_property))
1259 if (Args.hasArg(OPT_objcmt_migrate_instancetype))
1261 if (Args.hasArg(OPT_objcmt_migrate_nsmacros))
1263 if (Args.hasArg(OPT_objcmt_migrate_protocol_conformance))
1265 if (Args.hasArg(OPT_objcmt_atomic_property))
1267 if (Args.hasArg(OPT_objcmt_ns_nonatomic_iosonly))
1269 if (Args.hasArg(OPT_objcmt_migrate_designated_init))
1271 if (Args.hasArg(OPT_objcmt_migrate_all))
1274 Opts.ObjCMTWhiteListPath = Args.getLastArgValue(OPT_objcmt_whitelist_dir_path);
1283 if (const Arg *A = Args.getLastArg(OPT_x)) {
1310 << A->getAsString(Args) << A->getValue();
1314 std::vector<std::string> Inputs = Args.getAllArgValues(OPT_INPUT);
1351 static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
1353 Opts.Sysroot = Args.getLastArgValue(OPT_isysroot, "/");
1354 Opts.Verbose = Args.hasArg(OPT_v);
1355 Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
1356 Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc);
1357 Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx);
1358 if (const Arg *A = Args.getLastArg(OPT_stdlib_EQ))
1360 Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir);
1361 Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodules_cache_path);
1362 Opts.ModuleUserBuildPath = Args.getLastArgValue(OPT_fmodules_user_build_path);
1363 Opts.DisableModuleHash = Args.hasArg(OPT_fdisable_module_hash);
1364 Opts.ImplicitModuleMaps = Args.hasArg(OPT_fimplicit_module_maps);
1365 Opts.ModuleMapFileHomeIsCwd = Args.hasArg(OPT_fmodule_map_file_home_is_cwd);
1367 getLastArgIntValue(Args, OPT_fmodules_prune_interval, 7 * 24 * 60 * 60);
1369 getLastArgIntValue(Args, OPT_fmodules_prune_after, 31 * 24 * 60 * 60);
1371 Args.hasArg(OPT_fmodules_validate_once_per_build_session);
1373 getLastArgUInt64Value(Args, OPT_fbuild_session_timestamp, 0);
1375 Args.hasArg(OPT_fmodules_validate_system_headers);
1376 if (const Arg *A = Args.getLastArg(OPT_fmodule_format_EQ))
1379 for (const Arg *A : Args.filtered(OPT_fmodules_ignore_macro)) {
1387 Args.hasArg(OPT__sysroot_EQ) || Args.hasArg(OPT_isysroot);
1388 for (const Arg *A : Args.filtered(OPT_I, OPT_F, OPT_index_header_map)) {
1416 Args.filtered(OPT_iprefix, OPT_iwithprefix, OPT_iwithprefixbefore)) {
1425 for (const Arg *A : Args.filtered(OPT_idirafter))
1427 for (const Arg *A : Args.filtered(OPT_iquote))
1429 for (const Arg *A : Args.filtered(OPT_isystem, OPT_iwithsysroot))
1432 for (const Arg *A : Args.filtered(OPT_iframework))
1436 for (const Arg *A : Args.filtered(OPT_c_isystem))
1438 for (const Arg *A : Args.filtered(OPT_cxx_isystem))
1440 for (const Arg *A : Args.filtered(OPT_objc_isystem))
1442 for (const Arg *A : Args.filtered(OPT_objcxx_isystem))
1447 Args.filtered(OPT_internal_isystem, OPT_internal_externc_isystem)) {
1456 Args.filtered(OPT_system_header_prefix, OPT_no_system_header_prefix))
1460 for (const Arg *A : Args.filtered(OPT_ivfsoverlay))
1589 static Visibility parseVisibility(Arg *arg, ArgList &args,
1602 << arg->getAsString(args) << value;
1606 static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
1612 if (const Arg *A = Args.getLastArg(OPT_std_EQ)) {
1622 << A->getAsString(Args) << A->getValue();
1634 << A->getAsString(Args) << "C/ObjC";
1642 << A->getAsString(Args) << "C++/ObjC++";
1647 << A->getAsString(Args) << "OpenCL";
1653 << A->getAsString(Args) << "CUDA";
1663 if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
1674 << A->getAsString(Args) << A->getValue();
1680 Opts.IncludeDefaultHeader = Args.hasArg(OPT_finclude_default_header);
1688 if (Args.getLastArg(OPT_cl_strict_aliasing)
1694 << VerSpec << Args.getLastArg(OPT_cl_strict_aliasing)->getAsString(Args);
1702 Opts.GNUKeywords = Args.hasFlag(OPT_fgnu_keywords, OPT_fno_gnu_keywords,
1705 if (Args.hasArg(OPT_fno_operator_names))
1708 if (Args.hasArg(OPT_fcuda_is_device))
1711 if (Args.hasArg(OPT_fcuda_allow_variadic_functions))
1714 if (Args.hasArg(OPT_fno_cuda_host_device_constexpr))
1717 if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_flush_denormals_to_zero))
1720 if (Opts.CUDAIsDevice && Args.hasArg(OPT_fcuda_approx_transcendentals))
1724 if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
1730 if (Args.hasArg(OPT_fobjc_gc_only))
1732 else if (Args.hasArg(OPT_fobjc_gc))
1734 else if (Args.hasArg(OPT_fobjc_arc)) {
1744 if (Args.hasArg(OPT_fobjc_runtime_has_weak))
1751 if (auto weakArg = Args.getLastArg(OPT_fobjc_weak, OPT_fno_objc_weak)) {
1765 if (Args.hasArg(OPT_fno_objc_infer_related_result_type))
1768 if (Args.hasArg(OPT_fobjc_subscripting_legacy_runtime))
1773 if (Args.hasArg(OPT_fgnu89_inline)) {
1781 if (Args.hasArg(OPT_fapple_kext)) {
1788 if (Args.hasArg(OPT_print_ivar_layout))
1790 if (Args.hasArg(OPT_fno_constant_cfstrings))
1793 if (Args.hasArg(OPT_faltivec))
1796 if (Args.hasArg(OPT_fzvector))
1799 if (Args.hasArg(OPT_pthread))
1803 if (Arg *visOpt = Args.getLastArg(OPT_fvisibility)) {
1804 Opts.setValueVisibilityMode(parseVisibility(visOpt, Args, Diags));
1810 if (Arg *typeVisOpt = Args.getLastArg(OPT_ftype_visibility)) {
1811 Opts.setTypeVisibilityMode(parseVisibility(typeVisOpt, Args, Diags));
1816 if (Args.hasArg(OPT_fvisibility_inlines_hidden))
1819 if (Args.hasArg(OPT_ftrapv)) {
1823 Args.getLastArgValue(OPT_ftrapv_handler);
1825 else if (Args.hasArg(OPT_fwrapv))
1828 Opts.MSVCCompat = Args.hasArg(OPT_fms_compatibility);
1829 Opts.MicrosoftExt = Opts.MSVCCompat || Args.hasArg(OPT_fms_extensions);
1830 Opts.AsmBlocks = Args.hasArg(OPT_fasm_blocks) || Opts.MicrosoftExt;
1832 if (const Arg *A = Args.getLastArg(OPT_fms_compatibility_version)) {
1835 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
1847 Args.hasFlag(OPT_ftrigraphs, OPT_fno_trigraphs, Opts.Trigraphs);
1849 Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers,
1852 Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings);
1853 Opts.VtorDispMode = getLastArgIntValue(Args, OPT_vtordisp_mode_EQ, 1, Diags);
1854 Opts.Borland = Args.hasArg(OPT_fborland_extensions);
1855 Opts.WritableStrings = Args.hasArg(OPT_fwritable_strings);
1856 Opts.ConstStrings = Args.hasFlag(OPT_fconst_strings, OPT_fno_const_strings,
1858 if (Args.hasArg(OPT_fno_lax_vector_conversions))
1860 if (Args.hasArg(OPT_fno_threadsafe_statics))
1862 Opts.Exceptions = Args.hasArg(OPT_fexceptions);
1863 Opts.ObjCExceptions = Args.hasArg(OPT_fobjc_exceptions);
1864 Opts.CXXExceptions = Args.hasArg(OPT_fcxx_exceptions);
1865 Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
1866 Opts.ExternCNoUnwind = Args.hasArg(OPT_fexternc_nounwind);
1867 Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp);
1869 Opts.RTTI = Opts.CPlusPlus && !Args.hasArg(OPT_fno_rtti);
1870 Opts.RTTIData = Opts.RTTI && !Args.hasArg(OPT_fno_rtti_data);
1871 Opts.Blocks = Args.hasArg(OPT_fblocks) || (Opts.OpenCL
1873 Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);
1874 Opts.Coroutines = Args.hasArg(OPT_fcoroutines);
1875 Opts.Modules = Args.hasArg(OPT_fmodules);
1876 Opts.ModulesStrictDeclUse = Args.hasArg(OPT_fmodules_strict_decluse);
1878 Args.hasArg(OPT_fmodules_decluse) || Opts.ModulesStrictDeclUse;
1880 Args.hasArg(OPT_fmodules_local_submodule_visibility);
1882 !Args.hasArg(OPT_fno_modules_search_all) &&
1883 Args.hasArg(OPT_fmodules_search_all);
1884 Opts.ModulesErrorRecovery = !Args.hasArg(OPT_fno_modules_error_recovery);
1885 Opts.ImplicitModules = !Args.hasArg(OPT_fno_implicit_modules);
1886 Opts.CharIsSigned = Opts.OpenCL || !Args.hasArg(OPT_fno_signed_char);
1887 Opts.WChar = Opts.CPlusPlus && !Args.hasArg(OPT_fno_wchar);
1888 Opts.ShortWChar = Args.hasFlag(OPT_fshort_wchar, OPT_fno_short_wchar, false);
1889 Opts.ShortEnums = Args.hasArg(OPT_fshort_enums);
1890 Opts.Freestanding = Args.hasArg(OPT_ffreestanding);
1891 Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding;
1893 getAllNoBuiltinFuncValues(Args, Opts.NoBuiltinFuncs);
1894 Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin);
1895 Opts.SizedDeallocation = Args.hasArg(OPT_fsized_deallocation);
1896 Opts.ConceptsTS = Args.hasArg(OPT_fconcepts_ts);
1897 Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions);
1898 Opts.AccessControl = !Args.hasArg(OPT_fno_access_control);
1899 Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors);
1900 Opts.MathErrno = !Opts.OpenCL && Args.hasArg(OPT_fmath_errno);
1902 getLastArgIntValue(Args, OPT_ftemplate_depth, 256, Diags);
1904 getLastArgIntValue(Args, OPT_foperator_arrow_depth, 256, Diags);
1906 getLastArgIntValue(Args, OPT_fconstexpr_depth, 512, Diags);
1908 getLastArgIntValue(Args, OPT_fconstexpr_steps, 1048576, Diags);
1909 Opts.BracketDepth = getLastArgIntValue(Args, OPT_fbracket_depth, 256, Diags);
1910 Opts.DelayedTemplateParsing = Args.hasArg(OPT_fdelayed_template_parsing);
1912 getLastArgIntValue(Args, OPT_Wlarge_by_value_copy_EQ, 0, Diags);
1913 Opts.MSBitfields = Args.hasArg(OPT_mms_bitfields);
1915 Args.getLastArgValue(OPT_fconstant_string_class);
1917 !Args.hasArg(OPT_disable_objc_default_synthesize_properties);
1919 Args.hasArg(OPT_fencode_extended_block_signature);
1920 Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls);
1921 Opts.PackStruct = getLastArgIntValue(Args, OPT_fpack_struct_EQ, 0, Diags);
1922 Opts.MaxTypeAlign = getLastArgIntValue(Args, OPT_fmax_type_align_EQ, 0, Diags);
1923 Opts.AlignDouble = Args.hasArg(OPT_malign_double);
1924 Opts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
1925 Opts.PIE = Args.hasArg(OPT_pic_is_pie);
1926 Opts.Static = Args.hasArg(OPT_static_define);
1927 Opts.DumpRecordLayoutsSimple = Args.hasArg(OPT_fdump_record_layouts_simple);
1929 || Args.hasArg(OPT_fdump_record_layouts);
1930 Opts.DumpVTableLayouts = Args.hasArg(OPT_fdump_vtable_layouts);
1931 Opts.SpellChecking = !Args.hasArg(OPT_fno_spell_checking);
1932 Opts.NoBitFieldTypeAlign = Args.hasArg(OPT_fno_bitfield_type_align);
1933 Opts.SinglePrecisionConstants = Args.hasArg(OPT_cl_single_precision_constant);
1934 Opts.FastRelaxedMath = Args.hasArg(OPT_cl_fast_relaxed_math);
1935 Opts.HexagonQdsp6Compat = Args.hasArg(OPT_mqdsp6_compat);
1936 Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map);
1937 Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype);
1938 Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
1939 Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
1940 Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
1941 Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
1942 Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name_EQ);
1943 Opts.AppExt = Args.hasArg(OPT_fapplication_extension);
1944 Opts.ModuleFeatures = Args.getAllArgValues(OPT_fmodule_feature);
1946 Opts.NativeHalfType |= Args.hasArg(OPT_fnative_half_type);
1947 Opts.NativeHalfArgsAndReturns |= Args.hasArg(OPT_fnative_half_arguments_and_returns);
1948 // Enable HalfArgsAndReturns if present in Args or if NativeHalfArgsAndReturns
1950 Opts.HalfArgsAndReturns = Args.hasArg(OPT_fallow_half_arguments_and_returns)
1952 Opts.GNUAsm = !Args.hasArg(OPT_fno_gnu_inline_asm);
1962 Args.hasFlag(OPT_fdeclspec, OPT_fno_declspec,
1971 if (Arg *A = Args.getLastArg(OPT_faddress_space_map_mangling_EQ)) {
1993 if (Arg *A = Args.getLastArg(OPT_fms_memptr_rep_EQ)) {
2012 if (Arg *A = Args.getLastArg(OPT_fdefault_calling_conv_EQ)) {
2040 if (Arg *A = Args.getLastArg(OPT_mrtd)) {
2055 Opts.OpenMP = Args.hasArg(options::OPT_fopenmp) ? 1 : 0;
2057 Opts.OpenMP && !Args.hasArg(options::OPT_fnoopenmp_use_tls);
2059 Opts.OpenMP && Args.hasArg(options::OPT_fopenmp_is_device);
2063 getLastArgIntValue(Args, OPT_fopenmp_version_EQ, Opts.OpenMP, Diags);
2083 if (Arg *A = Args.getLastArg(options::OPT_fopenmp_targets_EQ)) {
2097 if (Arg *A = Args.getLastArg(options::OPT_fopenmp_host_ir_file_path)) {
2105 Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro,
2110 unsigned Opt = getOptimizationLevel(Args, IK, Diags),
2111 OptSize = getOptimizationLevelSize(Args);
2118 Opts.NoInlineDefine = !Opt || Args.hasArg(OPT_fno_inline);
2120 Opts.FastMath = Args.hasArg(OPT_ffast_math) ||
2121 Args.hasArg(OPT_cl_fast_relaxed_math);
2122 Opts.FiniteMathOnly = Args.hasArg(OPT_ffinite_math_only) ||
2123 Args.hasArg(OPT_cl_finite_math_only) ||
2124 Args.hasArg(OPT_cl_fast_relaxed_math);
2125 Opts.UnsafeFPMath = Args.hasArg(OPT_menable_unsafe_fp_math) ||
2126 Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
2127 Args.hasArg(OPT_cl_fast_relaxed_math);
2130 Args.hasArg(OPT_fretain_comments_from_system_headers);
2132 unsigned SSP = getLastArgIntValue(Args, OPT_stack_protector, 0, Diags);
2136 << Args.getLastArg(OPT_stack_protector)->getAsString(Args) << SSP;
2145 parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ),
2149 getLastArgIntValue(Args, OPT_fsanitize_address_field_padding, 0, Diags);
2150 Opts.SanitizerBlacklistFiles = Args.getAllArgValues(OPT_fsanitize_blacklist);
2153 static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
2157 Opts.ImplicitPCHInclude = Args.getLastArgValue(OPT_include_pch);
2158 Opts.ImplicitPTHInclude = Args.getLastArgValue(OPT_include_pth);
2159 if (const Arg *A = Args.getLastArg(OPT_token_cache))
2163 Opts.UsePredefines = !Args.hasArg(OPT_undef);
2164 Opts.DetailedRecord = Args.hasArg(OPT_detailed_preprocessing_record);
2165 Opts.DisablePCHValidation = Args.hasArg(OPT_fno_validate_pch);
2167 Opts.DumpDeserializedPCHDecls = Args.hasArg(OPT_dump_deserialized_pch_decls);
2168 for (const Arg *A : Args.filtered(OPT_error_on_deserialized_pch_decl))
2171 if (const Arg *A = Args.getLastArg(OPT_preamble_bytes_EQ)) {
2188 for (const Arg *A : Args.filtered(OPT_D, OPT_U)) {
2195 Opts.MacroIncludes = Args.getAllArgValues(OPT_imacros);
2198 for (const Arg *A : Args.filtered(OPT_include))
2201 for (const Arg *A : Args.filtered(OPT_chain_include))
2204 for (const Arg *A : Args.filtered(OPT_remap_file)) {
2208 Diags.Report(diag::err_drv_invalid_remap_file) << A->getAsString(Args);
2215 if (Arg *A = Args.getLastArg(OPT_fobjc_arc_cxxlib_EQ)) {
2223 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
2230 ArgList &Args,
2269 Opts.ShowCPP = !Args.hasArg(OPT_dM);
2273 Opts.ShowComments = Args.hasArg(OPT_C);
2274 Opts.ShowLineMarkers = !Args.hasArg(OPT_P);
2275 Opts.ShowMacroComments = Args.hasArg(OPT_CC);
2276 Opts.ShowMacros = Args.hasArg(OPT_dM) || Args.hasArg(OPT_dD);
2277 Opts.RewriteIncludes = Args.hasArg(OPT_frewrite_includes);
2278 Opts.UseLineDirectives = Args.hasArg(OPT_fuse_line_directives);
2281 static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args,
2284 Opts.ABI = Args.getLastArgValue(OPT_target_abi);
2285 if (Arg *A = Args.getLastArg(OPT_meabi)) {
2294 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
2299 Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
2300 Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
2301 Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
2302 Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
2303 Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
2304 Opts.Reciprocals = Args.getAllArgValues(OPT_mrecip_EQ);
2320 InputArgList Args =
2328 << Args.getArgString(MissingArgIndex) << MissingArgCount;
2333 for (const Arg *A : Args.filtered(OPT_UNKNOWN)) {
2334 Diags.Report(diag::err_drv_unknown_argument) << A->getAsString(Args);
2338 Success &= ParseAnalyzerArgs(*Res.getAnalyzerOpts(), Args, Diags);
2339 Success &= ParseMigratorArgs(Res.getMigratorOpts(), Args);
2340 ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), Args);
2341 Success &= ParseDiagnosticArgs(Res.getDiagnosticOpts(), Args, &Diags,
2343 ParseCommentArgs(LangOpts.CommentOpts, Args);
2344 ParseFileSystemArgs(Res.getFileSystemOpts(), Args);
2346 InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), Args, Diags);
2347 ParseTargetArgs(Res.getTargetOpts(), Args, Diags);
2348 Success &= ParseCodeGenArgs(Res.getCodeGenOpts(), Args, DashX, Diags,
2350 ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), Args);
2355 if (Args.hasArg(OPT_fobjc_arc))
2359 LangOpts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
2360 LangOpts.PIE = Args.hasArg(OPT_pic_is_pie);
2361 parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ),
2365 ParseLangArgs(LangOpts, Args, DashX, Res.getTargetOpts(),
2378 if (!Args.hasArg(OPT_ffp_contract))
2394 ParsePreprocessorArgs(Res.getPreprocessorOpts(), Args, FileMgr, Diags);
2395 ParsePreprocessorOutputArgs(Res.getPreprocessorOutputOpts(), Args,
2499 static IntTy getLastArgIntValueImpl(const ArgList &Args, OptSpecifier Id,
2503 if (Arg *A = Args.getLastArg(Id)) {
2506 Diags->Report(diag::err_drv_invalid_int_value) << A->getAsString(Args)
2515 int getLastArgIntValue(const ArgList &Args, OptSpecifier Id, int Default,
2517 return getLastArgIntValueImpl<int>(Args, Id, Default, Diags);
2520 uint64_t getLastArgUInt64Value(const ArgList &Args, OptSpecifier Id,
2523 return getLastArgIntValueImpl<uint64_t>(Args, Id, Default, Diags);