Home | History | Annotate | Download | only in Frontend

Lines Matching refs:Args

58 // Deserialization (from args)
67 static unsigned getOptimizationLevel(ArgList &Args, InputKind IK,
70 if (IK == IK_OpenCL && !Args.hasArg(OPT_cl_opt_disable))
73 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
86 return getLastArgIntValue(Args, OPT_O, DefaultOpt, Diags);
92 static unsigned getOptimizationLevelSize(ArgList &Args) {
93 if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
108 static void addWarningArgs(ArgList &Args, std::vector<std::string> &Warnings) {
109 for (arg_iterator I = Args.filtered_begin(OPT_W_Group),
110 E = Args.filtered_end(); I != E; ++I) {
131 static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
135 if (Arg *A = Args.getLastArg(OPT_analyzer_store)) {
144 << A->getAsString(Args) << Name;
151 if (Arg *A = Args.getLastArg(OPT_analyzer_constraints)) {
160 << A->getAsString(Args) << Name;
167 if (Arg *A = Args.getLastArg(OPT_analyzer_output)) {
176 << A->getAsString(Args) << Name;
183 if (Arg *A = Args.getLastArg(OPT_analyzer_purge)) {
192 << A->getAsString(Args) << Name;
199 if (Arg *A = Args.getLastArg(OPT_analyzer_inlining_mode)) {
208 << A->getAsString(Args) << Name;
215 Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help);
217 Args.hasArg(OPT_analyzer_viz_egraph_graphviz);
219 Args.hasArg(OPT_analyzer_viz_egraph_ubigraph);
220 Opts.NoRetryExhausted = Args.hasArg(OPT_analyzer_disable_retry_exhausted);
221 Opts.AnalyzeAll = Args.hasArg(OPT_analyzer_opt_analyze_headers);
222 Opts.AnalyzerDisplayProgress = Args.hasArg(OPT_analyzer_display_progress);
224 Args.hasArg(OPT_analyzer_opt_analyze_nested_blocks);
225 Opts.eagerlyAssumeBinOpBifurcation = Args.hasArg(OPT_analyzer_eagerly_assume);
226 Opts.AnalyzeSpecificFunction = Args.getLastArgValue(OPT_analyze_function);
227 Opts.UnoptimizedCFG = Args.hasArg(OPT_analysis_UnoptimizedCFG);
228 Opts.TrimGraph = Args.hasArg(OPT_trim_egraph);
230 getLastArgIntValue(Args, OPT_analyzer_max_loop, 4, Diags);
231 Opts.PrintStats = Args.hasArg(OPT_analyzer_stats);
233 getLastArgIntValue(Args, OPT_analyzer_inline_max_stack_depth,
237 for (arg_iterator it = Args.filtered_begin(OPT_analyzer_checker,
239 ie = Args.filtered_end(); it != ie; ++it) {
253 for (arg_iterator it = Args.filtered_begin(OPT_analyzer_config),
254 ie = Args.filtered_end(); it != ie; ++it) {
285 static bool ParseMigratorArgs(MigratorOptions &Opts, ArgList &Args) {
286 Opts.NoNSAllocReallocError = Args.hasArg(OPT_migrator_no_nsalloc_error);
287 Opts.NoFinalizeRemoval = Args.hasArg(OPT_migrator_no_finalize_removal);
291 static void ParseCommentArgs(CommentOptions &Opts, ArgList &Args) {
292 Opts.BlockCommandNames = Args.getAllArgValues(OPT_fcomment_block_commands);
293 Opts.ParseAllComments = Args.hasArg(OPT_fparse_all_comments);
296 static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
301 unsigned OptLevel = getOptimizationLevel(Args, IK, Diags);
304 << Args.getLastArg(OPT_O)->getAsString(Args) << OptLevel;
315 Opts.NoInline = Args.hasArg(OPT_fno_inline);
316 Opts.setInlining(Args.hasArg(OPT_fno_inline_functions) ?
319 if (Args.hasArg(OPT_gline_tables_only)) {
321 } else if (Args.hasArg(OPT_g_Flag) || Args.hasArg(OPT_gdwarf_2) ||
322 Args.hasArg(OPT_gdwarf_3) || Args.hasArg(OPT_gdwarf_4)) {
323 if (Args.hasFlag(OPT_flimit_debug_info, OPT_fno_limit_debug_info, true))
328 Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
329 Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
330 if (Args.hasArg(OPT_gdwarf_2))
332 else if (Args.hasArg(OPT_gdwarf_3))
334 else if (Args.hasArg(OPT_gdwarf_4))
340 Opts.DisableLLVMOpts = Args.hasArg(OPT_disable_llvm_optzns);
341 Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone);
342 Opts.ForbidGuardVariables = Args.hasArg(OPT_fforbid_guard_variables);
343 Opts.UseRegisterSizedBitfieldAccess = Args.hasArg(
345 Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing);
346 Opts.StructPathTBAA = Args.hasArg(OPT_struct_path_tbaa);
347 Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags);
348 Opts.MergeAllConstants = !Args.hasArg(OPT_fno_merge_all_constants);
349 Opts.NoCommon = Args.hasArg(OPT_fno_common);
350 Opts.NoImplicitFloat = Args.hasArg(OPT_no_implicit_float);
351 Opts.OptimizeSize = getOptimizationLevelSize(Args);
352 Opts.SimplifyLibCalls = !(Args.hasArg(OPT_fno_builtin) ||
353 Args.hasArg(OPT_ffreestanding));
354 Opts.UnrollLoops = Args.hasArg(OPT_funroll_loops) ||
357 Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
358 Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose);
359 Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions);
360 Opts.CUDAIsDevice = Args.hasArg(OPT_fcuda_is_device);
361 Opts.CXAAtExit = !Args.hasArg(OPT_fno_use_cxa_atexit);
362 Opts.CXXCtorDtorAliases = Args.hasArg(OPT_mconstructor_aliases);
363 Opts.CodeModel = Args.getLastArgValue(OPT_mcode_model);
364 Opts.DebugPass = Args.getLastArgValue(OPT_mdebug_pass);
365 Opts.DisableFPElim = Args.hasArg(OPT_mdisable_fp_elim);
366 Opts.DisableFree = Args.hasArg(OPT_disable_free);
367 Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);
368 Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
369 Opts.HiddenWeakVTables = Args.hasArg(OPT_fhidden_weak_vtables);
370 Opts.LessPreciseFPMAD = Args.hasArg(OPT_cl_mad_enable);
371 Opts.LimitFloatPrecision = Args.getLastArgValue(OPT_mlimit_float_precision);
372 Opts.NoInfsFPMath = (Args.hasArg(OPT_menable_no_infinities) ||
373 Args.hasArg(OPT_cl_finite_math_only)||
374 Args.hasArg(OPT_cl_fast_relaxed_math));
375 Opts.NoNaNsFPMath = (Args.hasArg(OPT_menable_no_nans) ||
376 Args.hasArg(OPT_cl_finite_math_only)||
377 Args.hasArg(OPT_cl_fast_relaxed_math));
378 Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss);
379 Opts.BackendOptions = Args.getAllArgValues(OPT_backend_option);
380 Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags);
381 Opts.NoGlobalMerge = Args.hasArg(OPT_mno_global_merge);
382 Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack);
383 Opts.EnableSegmentedStacks = Args.hasArg(OPT_split_stacks);
384 Opts.RelaxAll = Args.hasArg(OPT_mrelax_all);
385 Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer);
386 Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels);
387 Opts.NoDwarf2CFIAsm = Args.hasArg(OPT_fno_dwarf2_cfi_asm);
388 Opts.NoDwarfDirectoryAsm = Args.hasArg(OPT_fno_dwarf_directory_asm);
389 Opts.SoftFloat = Args.hasArg(OPT_msoft_float);
390 Opts.StrictEnums = Args.hasArg(OPT_fstrict_enums);
391 Opts.UnsafeFPMath = Args.hasArg(OPT_menable_unsafe_fp_math) ||
392 Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
393 Args.hasArg(OPT_cl_fast_relaxed_math);
394 Opts.UnwindTables = Args.hasArg(OPT_munwind_tables);
395 Opts.RelocationModel = Args.getLastArgValue(OPT_mrelocation_model, "pic");
396 Opts.TrapFuncName = Args.getLastArgValue(OPT_ftrap_function_EQ);
397 Opts.UseInitArray = Args.hasArg(OPT_fuse_init_array);
399 Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections);
400 Opts.DataSections = Args.hasArg(OPT_fdata_sections);
402 Opts.VectorizeBB = Args.hasArg(OPT_vectorize_slp_aggressive);
403 Opts.VectorizeLoop = Args.hasArg(OPT_vectorize_loops);
404 Opts.VectorizeSLP = Args.hasArg(OPT_vectorize_slp);
406 Opts.MainFileName = Args
407 Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier);
408 Opts.SanitizeRecover = !Args.hasArg(OPT_fno_sanitize_recover);
410 Opts.DisableGCov = Args.hasArg(OPT_test_coverage);
411 Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
412 Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
414 Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
415 Opts.CoverageExtraChecksum = Args.hasArg(OPT_coverage_cfg_checksum);
417 Args.hasArg(OPT_coverage_no_function_names_in_data);
418 if (Args.hasArg(OPT_coverage_version_EQ)) {
419 StringRef CoverageVersion = Args.getLastArgValue(OPT_coverage_version_EQ);
422 << Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args)
430 Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions);
431 Opts.InstrumentForProfiling = Args.hasArg(OPT_pg);
432 Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info);
433 Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir);
434 Opts.LinkBitcodeFile = Args.getLastArgValue(OPT_mlink_bitcode_file);
435 Opts.SanitizerBlacklistFile = Args.getLastArgValue(OPT_fsanitize_blacklist);
437 Args.hasArg(OPT_fsanitize_memory_track_origins);
439 Args.hasArg(OPT_fsanitize_address_zero_base_shadow);
441 Args.hasArg(OPT_fsanitize_undefined_trap_on_error);
443 getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags);
444 Opts.StackRealignment = Args.hasArg(OPT_mstackrealign);
445 if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) {
452 if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
460 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
468 if (Arg *A = Args.getLastArg(OPT_ftlsmodel_EQ)) {
477 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
484 if (Arg *A = Args.getLastArg(OPT_ffp_contract)) {
493 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
496 if (Arg *A = Args.getLastArg(OPT_fpcc_struct_return, OPT_freg_struct_return)) {
509 ArgList &Args) {
511 Opts.OutputFile = Args.getLastArgValue(OPT_dependency_file);
512 Opts.Targets = Args.getAllArgValues(OPT_MT);
513 Opts.IncludeSystemHeaders = Args.hasArg(OPT_sys_header_deps);
514 Opts.UsePhonyTargets = Args.hasArg(OPT_MP);
515 Opts.ShowHeaderIncludes = Args.hasArg(OPT_H);
516 Opts.HeaderIncludeOutputFile = Args.getLastArgValue(OPT_header_include_file);
517 Opts.AddMissingHeaderDeps = Args.hasArg(OPT_MG);
518 Opts.DOTOutputFile = Args.getLastArgValue(OPT_dependency_dot);
521 bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
526 Opts.DiagnosticLogFile = Args.getLastArgValue(OPT_diagnostic_log_file);
528 Args.getLastArgValue(OPT_diagnostic_serialized_file);
529 Opts.IgnoreWarnings = Args.hasArg(OPT_w);
530 Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros);
531 Opts.Pedantic = Args.hasArg(OPT_pedantic);
532 Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors);
533 Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics);
534 Opts.ShowColors = Args.hasArg(OPT_fcolor_diagnostics);
535 Opts.ShowColumn = Args.hasFlag(OPT_fshow_column,
538 Opts.ShowFixits = !Args.hasArg(OPT_fno_diagnostics_fixit_info);
539 Opts.ShowLocation = !Args.hasArg(OPT_fno_show_source_location);
540 Opts.ShowOptionNames = Args.hasArg(OPT_fdiagnostics_show_option);
544 if (Arg *A = Args.getLastArg(OPT_fdiagnostics_show_note_include_stack,
550 Args.getLastArgValue(OPT_fshow_overloads_EQ, "all");
559 << Args.getLastArg(OPT_fshow_overloads_EQ)->getAsString(Args)
564 Args.getLastArgValue(OPT_fdiagnostics_show_category, "none");
575 << Args.getLastArg(OPT_fdiagnostics_show_category)->getAsString(Args)
580 Args.getLastArgValue(OPT_fdiagnostics_format, "clang");
591 << Args.getLastArg(OPT_fdiagnostics_format)->getAsString(Args)
595 Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info);
596 Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits);
597 Opts.ShowPresumedLoc = !Args.hasArg(OPT_fno_diagnostics_use_presumed_location);
598 Opts.VerifyDiagnostics = Args.hasArg(OPT_verify);
599 Opts.ElideType = !Args.hasArg(OPT_fno_elide_type);
600 Opts.ShowTemplateTree = Args.hasArg(OPT_fdiagnostics_show_template_tree);
601 Opts.ErrorLimit = getLastArgIntValue(Args, OPT_ferror_limit, 0, Diags);
603 getLastArgIntValue(Args, OPT_fmacro_backtrace_limit,
606 Args, OPT_ftemplate_backtrace_limit,
609 Args, OPT_fconstexpr_backtrace_limit,
611 Opts.TabStop = getLastArgIntValue(Args, OPT_ftabstop,
619 Opts.MessageLength = getLastArgIntValue(Args, OPT_fmessage_length, 0, Diags);
620 addWarningArgs(Args, Opts.Warnings);
625 static void ParseFileSystemArgs(FileSystemOptions &Opts, ArgList &Args) {
626 Opts.WorkingDir = Args.getLastArgValue(OPT_working_directory);
629 static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
633 if (const Arg *A = Args.getLastArg(OPT_Action_Group)) {
703 if (const Arg* A = Args.getLastArg(OPT_plugin)) {
708 for (arg_iterator it = Args.filtered_begin(OPT_plugin_arg),
709 end = Args.filtered_end(); it != end; ++it) {
715 Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin);
718 for (arg_iterator it = Args.filtered_begin(OPT_plugin_arg),
719 end = Args.filtered_end(); it != end; ++it) {
725 if (const Arg *A = Args.getLastArg(OPT_code_completion_at)) {
730 << A->getAsString(Args) << A->getValue();
732 Opts.DisableFree = Args.hasArg(OPT_disable_free);
734 Opts.OutputFile = Args.getLastArgValue(OPT_o);
735 Opts.Plugins = Args.getAllArgValues(OPT_load);
736 Opts.RelocatablePCH = Args.hasArg(OPT_relocatable_pch);
737 Opts.ShowHelp = Args.hasArg(OPT_help);
738 Opts.ShowStats = Args.hasArg(OPT_print_stats);
739 Opts.ShowTimers = Args.hasArg(OPT_ftime_report);
740 Opts.ShowVersion = Args.hasArg(OPT_version);
741 Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge);
742 Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm);
743 Opts.FixWhatYouCan = Args.hasArg(OPT_fix_what_you_can);
744 Opts.FixOnlyWarnings = Args.hasArg(OPT_fix_only_warnings);
745 Opts.FixAndRecompile = Args.hasArg(OPT_fixit_recompile);
746 Opts.FixToTemporaries = Args.hasArg(OPT_fixit_to_temp);
747 Opts.ASTDumpFilter = Args.getLastArgValue(OPT_ast_dump_filter);
748 Opts.ASTDumpLookups = Args.hasArg(OPT_ast_dump_lookups);
749 Opts.UseGlobalModuleIndex = !Args.hasArg(OPT_fno_modules_global_index);
753 = Args.hasArg(OPT_code_completion_macros);
755 = Args.hasArg(OPT_code_completion_patterns);
757 = !Args.hasArg(OPT_no_code_completion_globals);
759 = Args.hasArg(OPT_code_completion_brief_comments);
762 = Args.getLastArgValue(OPT_foverride_record_layout_EQ);
763 if (const Arg *A = Args.getLastArg(OPT_arcmt_check,
780 Opts.MTMigrateDir = Args.getLastArgValue(OPT_mt_migrate_directory);
782 = Args.getLastArgValue(OPT_arcmt_migrate_report_output);
784 = Args.hasArg(OPT_arcmt_migrate_emit_arc_errors);
786 if (Args.hasArg(OPT_objcmt_migrate_literals))
788 if (Args.hasArg(OPT_objcmt_migrate_subscripting))
790 if (Args.hasArg(OPT_objcmt_migrate_property))
800 if (const Arg *A = Args.getLastArg(OPT_x)) {
825 << A->getAsString(Args) << A->getValue();
829 std::vector<std::string> Inputs = Args.getAllArgValues(OPT_INPUT);
863 static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
865 Opts.Sysroot = Args.getLastArgValue(OPT_isysroot, "/");
866 Opts.Verbose = Args.hasArg(OPT_v);
867 Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
868 Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc);
869 Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx);
870 if (const Arg *A = Args.getLastArg(OPT_stdlib_EQ))
872 Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir);
873 Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodules_cache_path);
874 Opts.DisableModuleHash = Args.hasArg(OPT_fdisable_module_hash);
876 Opts.ModuleMaps = Args.hasArg(OPT_fmodule_maps) || Args.hasArg(OPT_fmodules);
878 getLastArgIntValue(Args, OPT_fmodules_prune_interval, 7 * 24 * 60 * 60);
880 getLastArgIntValue(Args, OPT_fmodules_prune_after, 31 * 24 * 60 * 60);
881 for (arg_iterator it = Args.filtered_begin(OPT_fmodules_ignore_macro),
882 ie = Args.filtered_end();
890 for (arg_iterator it = Args.filtered_begin(OPT_I, OPT_F,
892 ie = Args.filtered_end(); it != ie; ++it) {
909 for (arg_iterator it = Args.filtered_begin(OPT_iprefix, OPT_iwithprefix,
911 ie = Args.filtered_end(); it != ie; ++it) {
923 for (arg_iterator it = Args.filtered_begin(OPT_idirafter),
924 ie = Args.filtered_end(); it != ie; ++it)
926 for (arg_iterator it = Args.filtered_begin(OPT_iquote),
927 ie = Args.filtered_end(); it != ie; ++it)
929 for (arg_iterator it = Args.filtered_begin(OPT_isystem,
930 OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it)
933 for (arg_iterator it = Args.filtered_begin(OPT_iframework),
934 ie = Args.filtered_end(); it != ie; ++it)
938 for (arg_iterator it = Args.filtered_begin(OPT_c_isystem),
939 ie = Args.filtered_end(); it != ie; ++it)
941 for (arg_iterator it = Args.filtered_begin(OPT_cxx_isystem),
942 ie = Args.filtered_end(); it != ie; ++it)
944 for (arg_iterator it = Args.filtered_begin(OPT_objc_isystem),
945 ie = Args.filtered_end(); it != ie; ++it)
947 for (arg_iterator it = Args.filtered_begin(OPT_objcxx_isystem),
948 ie = Args.filtered_end(); it != ie; ++it)
952 for (arg_iterator I = Args.filtered_begin(OPT_internal_isystem,
954 E = Args.filtered_end();
963 for (arg_iterator I = Args.filtered_begin(OPT_isystem_prefix,
965 E = Args.filtered_end();
1070 static Visibility parseVisibility(Arg *arg, ArgList &args,
1083 << arg->getAsString(args) << value;
1087 static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
1091 if (const Arg *A = Args.getLastArg(OPT_std_EQ)) {
1099 << A->getAsString(Args) << A->getValue();
1110 << A->getAsString(Args) << "C/ObjC";
1118 << A->getAsString(Args) << "C++/ObjC++";
1123 << A->getAsString(Args) << "OpenCL";
1128 << A->getAsString(Args) << "CUDA";
1138 if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
1148 << A->getAsString(Args) << A->getValue();
1161 Opts.GNUKeywords = Args.hasFlag(OPT_fgnu_keywords, OPT_fno_gnu_keywords,
1164 if (Args.hasArg(OPT_fno_operator_names))
1168 if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
1174 if (Args.hasArg(OPT_fobjc_gc_only))
1176 else if (Args.hasArg(OPT_fobjc_gc))
1178 else if (Args.hasArg(OPT_fobjc_arc)) {
1184 if (Args.hasArg(OPT_fobjc_runtime_has_weak))
1190 if (Args.hasArg(OPT_fno_objc_infer_related_result_type))
1194 if (Args.hasArg(OPT_fgnu89_inline))
1197 if (Args.hasArg(OPT_fapple_kext)) {
1204 if (Args.hasArg(OPT_print_ivar_layout))
1206 if (Args.hasArg(OPT_fno_constant_cfstrings))
1209 if (Args.hasArg(OPT_faltivec))
1212 if (Args.hasArg(OPT_pthread))
1216 if (Arg *visOpt = Args.getLastArg(OPT_fvisibility)) {
1217 Opts.setValueVisibilityMode(parseVisibility(visOpt, Args, Diags));
1223 if (Arg *typeVisOpt = Args.getLastArg(OPT_ftype_visibility)) {
1224 Opts.setTypeVisibilityMode(parseVisibility(typeVisOpt, Args, Diags));
1229 if (Args.hasArg(OPT_fvisibility_inlines_hidden))
1232 if (Args.hasArg(OPT_ftrapv)) {
1236 Args.getLastArgValue(OPT_ftrapv_handler);
1238 else if (Args.hasArg(OPT_fwrapv))
1241 if (Args.hasArg(OPT_trigraphs))
1244 Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers,
1247 Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings);
1249 = ArgsArgs.hasArg(OPT_fms_compatibility);
1250 Opts.MicrosoftMode = Args.hasArg(OPT_fms_compatibility);
1251 Opts.AsmBlocks = Args.hasArg(OPT_fasm_blocks) || Opts.MicrosoftExt;
1252 Opts.MSCVersion = getLastArgIntValue(Args, OPT_fmsc_version, 0, Diags);
1253 Opts.Borland = Args.hasArg(OPT_fborland_extensions);
1254 Opts.WritableStrings = Args.hasArg(OPT_fwritable_strings);
1255 Opts.ConstStrings = Args.hasFlag(OPT_fconst_strings, OPT_fno_const_strings,
1257 if (Args.hasArg(OPT_fno_lax_vector_conversions))
1259 if (Args.hasArg(OPT_fno_threadsafe_statics))
1261 Opts.Exceptions = Args.hasArg(OPT_fexceptions);
1262 Opts.ObjCExceptions = Args.hasArg(OPT_fobjc_exceptions);
1263 Opts.CXXExceptions = Args.hasArg(OPT_fcxx_exceptions);
1264 Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
1265 Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp);
1267 Opts.RTTI = !Args.hasArg(OPT_fno_rtti);
1268 Opts.Blocks = Args.hasArg(OPT_fblocks);
1269 Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional);
1270 Opts.Modules = Args.hasArg(OPT_fmodules);
1271 Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char);
1272 Opts.WChar = Opts.CPlusPlus && !Args.hasArg(OPT_fno_wchar);
1273 Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar);
1274 Opts.ShortEnums = Args.hasArg(OPT_fshort_enums);
1275 Opts.Freestanding = Args.hasArg(OPT_ffreestanding);
1276 Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding;
1277 Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin);
1278 Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new);
1279 Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions);
1280 Opts.AccessControl = !Args.hasArg(OPT_fno_access_control);
1281 Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors);
1282 Opts.MathErrno = Args.hasArg(OPT_fmath_errno);
1284 getLastArgIntValue(Args, OPT_ftemplate_depth, 256, Diags);
1286 getLastArgIntValue(Args, OPT_fconstexpr_depth, 512, Diags);
1288 getLastArgIntValue(Args, OPT_fconstexpr_steps, 1048576, Diags);
1289 Opts.BracketDepth = getLastArgIntValue(Args, OPT_fbracket_depth, 256, Diags);
1290 Opts.DelayedTemplateParsing = Args.hasArg(OPT_fdelayed_template_parsing);
1292 getLastArgIntValue(Args, OPT_Wlarge_by_value_copy_EQ, 0, Diags);
1293 Opts.MSBitfields = Args.hasArg(OPT_mms_bitfields);
1295 Args.getLastArgValue(OPT_fconstant_string_class);
1297 Args.hasArg(OPT_fobjc_default_synthesize_properties);
1299 Args.hasArg(OPT_fencode_extended_block_signature);
1300 Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls);
1301 Opts.PackStruct = getLastArgIntValue(Args, OPT_fpack_struct_EQ, 0, Diags);
1302 Opts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
1303 Opts.PIELevel = getLastArgIntValue(Args, OPT_pie_level, 0, Diags);
1304 Opts.Static = Args.hasArg(OPT_static_define);
1305 Opts.DumpRecordLayoutsSimple = Args.hasArg(OPT_fdump_record_layouts_simple);
1307 || Args.hasArg(OPT_fdump_record_layouts);
1308 Opts.DumpVTableLayouts = Args.hasArg(OPT_fdump_vtable_layouts);
1309 Opts.SpellChecking = !Args.hasArg(OPT_fno_spell_checking);
1310 Opts.NoBitFieldTypeAlign = Args.hasArg(OPT_fno_bitfield_type_align);
1311 Opts.SinglePrecisionConstants = Args.hasArg(OPT_cl_single_precision_constant);
1312 Opts.FastRelaxedMath = Args.hasArg(OPT_cl_fast_relaxed_math);
1313 Opts.MRTD = Args.hasArg(OPT_mrtd);
1314 Opts.HexagonQdsp6Compat = Args.hasArg(OPT_mqdsp6_compat);
1315 Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map);
1316 Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype);
1317 Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
1318 Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
1319 Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
1320 Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
1321 Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
1324 Opts.OpenMP = Args.hasArg(OPT_fopenmp);
1327 Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro,
1332 unsigned Opt = getOptimizationLevel(Args, IK, Diags),
1333 OptSize = getOptimizationLevelSize(Args);
1340 Opts.NoInlineDefine = !Opt || Args.hasArg(OPT_fno_inline);
1342 Opts.FastMath = Args.hasArg(OPT_ffast_math);
1343 Opts.FiniteMathOnly = Args.hasArg(OPT_ffinite_math_only);
1346 Args.hasArg(OPT_fretain_comments_from_system_headers);
1348 unsigned SSP = getLastArgIntValue(Args, OPT_stack_protector, 0, Diags);
1352 << Args.getLastArg(OPT_stack_protector)->getAsString(Args) << SSP;
1360 std::vector<std::string> Sanitizers = Args.getAllArgValues(OPT_fsanitize_EQ);
1391 static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
1395 Opts.ImplicitPCHInclude = Args.getLastArgValue(OPT_include_pch);
1396 Opts.ImplicitPTHInclude = Args.getLastArgValue(OPT_include_pth);
1397 if (const Arg *A = Args.getLastArg(OPT_token_cache))
1401 Opts.UsePredefines = !Args.hasArg(OPT_undef);
1402 Opts.DetailedRecord = Args.hasArg(OPT_detailed_preprocessing_record);
1403 Opts.DisablePCHValidation = Args.hasArg(OPT_fno_validate_pch);
1405 Opts.DumpDeserializedPCHDecls = Args.hasArg(OPT_dump_deserialized_pch_decls);
1406 for (arg_iterator it = Args.filtered_begin(OPT_error_on_deserialized_pch_decl),
1407 ie = Args.filtered_end(); it != ie; ++it) {
1412 if (const Arg *A = Args.getLastArg(OPT_preamble_bytes_EQ)) {
1429 for (arg_iterator it = Args.filtered_begin(OPT_D, OPT_U),
1430 ie = Args.filtered_end(); it != ie; ++it) {
1437 Opts.MacroIncludes = Args.getAllArgValues(OPT_imacros);
1440 for (arg_iterator it = Args.filtered_begin(OPT_include),
1441 ie = Args.filtered_end(); it != ie; ++it) {
1446 for (arg_iterator it = Args.filtered_begin(OPT_chain_include),
1447 ie = Args.filtered_end(); it != ie; ++it) {
1453 if (Args.hasArg(OPT_faltivec))
1456 for (arg_iterator it = Args.filtered_begin(OPT_remap_file),
1457 ie = Args.filtered_end(); it != ie; ++it) {
1463 Diags.Report(diag::err_drv_invalid_remap_file) << A->getAsString(Args);
1470 if (Arg *A = Args.getLastArg(OPT_fobjc_arc_cxxlib_EQ)) {
1478 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name;
1485 ArgList &Args,
1524 Opts.ShowCPP = !Args.hasArg(OPT_dM);
1528 Opts.ShowComments = Args.hasArg(OPT_C);
1529 Opts.ShowLineMarkers = !Args.hasArg(OPT_P);
1530 Opts.ShowMacroComments = Args.hasArg(OPT_CC);
1531 Opts.ShowMacros = Args.hasArg(OPT_dM) || Args.hasArg(OPT_dD);
1532 Opts.RewriteIncludes = Args.hasArg(OPT_frewrite_includes);
1535 static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) {
1537 Opts.ABI = Args.getLastArgValue(OPT_target_abi);
1538 Opts.CXXABI = Args.getLastArgValue(OPT_cxx_abi);
1539 Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
1540 Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
1541 Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
1542 Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
1561 OwningPtr<InputArgList> Args(
1568 << Args->getArgString(MissingArgIndex) << MissingArgCount;
1573 for (arg_iterator it = Args->filtered_begin(OPT_UNKNOWN),
1574 ie = Args->filtered_end(); it != ie; ++it) {
1575 Diags.Report(diag::err_drv_unknown_argument) << (*it)->getAsString(*Args);
1579 Success = ParseAnalyzerArgs(*Res.getAnalyzerOpts(), *Args, Diags) && Success;
1580 Success = ParseMigratorArgs(Res.getMigratorOpts(), *Args) && Success;
1581 ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), *Args);
1582 Success = ParseDiagnosticArgs(Res.getDiagnosticOpts(), *Args, &Diags)
1584 ParseCommentArgs(Res.getLangOpts()->CommentOpts, *Args);
1585 ParseFileSystemArgs(Res.getFileSystemOpts(), *Args);
1587 InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), *Args, Diags);
1588 Success = ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags)
1590 ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), *Args);
1592 ParseLangArgs(*Res.getLangOpts(), *Args, DashX, Diags);
1601 ParsePreprocessorArgs(Res.getPreprocessorOpts(), *Args, FileMgr, Diags);
1602 ParsePreprocessorOutputArgs(Res.getPreprocessorOutputOpts(), *Args,
1604 ParseTargetArgs(Res.getTargetOpts(), *Args);
1745 int getLastArgIntValue(const ArgList &Args, OptSpecifier Id, int Default,
1748 if (Arg *A = Args.getLastArg(Id)) {
1751 Diags->Report(diag::err_drv_invalid_int_value) << A->getAsString(Args)