Lines Matching full:opts
131 static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
147 Opts.AnalysisStoreOpt = Value;
163 Opts.AnalysisConstraintsOpt = Value;
179 Opts.AnalysisDiagOpt = Value;
195 Opts.AnalysisPurgeOpt = Value;
211 Opts.InliningMode = Value;
215 Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help);
216 Opts.visualizeExplodedGraphWithGraphViz =
218 Opts.visualizeExplodedGraphWithUbiGraph =
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);
223 Opts.AnalyzeNestedBlocks =
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);
229 Opts.maxBlockVisitOnPath =
231 Opts.PrintStats = Args.hasArg(OPT_analyzer_stats);
232 Opts.InlineMaxStackDepth =
234 Opts.InlineMaxStackDepth, Diags);
236 Opts.CheckersControlList.clear();
249 Opts.CheckersControlList.push_back(std::make_pair(checkers[i], enable));
278 Opts.Config[key] = val;
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,
308 Opts.OptimizationLevel = OptLevel;
311 Opts.setInlining(
312 (Opts.OptimizationLevel > 1) ? CodeGenOptions::NormalInlining
315 Opts.NoInline = Args.hasArg(OPT_fno_inline);
316 Opts.setInlining(Args.hasArg(OPT_fno_inline_functions) ?
317 CodeGenOptions::OnlyAlwaysInlining : Opts.getInlining());
320 Opts.setDebugInfo(CodeGenOptions::DebugLineTablesOnly);
324 Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo);
326 Opts.setDebugInfo(CodeGenOptions::FullDebugInfo);
328 Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
329 Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
331 Opts.DwarfVersion = 2;
333 Opts.DwarfVersion = 3;
335 Opts.DwarfVersion = 4;
336 else if (Opts.getDebugInfo() != CodeGenOptions::NoDebugInfo)
338 Opts.DwarfVersion = 3;
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) ||
354 Opts.UnrollLoops = Args.hasArg(OPT_funroll_loops) ||
355 (Opts.OptimizationLevel > 1 && !Opts.OptimizeSize);
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) ||
375 Opts.NoNaNsFPMath = (Args.hasArg(OPT_menable_no_nans) ||
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) ||
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
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);
413 if (Opts.EmitGcovArcs || Opts.EmitGcovNotes) {
414 Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
415 Opts.CoverageExtraChecksum = Args.hasArg(OPT_coverage_cfg_checksum);
416 Opts.CoverageNoFunctionNamesInData =
425 memcpy(Opts.CoverageVersion, CoverageVersion.data(), 4);
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);
436 Opts.SanitizeMemoryTrackOrigins =
438 Opts.SanitizeAddressZeroBaseShadow =
440 Opts.SanitizeUndefinedTrapOnError =
442 Opts.SSPBufferSize =
444 Opts.StackRealignment = Args.hasArg(OPT_mstackrealign);
447 unsigned StackAlignment = Opts.StackAlignment;
449 Opts.StackAlignment = StackAlignment;
463 Opts.setObjCDispatchMethod(
480 Opts.setDefaultTLSModel(static_cast<CodeGenOptions::TLSModel>(Model));
487 Opts.setFPContractMode(CodeGenOptions::FPC_Fast);
489 Opts.setFPContractMode(CodeGenOptions::FPC_On);
491 Opts.setFPContractMode(CodeGenOptions::FPC_Off);
498 Opts.setStructReturnConvention(CodeGenOptions::SRCK_OnStack);
501 Opts.setStructReturnConvention(CodeGenOptions::SRCK_InRegs);
508 static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,
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);
527 Opts.DiagnosticSerializationFile =
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);
543 Opts.ShowNoteIncludeStack = false;
547 Opts.ShowNoteIncludeStack = true;
552 Opts.setShowOverloads(Ovl_Best);
554 Opts.setShowOverloads(Ovl_All);
566 Opts.ShowCategories = 0;
568 Opts.ShowCategories = 1;
570 Opts.ShowCategories = 2;
582 Opts.setFormat(DiagnosticOptions::Clang);
584 Opts.setFormat(DiagnosticOptions::Msvc);
586 Opts.setFormat(DiagnosticOptions::Vi);
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);
602 Opts.MacroBacktraceLimit =
605 Opts.TemplateBacktraceLimit = getLastArgIntValue(
608 Opts.ConstexprBacktraceLimit = getLastArgIntValue(
611 Opts.TabStop = getLastArgIntValue(Args, OPT_ftabstop,
613 if (Opts.TabStop == 0 || Opts.TabStop > DiagnosticOptions::MaxTabStop) {
614 Opts.TabStop = DiagnosticOptions::DefaultTabStop;
617 << Opts.TabStop << DiagnosticOptions::DefaultTabStop;
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,
632 Opts.ProgramAction = frontend::ParseSyntaxOnly;
638 Opts.ProgramAction = frontend::ASTDeclList; break;
640 Opts.ProgramAction = frontend::ASTDump; break;
642 Opts.ProgramAction = frontend::ASTDumpXML; break;
644 Opts.ProgramAction = frontend::ASTPrint; break;
646 Opts.ProgramAction = frontend::ASTView; break;
648 Opts.ProgramAction = frontend::DumpRawTokens; break;
650 Opts.ProgramAction = frontend::DumpTokens; break;
652 Opts.ProgramAction = frontend::EmitAssembly; break;
654 Opts.ProgramAction = frontend::EmitBC; break;
656 Opts.ProgramAction = frontend::EmitHTML; break;
658 Opts.ProgramAction = frontend::EmitLLVM; break;
660 Opts.ProgramAction = frontend::EmitLLVMOnly; break;
662 Opts.ProgramAction = frontend::EmitCodeGenOnly; break;
664 Opts.ProgramAction = frontend::EmitObj; break;
666 Opts.FixItSuffix = A->getValue();
669 Opts.ProgramAction = frontend::FixIt; break;
671 Opts.ProgramAction = frontend::GenerateModule; break;
673 Opts.ProgramAction = frontend::GeneratePCH; break;
675 Opts.ProgramAction = frontend::GeneratePTH; break;
677 Opts.ProgramAction = frontend::InitOnly; break;
679 Opts.ProgramAction = frontend::ParseSyntaxOnly; break;
681 Opts.ProgramAction = frontend::ModuleFileInfo; break;
683 Opts.ProgramAction = frontend::PrintDeclContext; break;
685 Opts.ProgramAction = frontend::PrintPreamble; break;
687 Opts.ProgramAction = frontend::PrintPreprocessedInput; break;
689 Opts.ProgramAction = frontend::RewriteMacros; break;
691 Opts.ProgramAction = frontend::RewriteObjC; break;
693 Opts.ProgramAction = frontend::RewriteTest; break;
695 Opts.ProgramAction = frontend::RunAnalysis; break;
697 Opts.ProgramAction = frontend::MigrateSource; break;
699 Opts.ProgramAction = frontend::RunPreprocessorOnly; break;
704 Opts.Plugins.push_back(A->getValue(0));
705 Opts.ProgramAction = frontend::PluginAction;
706 Opts.ActionName = A->getValue();
710 if ((*it)->getValue(0) == Opts.ActionName)
711 Opts.PluginArgs.push_back((*it)->getValue(1));
715 Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin);
716 Opts.AddPluginArgs.resize(Opts.AddPluginActions.size());
717 for (int i = 0, e = Opts.AddPluginActions.size(); i != e; ++i) {
720 if ((*it)->getValue(0) == Opts.AddPluginActions[i])
721 Opts.AddPluginArgs[i].push_back((*it)->getValue(1));
726 Opts.CodeCompletionAt =
728 if (Opts.CodeCompletionAt.FileName.empty())
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);
750 Opts.GenerateGlobalModuleIndex = Opts.UseGlobalModuleIndex;
752 Opts.CodeCompleteOpts.IncludeMacros
754 Opts.CodeCompleteOpts.IncludeCodePatterns
756 Opts.CodeCompleteOpts.IncludeGlobals
758 Opts.CodeCompleteOpts.IncludeBriefComments
761 Opts.OverrideRecordLayoutsFile
770 Opts.ARCMTAction = FrontendOptions::ARCMT_Check;
773 Opts.ARCMTAction = FrontendOptions::ARCMT_Modify;
776 Opts.ARCMTAction = FrontendOptions::ARCMT_Migrate;
780 Opts.MTMigrateDir = Args.getLastArgValue(OPT_mt_migrate_directory);
781 Opts.ARCMTMigrateReportOut
783 Opts.ARCMTMigrateEmitARCErrors
787 Opts.ObjCMTAction |= FrontendOptions::ObjCMT_Literals;
789 Opts.ObjCMTAction |= FrontendOptions::ObjCMT_Subscripting;
791 Opts.ObjCMTAction |= FrontendOptions::ObjCMT_Property;
793 if (Opts.ARCMTAction != FrontendOptions::ARCMT_None &&
794 Opts.ObjCMTAction != FrontendOptions::ObjCMT_None) {
830 Opts.Inputs.clear();
842 Opts.Inputs.push_back(FrontendInputFile(Inputs[i], IK));
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);
871 Opts.UseLibcxx = (strcmp(A->getValue(), "libc++") == 0);
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);
877 Opts.ModuleCachePruneInterval =
879 Opts.ModuleCachePruneAfter =
885 Opts.ModulesIgnoreMacros.insert(MacroDef.split('=').first);
902 Opts.AddPath((*it)->getValue(), Group,
916 Opts.AddPath(Prefix.str() + A->getValue(),
919 Opts.AddPath(Prefix.str() + A->getValue(),
925 Opts.AddPath((*it)->getValue(), frontend::After, false, true);
928 Opts.AddPath((*it)->getValue(), frontend::Quoted, false, true);
931 Opts.AddPath((*it)->getValue(), frontend::System, false,
935 Opts.AddPath((*it)->getValue(), frontend::System, true, true);
940 Opts.AddPath((*it)->getValue(), frontend::CSystem, false, true);
943 Opts.AddPath((*it)->getValue(), frontend::CXXSystem, false, true);
946 Opts.AddPath((*it)->getValue(), frontend::ObjCSystem, false,true);
949 Opts.AddPath((*it)->getValue(), frontend::ObjCXXSystem, false, true);
959 Opts.AddPath((*I)->getValue(), Group, false, true);
967 Opts.AddSystemHeaderPrefix((*I)->getValue(),
971 void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
977 Opts.AsmPreprocessor = 1;
982 Opts.ObjC1 = Opts.ObjC2 = 1;
1015 Opts.LineComment = Std.hasLineComments();
1016 Opts.C99 = Std.isC99();
1017 Opts.C11 = Std.isC11();
1018 Opts.CPlusPlus = Std.isCPlusPlus();
1019 Opts.CPlusPlus11 = Std.isCPlusPlus11();
1020 Opts.CPlusPlus1y = Std.isCPlusPlus1y();
1021 Opts.Digraphs = Std.hasDigraphs();
1022 Opts.GNUMode = Std.isGNUMode();
1023 Opts.GNUInline = !Std.isC99();
1024 Opts.HexFloats = Std.hasHexFloats();
1025 Opts.ImplicitInt = Std.hasImplicitInt();
1029 Opts.OpenCL = 1;
1030 Opts.OpenCLVersion = 100;
1033 Opts.OpenCL = 1;
1034 Opts.OpenCLVersion = 110;
1037 Opts.OpenCL = 1;
1038 Opts.OpenCLVersion = 120;
1042 if (Opts.OpenCL) {
1043 Opts.AltiVec = 0;
1044 Opts.CXXOperatorNames = 1;
1045 Opts.LaxVectorConversions = 0;
1046 Opts.DefaultFPContract = 1;
1047 Opts.NativeHalfType = 1;
1051 Opts.CUDA = 1;
1054 Opts.Bool = Opts.OpenCL || Opts.CPlusPlus;
1057 Opts.WChar = Opts.CPlusPlus;
1059 Opts.GNUKeywords = Opts.GNUMode;
1060 Opts.CXXOperatorNames = Opts.CPlusPlus;
1064 Opts.Trigraphs = !Opts.GNUMode;
1066 Opts.DollarIdents = !Opts.AsmPreprocessor;
1087 static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
1154 CompilerInvocation::setLangDefaults(Opts, IK, LangStd);
1161 Opts.GNUKeywords = Args.hasFlag(OPT_fgnu_keywords, OPT_fno_gnu_keywords,
1162 Opts.GNUKeywords);
1165 Opts.CXXOperatorNames = 0;
1167 if (Opts.ObjC1) {
1170 if (Opts.ObjCRuntime.tryParse(value))
1175 Opts.setGC(LangOptions::GCOnly);
1177 Opts.setGC(LangOptions::HybridGC);
1179 Opts.ObjCAutoRefCount = 1;
1180 if (!Opts.ObjCRuntime.allowsARC())
1185 Opts.ObjCARCWeak = 1;
1187 Opts.ObjCARCWeak = Opts.ObjCRuntime.allowsWeak();
1191 Opts.ObjCInferRelatedResultType = 0;
1195 Opts.GNUInline = 1;
1198 if (!Opts.CPlusPlus)
1201 Opts.AppleKext = 1;
1205 Opts.ObjCGCBitmapPrint = 1;
1207 Opts.NoConstantCFStrings = 1;
1210 Opts.AltiVec = 1;
1213 Opts.POSIXThreads = 1;
1217 Opts.setValueVisibilityMode(parseVisibility(visOpt, Args, Diags));
1219 Opts.setValueVisibilityMode(DefaultVisibility);
1224 Opts.setTypeVisibilityMode(parseVisibility(typeVisOpt, Args, Diags));
1226 Opts.setTypeVisibilityMode(Opts.getValueVisibilityMode());
1230 Opts.InlineVisibilityHidden = 1;
1233 Opts.setSignedOverflowBehavior(LangOptions::SOB_Trapping);
1235 Opts.OverflowHandler =
1239 Opts.setSignedOverflowBehavior(LangOptions::SOB_Defined);
1242 Opts.Trigraphs = 1;
1244 Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers,
1246 Opts.DollarIdents);
1247 Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings);
1248 Opts.MicrosoftExt
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,
1256 Opts.ConstStrings);
1258 Opts.LaxVectorConversions = 0;
1260 Opts.ThreadsafeStatics = 0;
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);
1283 Opts.InstantiationDepth =
1285 Opts.ConstexprCallDepth =
1287 Opts.ConstexprStepLimit =
1289 Opts.BracketDepth = getLastArgIntValue(Args, OPT_fbracket_depth, 256, Diags);
1290 Opts.DelayedTemplateParsing = Args.hasArg(OPT_fdelayed_template_parsing);
1291 Opts.NumLargeByValueCopy =
1293 Opts.MSBitfields = Args.hasArg(OPT_mms_bitfields);
1294 Opts.ObjCConstantStringClass =
1296 Opts.ObjCDefaultSynthProperties =
1298 Opts.EncodeExtendedBlockSig =
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);
1306 Opts.DumpRecordLayouts = Opts.DumpRecordLayoutsSimple
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,
1329 Opts.Deprecated);
1334 Opts.Optimize = Opt != 0;
1335 Opts.OptimizeSize = OptSize != 0;
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);
1345 Opts.RetainCommentsFromSystemHeaders =
1354 case 0: Opts.setStackProtector(LangOptions::SSPOff); break;
1355 case 1: Opts.setStackProtector(LangOptions::SSPOn); break;
1356 case 2: Opts.setStackProtector(LangOptions::SSPReq); break;
1362 // Since the Opts.Sanitize* values are bitfields, it's a little tricky to
1379 Opts.Sanitize.ID = true; \
1391 static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
1395 Opts.ImplicitPCHInclude = Args.getLastArgValue(OPT_include_pch);
1396 Opts.ImplicitPTHInclude = Args.getLastArgValue(OPT_include_pth);
1398 Opts.TokenCache = A->getValue();
1400 Opts.TokenCache = Opts.ImplicitPTHInclude;
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);
1409 Opts.DeserializedPCHDeclsToErrorOn.insert(A->getValue());
1423 Opts.PrecompiledPreambleBytes.first = Bytes;
1424 Opts.PrecompiledPreambleBytes.second = (EndOfLine != 0);
1432 Opts.addMacroDef((*it)->getValue());
1434 Opts.addMacroUndef((*it)->getValue());
1437 Opts.MacroIncludes = Args.getAllArgValues(OPT_imacros);
1443 Opts.Includes.push_back(A->getValue());
1449 Opts.ChainedIncludes.push_back(A->getValue());
1454 Opts.Includes.push_back("altivec.h");
1467 Opts.addRemappedFile(Split.first, Split.second);
1480 Opts.ObjCXXARCStandardLibrary = (ObjCXXARCStandardLibraryKind)Library;
1484 static void ParsePreprocessorOutputArgs(PreprocessorOutputOptions &Opts,
1514 Opts.ShowCPP = 0;
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));
1545 if (Opts.Triple.empty())
1546 Opts.Triple = llvm::sys::getDefaultTargetTriple();
1558 OwningPtr<OptTable> Opts(createDriverOptTable());
1562 Opts->ParseArgs(ArgBegin, ArgEnd, MissingArgIndex, MissingArgCount,