• Home
  • Raw
  • Download

Lines Matching refs:Opts

67 static void AnalyzerOptsToArgs(const AnalyzerOptions &Opts,  in AnalyzerOptsToArgs()  argument
69 if (Opts.ShowCheckerHelp) in AnalyzerOptsToArgs()
71 if (Opts.AnalysisStoreOpt != BasicStoreModel) { in AnalyzerOptsToArgs()
73 Res.push_back(getAnalysisStoreName(Opts.AnalysisStoreOpt)); in AnalyzerOptsToArgs()
75 if (Opts.AnalysisConstraintsOpt != RangeConstraintsModel) { in AnalyzerOptsToArgs()
77 Res.push_back(getAnalysisConstraintName(Opts.AnalysisConstraintsOpt)); in AnalyzerOptsToArgs()
79 if (Opts.AnalysisDiagOpt != PD_HTML) { in AnalyzerOptsToArgs()
81 Res.push_back(getAnalysisDiagClientName(Opts.AnalysisDiagOpt)); in AnalyzerOptsToArgs()
83 if (!Opts.AnalyzeSpecificFunction.empty()) { in AnalyzerOptsToArgs()
85 Res.push_back(Opts.AnalyzeSpecificFunction); in AnalyzerOptsToArgs()
87 if (Opts.AnalyzeAll) in AnalyzerOptsToArgs()
89 if (Opts.AnalyzerDisplayProgress) in AnalyzerOptsToArgs()
91 if (Opts.AnalyzeNestedBlocks) in AnalyzerOptsToArgs()
93 if (Opts.EagerlyAssume) in AnalyzerOptsToArgs()
95 if (!Opts.PurgeDead) in AnalyzerOptsToArgs()
97 if (Opts.TrimGraph) in AnalyzerOptsToArgs()
99 if (Opts.VisualizeEGDot) in AnalyzerOptsToArgs()
101 if (Opts.VisualizeEGUbi) in AnalyzerOptsToArgs()
104 for (unsigned i = 0, e = Opts.CheckersControlList.size(); i != e; ++i) { in AnalyzerOptsToArgs()
105 const std::pair<std::string, bool> &opt = Opts.CheckersControlList[i]; in AnalyzerOptsToArgs()
114 static void CodeGenOptsToArgs(const CodeGenOptions &Opts, in CodeGenOptsToArgs() argument
116 if (Opts.DebugInfo) in CodeGenOptsToArgs()
118 if (Opts.DisableLLVMOpts) in CodeGenOptsToArgs()
120 if (Opts.DisableRedZone) in CodeGenOptsToArgs()
122 if (!Opts.DwarfDebugFlags.empty()) { in CodeGenOptsToArgs()
124 Res.push_back(Opts.DwarfDebugFlags); in CodeGenOptsToArgs()
126 if (Opts.ObjCRuntimeHasARC) in CodeGenOptsToArgs()
128 if (Opts.ObjCRuntimeHasTerminate) in CodeGenOptsToArgs()
130 if (Opts.EmitGcovArcs) in CodeGenOptsToArgs()
132 if (Opts.EmitGcovNotes) in CodeGenOptsToArgs()
134 if (!Opts.MergeAllConstants) in CodeGenOptsToArgs()
136 if (Opts.NoCommon) in CodeGenOptsToArgs()
138 if (Opts.ForbidGuardVariables) in CodeGenOptsToArgs()
140 if (Opts.UseRegisterSizedBitfieldAccess) in CodeGenOptsToArgs()
142 if (Opts.NoImplicitFloat) in CodeGenOptsToArgs()
144 if (Opts.OmitLeafFramePointer) in CodeGenOptsToArgs()
146 if (Opts.OptimizeSize) { in CodeGenOptsToArgs()
147 assert(Opts.OptimizationLevel == 2 && "Invalid options!"); in CodeGenOptsToArgs()
148 Opts.OptimizeSize == 1 ? Res.push_back("-Os") : Res.push_back("-Oz"); in CodeGenOptsToArgs()
149 } else if (Opts.OptimizationLevel != 0) in CodeGenOptsToArgs()
150 Res.push_back("-O" + llvm::utostr(Opts.OptimizationLevel)); in CodeGenOptsToArgs()
151 if (!Opts.MainFileName.empty()) { in CodeGenOptsToArgs()
153 Res.push_back(Opts.MainFileName); in CodeGenOptsToArgs()
162 if (Opts.UnrollLoops) in CodeGenOptsToArgs()
164 if (Opts.DataSections) in CodeGenOptsToArgs()
166 if (Opts.FunctionSections) in CodeGenOptsToArgs()
168 if (Opts.AsmVerbose) in CodeGenOptsToArgs()
170 if (!Opts.CodeModel.empty()) { in CodeGenOptsToArgs()
172 Res.push_back(Opts.CodeModel); in CodeGenOptsToArgs()
174 if (!Opts.CXAAtExit) in CodeGenOptsToArgs()
176 if (Opts.CXXCtorDtorAliases) in CodeGenOptsToArgs()
178 if (Opts.ObjCAutoRefCountExceptions) in CodeGenOptsToArgs()
180 if (!Opts.DebugPass.empty()) { in CodeGenOptsToArgs()
182 Res.push_back(Opts.DebugPass); in CodeGenOptsToArgs()
184 if (Opts.DisableFPElim) in CodeGenOptsToArgs()
186 if (!Opts.FloatABI.empty()) { in CodeGenOptsToArgs()
188 Res.push_back(Opts.FloatABI); in CodeGenOptsToArgs()
190 if (!Opts.LimitFloatPrecision.empty()) { in CodeGenOptsToArgs()
192 Res.push_back(Opts.LimitFloatPrecision); in CodeGenOptsToArgs()
194 if (Opts.NoZeroInitializedInBSS) in CodeGenOptsToArgs()
196 switch (Opts.getObjCDispatchMethod()) { in CodeGenOptsToArgs()
206 if (Opts.NumRegisterParameters) { in CodeGenOptsToArgs()
208 Res.push_back(llvm::utostr(Opts.NumRegisterParameters)); in CodeGenOptsToArgs()
210 if (Opts.NoExecStack) in CodeGenOptsToArgs()
212 if (Opts.RelaxAll) in CodeGenOptsToArgs()
214 if (Opts.SaveTempLabels) in CodeGenOptsToArgs()
216 if (Opts.NoDwarf2CFIAsm) in CodeGenOptsToArgs()
218 if (Opts.SoftFloat) in CodeGenOptsToArgs()
220 if (Opts.UnwindTables) in CodeGenOptsToArgs()
222 if (Opts.RelocationModel != "pic") { in CodeGenOptsToArgs()
224 Res.push_back(Opts.RelocationModel); in CodeGenOptsToArgs()
226 if (!Opts.VerifyModule) in CodeGenOptsToArgs()
228 for (unsigned i = 0, e = Opts.BackendOptions.size(); i != e; ++i) { in CodeGenOptsToArgs()
230 Res.push_back(Opts.BackendOptions[i]); in CodeGenOptsToArgs()
234 static void DependencyOutputOptsToArgs(const DependencyOutputOptions &Opts, in DependencyOutputOptsToArgs() argument
236 if (Opts.IncludeSystemHeaders) in DependencyOutputOptsToArgs()
238 if (Opts.ShowHeaderIncludes) in DependencyOutputOptsToArgs()
240 if (!Opts.HeaderIncludeOutputFile.empty()) { in DependencyOutputOptsToArgs()
242 Res.push_back(Opts.HeaderIncludeOutputFile); in DependencyOutputOptsToArgs()
244 if (Opts.UsePhonyTargets) in DependencyOutputOptsToArgs()
246 if (!Opts.OutputFile.empty()) { in DependencyOutputOptsToArgs()
248 Res.push_back(Opts.OutputFile); in DependencyOutputOptsToArgs()
250 for (unsigned i = 0, e = Opts.Targets.size(); i != e; ++i) { in DependencyOutputOptsToArgs()
252 Res.push_back(Opts.Targets[i]); in DependencyOutputOptsToArgs()
256 static void DiagnosticOptsToArgs(const DiagnosticOptions &Opts, in DiagnosticOptsToArgs() argument
258 if (Opts.IgnoreWarnings) in DiagnosticOptsToArgs()
260 if (Opts.NoRewriteMacros) in DiagnosticOptsToArgs()
262 if (Opts.Pedantic) in DiagnosticOptsToArgs()
264 if (Opts.PedanticErrors) in DiagnosticOptsToArgs()
266 if (!Opts.ShowColumn) in DiagnosticOptsToArgs()
268 if (!Opts.ShowLocation) in DiagnosticOptsToArgs()
270 if (!Opts.ShowCarets) in DiagnosticOptsToArgs()
272 if (!Opts.ShowFixits) in DiagnosticOptsToArgs()
274 if (Opts.ShowSourceRanges) in DiagnosticOptsToArgs()
276 if (Opts.ShowParseableFixits) in DiagnosticOptsToArgs()
278 if (Opts.ShowColors) in DiagnosticOptsToArgs()
280 if (Opts.VerifyDiagnostics) in DiagnosticOptsToArgs()
282 if (Opts.ShowNames) in DiagnosticOptsToArgs()
284 if (Opts.ShowOptionNames) in DiagnosticOptsToArgs()
286 if (Opts.ShowCategories == 1) in DiagnosticOptsToArgs()
288 else if (Opts.ShowCategories == 2) in DiagnosticOptsToArgs()
290 switch (Opts.Format) { in DiagnosticOptsToArgs()
298 if (Opts.ErrorLimit) { in DiagnosticOptsToArgs()
300 Res.push_back(llvm::utostr(Opts.ErrorLimit)); in DiagnosticOptsToArgs()
302 if (!Opts.DiagnosticLogFile.empty()) { in DiagnosticOptsToArgs()
304 Res.push_back(Opts.DiagnosticLogFile); in DiagnosticOptsToArgs()
306 if (Opts.MacroBacktraceLimit in DiagnosticOptsToArgs()
309 Res.push_back(llvm::utostr(Opts.MacroBacktraceLimit)); in DiagnosticOptsToArgs()
311 if (Opts.TemplateBacktraceLimit in DiagnosticOptsToArgs()
314 Res.push_back(llvm::utostr(Opts.TemplateBacktraceLimit)); in DiagnosticOptsToArgs()
317 if (Opts.TabStop != DiagnosticOptions::DefaultTabStop) { in DiagnosticOptsToArgs()
319 Res.push_back(llvm::utostr(Opts.TabStop)); in DiagnosticOptsToArgs()
321 if (Opts.MessageLength) { in DiagnosticOptsToArgs()
323 Res.push_back(llvm::utostr(Opts.MessageLength)); in DiagnosticOptsToArgs()
325 if (!Opts.DumpBuildInformation.empty()) { in DiagnosticOptsToArgs()
327 Res.push_back(Opts.DumpBuildInformation); in DiagnosticOptsToArgs()
329 for (unsigned i = 0, e = Opts.Warnings.size(); i != e; ++i) in DiagnosticOptsToArgs()
330 Res.push_back("-W" + Opts.Warnings[i]); in DiagnosticOptsToArgs()
393 static void FileSystemOptsToArgs(const FileSystemOptions &Opts, in FileSystemOptsToArgs() argument
395 if (!Opts.WorkingDir.empty()) { in FileSystemOptsToArgs()
397 Res.push_back(Opts.WorkingDir); in FileSystemOptsToArgs()
401 static void FrontendOptsToArgs(const FrontendOptions &Opts, in FrontendOptsToArgs() argument
403 if (Opts.DisableFree) in FrontendOptsToArgs()
405 if (Opts.RelocatablePCH) in FrontendOptsToArgs()
407 if (Opts.ChainedPCH) in FrontendOptsToArgs()
409 if (Opts.ShowHelp) in FrontendOptsToArgs()
411 if (Opts.ShowMacrosInCodeCompletion) in FrontendOptsToArgs()
413 if (Opts.ShowCodePatternsInCodeCompletion) in FrontendOptsToArgs()
415 if (!Opts.ShowGlobalSymbolsInCodeCompletion) in FrontendOptsToArgs()
417 if (Opts.ShowStats) in FrontendOptsToArgs()
419 if (Opts.ShowTimers) in FrontendOptsToArgs()
421 if (Opts.ShowVersion) in FrontendOptsToArgs()
423 if (Opts.FixWhatYouCan) in FrontendOptsToArgs()
425 switch (Opts.ARCMTAction) { in FrontendOptsToArgs()
438 if (!Opts.ARCMTMigrateDir.empty()) { in FrontendOptsToArgs()
440 Res.push_back(Opts.ARCMTMigrateDir); in FrontendOptsToArgs()
442 if (!Opts.ARCMTMigrateReportOut.empty()) { in FrontendOptsToArgs()
444 Res.push_back(Opts.ARCMTMigrateReportOut); in FrontendOptsToArgs()
446 if (Opts.ARCMTMigrateEmitARCErrors) in FrontendOptsToArgs()
450 for (unsigned i = 0, e = Opts.Inputs.size(); i != e; ++i) in FrontendOptsToArgs()
451 if (FrontendOptions::getInputKindForExtension(Opts.Inputs[i].second) != in FrontendOptsToArgs()
452 Opts.Inputs[i].first) in FrontendOptsToArgs()
456 Res.push_back(getInputKindName(Opts.Inputs[0].first)); in FrontendOptsToArgs()
458 for (unsigned i = 0, e = Opts.Inputs.size(); i != e; ++i) { in FrontendOptsToArgs()
459 assert((!NeedLang || Opts.Inputs[i].first == Opts.Inputs[0].first) && in FrontendOptsToArgs()
461 Res.push_back(Opts.Inputs[i].second); in FrontendOptsToArgs()
464 if (!Opts.OutputFile.empty()) { in FrontendOptsToArgs()
466 Res.push_back(Opts.OutputFile); in FrontendOptsToArgs()
468 if (!Opts.CodeCompletionAt.FileName.empty()) { in FrontendOptsToArgs()
470 Res.push_back(Opts.CodeCompletionAt.FileName + ":" + in FrontendOptsToArgs()
471 llvm::utostr(Opts.CodeCompletionAt.Line) + ":" + in FrontendOptsToArgs()
472 llvm::utostr(Opts.CodeCompletionAt.Column)); in FrontendOptsToArgs()
474 if (Opts.ProgramAction != frontend::PluginAction) in FrontendOptsToArgs()
475 Res.push_back(getActionName(Opts.ProgramAction)); in FrontendOptsToArgs()
476 if (!Opts.ActionName.empty()) { in FrontendOptsToArgs()
478 Res.push_back(Opts.ActionName); in FrontendOptsToArgs()
479 for(unsigned i = 0, e = Opts.PluginArgs.size(); i != e; ++i) { in FrontendOptsToArgs()
480 Res.push_back("-plugin-arg-" + Opts.ActionName); in FrontendOptsToArgs()
481 Res.push_back(Opts.PluginArgs[i]); in FrontendOptsToArgs()
484 for (unsigned i = 0, e = Opts.Plugins.size(); i != e; ++i) { in FrontendOptsToArgs()
486 Res.push_back(Opts.Plugins[i]); in FrontendOptsToArgs()
488 for (unsigned i = 0, e = Opts.AddPluginActions.size(); i != e; ++i) { in FrontendOptsToArgs()
490 Res.push_back(Opts.AddPluginActions[i]); in FrontendOptsToArgs()
491 for(unsigned ai = 0, ae = Opts.AddPluginArgs.size(); ai != ae; ++ai) { in FrontendOptsToArgs()
492 Res.push_back("-plugin-arg-" + Opts.AddPluginActions[i]); in FrontendOptsToArgs()
493 Res.push_back(Opts.AddPluginArgs[i][ai]); in FrontendOptsToArgs()
496 for (unsigned i = 0, e = Opts.ASTMergeFiles.size(); i != e; ++i) { in FrontendOptsToArgs()
498 Res.push_back(Opts.ASTMergeFiles[i]); in FrontendOptsToArgs()
500 for (unsigned i = 0, e = Opts.Modules.size(); i != e; ++i) { in FrontendOptsToArgs()
502 Res.push_back(Opts.Modules[i]); in FrontendOptsToArgs()
504 for (unsigned i = 0, e = Opts.LLVMArgs.size(); i != e; ++i) { in FrontendOptsToArgs()
506 Res.push_back(Opts.LLVMArgs[i]); in FrontendOptsToArgs()
510 static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, in HeaderSearchOptsToArgs() argument
512 if (Opts.Sysroot != "/") { in HeaderSearchOptsToArgs()
514 Res.push_back(Opts.Sysroot); in HeaderSearchOptsToArgs()
518 for (unsigned i = 0, e = Opts.UserEntries.size(); i != e; ++i) { in HeaderSearchOptsToArgs()
519 const HeaderSearchOptions::Entry &E = Opts.UserEntries[i]; in HeaderSearchOptsToArgs()
544 if (!Opts.EnvIncPath.empty()) { in HeaderSearchOptsToArgs()
548 if (!Opts.CEnvIncPath.empty()) { in HeaderSearchOptsToArgs()
552 if (!Opts.ObjCEnvIncPath.empty()) { in HeaderSearchOptsToArgs()
556 if (!Opts.CXXEnvIncPath.empty()) { in HeaderSearchOptsToArgs()
560 if (!Opts.ObjCXXEnvIncPath.empty()) { in HeaderSearchOptsToArgs()
564 if (!Opts.ResourceDir.empty()) { in HeaderSearchOptsToArgs()
566 Res.push_back(Opts.ResourceDir); in HeaderSearchOptsToArgs()
568 if (!Opts.UseStandardIncludes) in HeaderSearchOptsToArgs()
570 if (!Opts.UseStandardCXXIncludes) in HeaderSearchOptsToArgs()
572 if (Opts.UseLibcxx) in HeaderSearchOptsToArgs()
574 if (Opts.Verbose) in HeaderSearchOptsToArgs()
578 static void LangOptsToArgs(const LangOptions &Opts, in LangOptsToArgs() argument
590 if (Opts.Trigraphs) in LangOptsToArgs()
596 if (Opts.DollarIdents) in LangOptsToArgs()
598 if (Opts.GNUMode && !Opts.GNUKeywords) in LangOptsToArgs()
600 if (!Opts.GNUMode && Opts.GNUKeywords) in LangOptsToArgs()
602 if (Opts.Microsoft) in LangOptsToArgs()
604 if (Opts.MSCVersion != 0) in LangOptsToArgs()
605 Res.push_back("-fmsc-version=" + llvm::utostr(Opts.MSCVersion)); in LangOptsToArgs()
606 if (Opts.Borland) in LangOptsToArgs()
608 if (Opts.ObjCNonFragileABI) in LangOptsToArgs()
610 if (Opts.ObjCNonFragileABI2) in LangOptsToArgs()
612 if (Opts.ObjCDefaultSynthProperties) in LangOptsToArgs()
615 if (!Opts.CXXOperatorNames) in LangOptsToArgs()
617 if (Opts.PascalStrings) in LangOptsToArgs()
619 if (Opts.CatchUndefined) in LangOptsToArgs()
621 if (Opts.WritableStrings) in LangOptsToArgs()
623 if (Opts.ConstStrings) in LangOptsToArgs()
625 if (!Opts.LaxVectorConversions) in LangOptsToArgs()
627 if (Opts.AltiVec) in LangOptsToArgs()
629 if (Opts.Exceptions) in LangOptsToArgs()
631 if (Opts.ObjCExceptions) in LangOptsToArgs()
633 if (Opts.CXXExceptions) in LangOptsToArgs()
635 if (Opts.SjLjExceptions) in LangOptsToArgs()
637 if (Opts.TraditionalCPP) in LangOptsToArgs()
639 if (!Opts.RTTI) in LangOptsToArgs()
641 if (Opts.MSBitfields) in LangOptsToArgs()
643 if (!Opts.NeXTRuntime) in LangOptsToArgs()
645 if (Opts.Freestanding) in LangOptsToArgs()
647 if (Opts.NoBuiltin) in LangOptsToArgs()
649 if (!Opts.AssumeSaneOperatorNew) in LangOptsToArgs()
651 if (!Opts.ThreadsafeStatics) in LangOptsToArgs()
653 if (Opts.POSIXThreads) in LangOptsToArgs()
655 if (Opts.Blocks) in LangOptsToArgs()
657 if (Opts.EmitAllDecls) in LangOptsToArgs()
659 if (Opts.MathErrno) in LangOptsToArgs()
661 switch (Opts.getSignedOverflowBehavior()) { in LangOptsToArgs()
666 if (!Opts.OverflowHandler.empty()) { in LangOptsToArgs()
668 Res.push_back(Opts.OverflowHandler); in LangOptsToArgs()
671 if (Opts.HeinousExtensions) in LangOptsToArgs()
675 if (Opts.Static) in LangOptsToArgs()
677 if (Opts.DumpRecordLayouts) in LangOptsToArgs()
679 if (Opts.DumpVTableLayouts) in LangOptsToArgs()
681 if (Opts.NoBitFieldTypeAlign) in LangOptsToArgs()
683 if (Opts.PICLevel) { in LangOptsToArgs()
685 Res.push_back(llvm::utostr(Opts.PICLevel)); in LangOptsToArgs()
687 if (Opts.ObjCGCBitmapPrint) in LangOptsToArgs()
689 if (Opts.NoConstantCFStrings) in LangOptsToArgs()
691 if (!Opts.AccessControl) in LangOptsToArgs()
693 if (!Opts.CharIsSigned) in LangOptsToArgs()
695 if (Opts.ShortWChar) in LangOptsToArgs()
697 if (!Opts.ElideConstructors) in LangOptsToArgs()
699 if (Opts.getGCMode() != LangOptions::NonGC) { in LangOptsToArgs()
700 if (Opts.getGCMode() == LangOptions::HybridGC) { in LangOptsToArgs()
703 assert(Opts.getGCMode() == LangOptions::GCOnly && "Invalid GC mode!"); in LangOptsToArgs()
707 if (Opts.ObjCAutoRefCount) in LangOptsToArgs()
709 if (Opts.ObjCRuntimeHasWeak) in LangOptsToArgs()
711 if (!Opts.ObjCInferRelatedResultType) in LangOptsToArgs()
714 if (Opts.AppleKext) in LangOptsToArgs()
717 if (Opts.getVisibilityMode() != DefaultVisibility) { in LangOptsToArgs()
719 if (Opts.getVisibilityMode() == HiddenVisibility) { in LangOptsToArgs()
722 assert(Opts.getVisibilityMode() == ProtectedVisibility && in LangOptsToArgs()
727 if (Opts.InlineVisibilityHidden) in LangOptsToArgs()
730 if (Opts.getStackProtectorMode() != 0) { in LangOptsToArgs()
732 Res.push_back(llvm::utostr(Opts.getStackProtectorMode())); in LangOptsToArgs()
734 if (Opts.InstantiationDepth != DefaultLangOpts.InstantiationDepth) { in LangOptsToArgs()
736 Res.push_back(llvm::utostr(Opts.InstantiationDepth)); in LangOptsToArgs()
738 if (!Opts.ObjCConstantStringClass.empty()) { in LangOptsToArgs()
740 Res.push_back(Opts.ObjCConstantStringClass); in LangOptsToArgs()
742 if (Opts.FakeAddressSpaceMap) in LangOptsToArgs()
744 if (Opts.ParseUnknownAnytype) in LangOptsToArgs()
746 if (Opts.DebuggerSupport) in LangOptsToArgs()
748 if (Opts.DelayedTemplateParsing) in LangOptsToArgs()
750 if (Opts.Deprecated) in LangOptsToArgs()
754 static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts, in PreprocessorOptsToArgs() argument
756 for (unsigned i = 0, e = Opts.Macros.size(); i != e; ++i) in PreprocessorOptsToArgs()
757 Res.push_back(std::string(Opts.Macros[i].second ? "-U" : "-D") + in PreprocessorOptsToArgs()
758 Opts.Macros[i].first); in PreprocessorOptsToArgs()
759 for (unsigned i = 0, e = Opts.Includes.size(); i != e; ++i) { in PreprocessorOptsToArgs()
762 Res.push_back(Opts.Includes[i]); in PreprocessorOptsToArgs()
764 for (unsigned i = 0, e = Opts.MacroIncludes.size(); i != e; ++i) { in PreprocessorOptsToArgs()
766 Res.push_back(Opts.MacroIncludes[i]); in PreprocessorOptsToArgs()
768 if (!Opts.UsePredefines) in PreprocessorOptsToArgs()
770 if (Opts.DetailedRecord) in PreprocessorOptsToArgs()
772 if (!Opts.ImplicitPCHInclude.empty()) { in PreprocessorOptsToArgs()
774 Res.push_back(Opts.ImplicitPCHInclude); in PreprocessorOptsToArgs()
776 if (!Opts.ImplicitPTHInclude.empty()) { in PreprocessorOptsToArgs()
778 Res.push_back(Opts.ImplicitPTHInclude); in PreprocessorOptsToArgs()
780 if (!Opts.TokenCache.empty()) { in PreprocessorOptsToArgs()
781 if (Opts.ImplicitPTHInclude.empty()) { in PreprocessorOptsToArgs()
783 Res.push_back(Opts.TokenCache); in PreprocessorOptsToArgs()
785 assert(Opts.ImplicitPTHInclude == Opts.TokenCache && in PreprocessorOptsToArgs()
788 for (unsigned i = 0, e = Opts.ChainedIncludes.size(); i != e; ++i) { in PreprocessorOptsToArgs()
790 Res.push_back(Opts.ChainedIncludes[i]); in PreprocessorOptsToArgs()
792 for (unsigned i = 0, e = Opts.RemappedFiles.size(); i != e; ++i) { in PreprocessorOptsToArgs()
794 Res.push_back(Opts.RemappedFiles[i].first + ";" + in PreprocessorOptsToArgs()
795 Opts.RemappedFiles[i].second); in PreprocessorOptsToArgs()
799 static void PreprocessorOutputOptsToArgs(const PreprocessorOutputOptions &Opts, in PreprocessorOutputOptsToArgs() argument
801 if (!Opts.ShowCPP && !Opts.ShowMacros) in PreprocessorOutputOptsToArgs()
804 if (Opts.ShowCPP && Opts.ShowMacros) in PreprocessorOutputOptsToArgs()
806 else if (!Opts.ShowCPP && Opts.ShowMacros) in PreprocessorOutputOptsToArgs()
809 if (!Opts.ShowLineMarkers) in PreprocessorOutputOptsToArgs()
811 if (Opts.ShowComments) in PreprocessorOutputOptsToArgs()
813 if (Opts.ShowMacroComments) in PreprocessorOutputOptsToArgs()
817 static void TargetOptsToArgs(const TargetOptions &Opts, in TargetOptsToArgs() argument
820 Res.push_back(Opts.Triple); in TargetOptsToArgs()
821 if (!Opts.CPU.empty()) { in TargetOptsToArgs()
823 Res.push_back(Opts.CPU); in TargetOptsToArgs()
825 if (!Opts.ABI.empty()) { in TargetOptsToArgs()
827 Res.push_back(Opts.ABI); in TargetOptsToArgs()
829 if (!Opts.LinkerVersion.empty()) { in TargetOptsToArgs()
831 Res.push_back(Opts.LinkerVersion); in TargetOptsToArgs()
833 if (!Opts.CXXABI.empty()) { in TargetOptsToArgs()
835 Res.push_back(Opts.CXXABI); in TargetOptsToArgs()
837 for (unsigned i = 0, e = Opts.Features.size(); i != e; ++i) { in TargetOptsToArgs()
839 Res.push_back(Opts.Features[i]); in TargetOptsToArgs()
876 static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, in ParseAnalyzerArgs() argument
892 Opts.AnalysisStoreOpt = Value; in ParseAnalyzerArgs()
907 Opts.AnalysisConstraintsOpt = Value; in ParseAnalyzerArgs()
922 Opts.AnalysisDiagOpt = Value; in ParseAnalyzerArgs()
925 Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help); in ParseAnalyzerArgs()
926 Opts.VisualizeEGDot = Args.hasArg(OPT_analyzer_viz_egraph_graphviz); in ParseAnalyzerArgs()
927 Opts.VisualizeEGUbi = Args.hasArg(OPT_analyzer_viz_egraph_ubigraph); in ParseAnalyzerArgs()
928 Opts.AnalyzeAll = Args.hasArg(OPT_analyzer_opt_analyze_headers); in ParseAnalyzerArgs()
929 Opts.AnalyzerDisplayProgress = Args.hasArg(OPT_analyzer_display_progress); in ParseAnalyzerArgs()
930 Opts.AnalyzeNestedBlocks = in ParseAnalyzerArgs()
932 Opts.PurgeDead = !Args.hasArg(OPT_analyzer_no_purge_dead); in ParseAnalyzerArgs()
933 Opts.EagerlyAssume = Args.hasArg(OPT_analyzer_eagerly_assume); in ParseAnalyzerArgs()
934 Opts.AnalyzeSpecificFunction = Args.getLastArgValue(OPT_analyze_function); in ParseAnalyzerArgs()
935 Opts.UnoptimizedCFG = Args.hasArg(OPT_analysis_UnoptimizedCFG); in ParseAnalyzerArgs()
936 Opts.CFGAddImplicitDtors = Args.hasArg(OPT_analysis_CFGAddImplicitDtors); in ParseAnalyzerArgs()
937 Opts.CFGAddInitializers = Args.hasArg(OPT_analysis_CFGAddInitializers); in ParseAnalyzerArgs()
938 Opts.TrimGraph = Args.hasArg(OPT_trim_egraph); in ParseAnalyzerArgs()
939 Opts.MaxNodes = Args.getLastArgIntValue(OPT_analyzer_max_nodes, 150000,Diags); in ParseAnalyzerArgs()
940 Opts.MaxLoop = Args.getLastArgIntValue(OPT_analyzer_max_loop, 4, Diags); in ParseAnalyzerArgs()
941 Opts.EagerlyTrimEGraph = !Args.hasArg(OPT_analyzer_no_eagerly_trim_egraph); in ParseAnalyzerArgs()
942 Opts.InlineCall = Args.hasArg(OPT_analyzer_inline_call); in ParseAnalyzerArgs()
944 Opts.CheckersControlList.clear(); in ParseAnalyzerArgs()
957 Opts.CheckersControlList.push_back(std::make_pair(checkers[i], enable)); in ParseAnalyzerArgs()
961 static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, in ParseCodeGenArgs() argument
965 Opts.OptimizationLevel = getOptimizationLevel(Args, IK, Diags); in ParseCodeGenArgs()
966 if (Opts.OptimizationLevel > 3) { in ParseCodeGenArgs()
968 << Args.getLastArg(OPT_O)->getAsString(Args) << Opts.OptimizationLevel; in ParseCodeGenArgs()
969 Opts.OptimizationLevel = 3; in ParseCodeGenArgs()
973 Opts.Inlining = (Opts.OptimizationLevel > 1) ? CodeGenOptions::NormalInlining in ParseCodeGenArgs()
976 Opts.DebugInfo = Args.hasArg(OPT_g); in ParseCodeGenArgs()
977 Opts.LimitDebugInfo = Args.hasArg(OPT_flimit_debug_info); in ParseCodeGenArgs()
978 Opts.DisableLLVMOpts = Args.hasArg(OPT_disable_llvm_optzns); in ParseCodeGenArgs()
979 Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone); in ParseCodeGenArgs()
980 Opts.ForbidGuardVariables = Args.hasArg(OPT_fforbid_guard_variables); in ParseCodeGenArgs()
981 Opts.UseRegisterSizedBitfieldAccess = Args.hasArg( in ParseCodeGenArgs()
983 Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing); in ParseCodeGenArgs()
984 Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags); in ParseCodeGenArgs()
985 Opts.MergeAllConstants = !Args.hasArg(OPT_fno_merge_all_constants); in ParseCodeGenArgs()
986 Opts.NoCommon = Args.hasArg(OPT_fno_common); in ParseCodeGenArgs()
987 Opts.NoImplicitFloat = Args.hasArg(OPT_no_implicit_float); in ParseCodeGenArgs()
988 Opts.OptimizeSize = Args.hasArg(OPT_Os); in ParseCodeGenArgs()
989 Opts.OptimizeSize = Args.hasArg(OPT_Oz) ? 2 : Opts.OptimizeSize; in ParseCodeGenArgs()
990 Opts.SimplifyLibCalls = !(Args.hasArg(OPT_fno_builtin) || in ParseCodeGenArgs()
992 Opts.UnrollLoops = Args.hasArg(OPT_funroll_loops) || in ParseCodeGenArgs()
993 (Opts.OptimizationLevel > 1 && !Opts.OptimizeSize); in ParseCodeGenArgs()
995 Opts.AsmVerbose = Args.hasArg(OPT_masm_verbose); in ParseCodeGenArgs()
996 Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions); in ParseCodeGenArgs()
997 Opts.ObjCRuntimeHasARC = Args.hasArg(OPT_fobjc_runtime_has_arc); in ParseCodeGenArgs()
998 Opts.ObjCRuntimeHasTerminate = Args.hasArg(OPT_fobjc_runtime_has_terminate); in ParseCodeGenArgs()
999 Opts.CXAAtExit = !Args.hasArg(OPT_fno_use_cxa_atexit); in ParseCodeGenArgs()
1000 Opts.CXXCtorDtorAliases = Args.hasArg(OPT_mconstructor_aliases); in ParseCodeGenArgs()
1001 Opts.CodeModel = Args.getLastArgValue(OPT_mcode_model); in ParseCodeGenArgs()
1002 Opts.DebugPass = Args.getLastArgValue(OPT_mdebug_pass); in ParseCodeGenArgs()
1003 Opts.DisableFPElim = Args.hasArg(OPT_mdisable_fp_elim); in ParseCodeGenArgs()
1004 Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi); in ParseCodeGenArgs()
1005 Opts.HiddenWeakVTables = Args.hasArg(OPT_fhidden_weak_vtables); in ParseCodeGenArgs()
1006 Opts.LessPreciseFPMAD = Args.hasArg(OPT_cl_mad_enable); in ParseCodeGenArgs()
1007 Opts.LimitFloatPrecision = Args.getLastArgValue(OPT_mlimit_float_precision); in ParseCodeGenArgs()
1008 Opts.NoInfsFPMath = Opts.NoNaNsFPMath = Args.hasArg(OPT_cl_finite_math_only)|| in ParseCodeGenArgs()
1010 Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss); in ParseCodeGenArgs()
1011 Opts.BackendOptions = Args.getAllArgValues(OPT_backend_option); in ParseCodeGenArgs()
1012 Opts.NumRegisterParameters = Args.getLastArgIntValue(OPT_mregparm, 0, Diags); in ParseCodeGenArgs()
1013 Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack); in ParseCodeGenArgs()
1014 Opts.RelaxAll = Args.hasArg(OPT_mrelax_all); in ParseCodeGenArgs()
1015 Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer); in ParseCodeGenArgs()
1016 Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels); in ParseCodeGenArgs()
1017 Opts.NoDwarf2CFIAsm = Args.hasArg(OPT_fno_dwarf2_cfi_asm); in ParseCodeGenArgs()
1018 Opts.SoftFloat = Args.hasArg(OPT_msoft_float); in ParseCodeGenArgs()
1019 Opts.UnsafeFPMath = Args.hasArg(OPT_cl_unsafe_math_optimizations) || in ParseCodeGenArgs()
1021 Opts.UnwindTables = Args.hasArg(OPT_munwind_tables); in ParseCodeGenArgs()
1022 Opts.RelocationModel = Args.getLastArgValue(OPT_mrelocation_model, "pic"); in ParseCodeGenArgs()
1024 Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections); in ParseCodeGenArgs()
1025 Opts.DataSections = Args.hasArg(OPT_fdata_sections); in ParseCodeGenArgs()
1027 Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name); in ParseCodeGenArgs()
1028 Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier); in ParseCodeGenArgs()
1030 Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions); in ParseCodeGenArgs()
1031 Opts.InstrumentForProfiling = Args.hasArg(OPT_pg); in ParseCodeGenArgs()
1032 Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data); in ParseCodeGenArgs()
1033 Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes); in ParseCodeGenArgs()
1034 Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file); in ParseCodeGenArgs()
1046 Opts.ObjCDispatchMethod = Method; in ParseCodeGenArgs()
1050 static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts, in ParseDependencyOutputArgs() argument
1053 Opts.OutputFile = Args.getLastArgValue(OPT_dependency_file); in ParseDependencyOutputArgs()
1054 Opts.Targets = Args.getAllArgValues(OPT_MT); in ParseDependencyOutputArgs()
1055 Opts.IncludeSystemHeaders = Args.hasArg(OPT_sys_header_deps); in ParseDependencyOutputArgs()
1056 Opts.UsePhonyTargets = Args.hasArg(OPT_MP); in ParseDependencyOutputArgs()
1057 Opts.ShowHeaderIncludes = Args.hasArg(OPT_H); in ParseDependencyOutputArgs()
1058 Opts.HeaderIncludeOutputFile = Args.getLastArgValue(OPT_header_include_file); in ParseDependencyOutputArgs()
1059 Opts.AddMissingHeaderDeps = Args.hasArg(OPT_MG); in ParseDependencyOutputArgs()
1062 static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, in ParseDiagnosticArgs() argument
1065 Opts.DiagnosticLogFile = Args.getLastArgValue(OPT_diagnostic_log_file); in ParseDiagnosticArgs()
1066 Opts.IgnoreWarnings = Args.hasArg(OPT_w); in ParseDiagnosticArgs()
1067 Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros); in ParseDiagnosticArgs()
1068 Opts.Pedantic = Args.hasArg(OPT_pedantic); in ParseDiagnosticArgs()
1069 Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors); in ParseDiagnosticArgs()
1070 Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics); in ParseDiagnosticArgs()
1071 Opts.ShowColors = Args.hasArg(OPT_fcolor_diagnostics); in ParseDiagnosticArgs()
1072 Opts.ShowColumn = Args.hasFlag(OPT_fshow_column, in ParseDiagnosticArgs()
1075 Opts.ShowFixits = !Args.hasArg(OPT_fno_diagnostics_fixit_info); in ParseDiagnosticArgs()
1076 Opts.ShowLocation = !Args.hasArg(OPT_fno_show_source_location); in ParseDiagnosticArgs()
1077 Opts.ShowNames = Args.hasArg(OPT_fdiagnostics_show_name); in ParseDiagnosticArgs()
1078 Opts.ShowOptionNames = Args.hasArg(OPT_fdiagnostics_show_option); in ParseDiagnosticArgs()
1081 Opts.ShowNoteIncludeStack = false; in ParseDiagnosticArgs()
1085 Opts.ShowNoteIncludeStack = true; in ParseDiagnosticArgs()
1090 Opts.ShowOverloads = Diagnostic::Ovl_Best; in ParseDiagnosticArgs()
1092 Opts.ShowOverloads = Diagnostic::Ovl_All; in ParseDiagnosticArgs()
1101 Opts.ShowCategories = 0; in ParseDiagnosticArgs()
1103 Opts.ShowCategories = 1; in ParseDiagnosticArgs()
1105 Opts.ShowCategories = 2; in ParseDiagnosticArgs()
1114 Opts.Format = DiagnosticOptions::Clang; in ParseDiagnosticArgs()
1116 Opts.Format = DiagnosticOptions::Msvc; in ParseDiagnosticArgs()
1118 Opts.Format = DiagnosticOptions::Vi; in ParseDiagnosticArgs()
1124 Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info); in ParseDiagnosticArgs()
1125 Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits); in ParseDiagnosticArgs()
1126 Opts.VerifyDiagnostics = Args.hasArg(OPT_verify); in ParseDiagnosticArgs()
1127 Opts.ErrorLimit = Args.getLastArgIntValue(OPT_ferror_limit, 0, Diags); in ParseDiagnosticArgs()
1128 Opts.MacroBacktraceLimit in ParseDiagnosticArgs()
1131 Opts.TemplateBacktraceLimit in ParseDiagnosticArgs()
1135 Opts.TabStop = Args.getLastArgIntValue(OPT_ftabstop, in ParseDiagnosticArgs()
1137 if (Opts.TabStop == 0 || Opts.TabStop > DiagnosticOptions::MaxTabStop) { in ParseDiagnosticArgs()
1139 << Opts.TabStop << DiagnosticOptions::DefaultTabStop; in ParseDiagnosticArgs()
1140 Opts.TabStop = DiagnosticOptions::DefaultTabStop; in ParseDiagnosticArgs()
1142 Opts.MessageLength = Args.getLastArgIntValue(OPT_fmessage_length, 0, Diags); in ParseDiagnosticArgs()
1143 Opts.DumpBuildInformation = Args.getLastArgValue(OPT_dump_build_information); in ParseDiagnosticArgs()
1144 Opts.Warnings = Args.getAllArgValues(OPT_W); in ParseDiagnosticArgs()
1147 static void ParseFileSystemArgs(FileSystemOptions &Opts, ArgList &Args) { in ParseFileSystemArgs() argument
1148 Opts.WorkingDir = Args.getLastArgValue(OPT_working_directory); in ParseFileSystemArgs()
1151 static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, in ParseFrontendArgs() argument
1154 Opts.ProgramAction = frontend::ParseSyntaxOnly; in ParseFrontendArgs()
1160 Opts.ProgramAction = frontend::ASTDump; break; in ParseFrontendArgs()
1162 Opts.ProgramAction = frontend::ASTDumpXML; break; in ParseFrontendArgs()
1164 Opts.ProgramAction = frontend::ASTPrint; break; in ParseFrontendArgs()
1166 Opts.ProgramAction = frontend::ASTView; break; in ParseFrontendArgs()
1168 Opts.ProgramAction = frontend::DumpRawTokens; break; in ParseFrontendArgs()
1170 Opts.ProgramAction = frontend::DumpTokens; break; in ParseFrontendArgs()
1172 Opts.ProgramAction = frontend::EmitAssembly; break; in ParseFrontendArgs()
1174 Opts.ProgramAction = frontend::EmitBC; break; in ParseFrontendArgs()
1176 Opts.ProgramAction = frontend::EmitHTML; break; in ParseFrontendArgs()
1178 Opts.ProgramAction = frontend::EmitLLVM; break; in ParseFrontendArgs()
1180 Opts.ProgramAction = frontend::EmitLLVMOnly; break; in ParseFrontendArgs()
1182 Opts.ProgramAction = frontend::EmitCodeGenOnly; break; in ParseFrontendArgs()
1184 Opts.ProgramAction = frontend::EmitObj; break; in ParseFrontendArgs()
1186 Opts.FixItSuffix = A->getValue(Args); in ParseFrontendArgs()
1189 Opts.ProgramAction = frontend::FixIt; break; in ParseFrontendArgs()
1191 Opts.ProgramAction = frontend::GeneratePCH; break; in ParseFrontendArgs()
1193 Opts.ProgramAction = frontend::GeneratePTH; break; in ParseFrontendArgs()
1195 Opts.ProgramAction = frontend::InitOnly; break; in ParseFrontendArgs()
1197 Opts.ProgramAction = frontend::ParseSyntaxOnly; break; in ParseFrontendArgs()
1199 Opts.ProgramAction = frontend::PrintDeclContext; break; in ParseFrontendArgs()
1201 Opts.ProgramAction = frontend::PrintPreamble; break; in ParseFrontendArgs()
1203 Opts.ProgramAction = frontend::PrintPreprocessedInput; break; in ParseFrontendArgs()
1205 Opts.ProgramAction = frontend::RewriteMacros; break; in ParseFrontendArgs()
1207 Opts.ProgramAction = frontend::RewriteObjC; break; in ParseFrontendArgs()
1209 Opts.ProgramAction = frontend::RewriteTest; break; in ParseFrontendArgs()
1211 Opts.ProgramAction = frontend::RunAnalysis; break; in ParseFrontendArgs()
1213 Opts.ProgramAction = frontend::RunPreprocessorOnly; break; in ParseFrontendArgs()
1215 Opts.ProgramAction = frontend::CreateModule; break; in ParseFrontendArgs()
1220 Opts.Plugins.push_back(A->getValue(Args,0)); in ParseFrontendArgs()
1221 Opts.ProgramAction = frontend::PluginAction; in ParseFrontendArgs()
1222 Opts.ActionName = A->getValue(Args); in ParseFrontendArgs()
1226 if ((*it)->getValue(Args, 0) == Opts.ActionName) in ParseFrontendArgs()
1227 Opts.PluginArgs.push_back((*it)->getValue(Args, 1)); in ParseFrontendArgs()
1231 Opts.AddPluginActions = Args.getAllArgValues(OPT_add_plugin); in ParseFrontendArgs()
1232 Opts.AddPluginArgs.resize(Opts.AddPluginActions.size()); in ParseFrontendArgs()
1233 for (int i = 0, e = Opts.AddPluginActions.size(); i != e; ++i) { in ParseFrontendArgs()
1236 if ((*it)->getValue(Args, 0) == Opts.AddPluginActions[i]) in ParseFrontendArgs()
1237 Opts.AddPluginArgs[i].push_back((*it)->getValue(Args, 1)); in ParseFrontendArgs()
1242 Opts.CodeCompletionAt = in ParseFrontendArgs()
1244 if (Opts.CodeCompletionAt.FileName.empty()) in ParseFrontendArgs()
1248 Opts.DisableFree = Args.hasArg(OPT_disable_free); in ParseFrontendArgs()
1250 Opts.OutputFile = Args.getLastArgValue(OPT_o); in ParseFrontendArgs()
1251 Opts.Plugins = Args.getAllArgValues(OPT_load); in ParseFrontendArgs()
1252 Opts.RelocatablePCH = Args.hasArg(OPT_relocatable_pch); in ParseFrontendArgs()
1253 Opts.ChainedPCH = Args.hasArg(OPT_chained_pch); in ParseFrontendArgs()
1254 Opts.ShowHelp = Args.hasArg(OPT_help); in ParseFrontendArgs()
1255 Opts.ShowMacrosInCodeCompletion = Args.hasArg(OPT_code_completion_macros); in ParseFrontendArgs()
1256 Opts.ShowCodePatternsInCodeCompletion in ParseFrontendArgs()
1258 Opts.ShowGlobalSymbolsInCodeCompletion in ParseFrontendArgs()
1260 Opts.ShowStats = Args.hasArg(OPT_print_stats); in ParseFrontendArgs()
1261 Opts.ShowTimers = Args.hasArg(OPT_ftime_report); in ParseFrontendArgs()
1262 Opts.ShowVersion = Args.hasArg(OPT_version); in ParseFrontendArgs()
1263 Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge); in ParseFrontendArgs()
1264 Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm); in ParseFrontendArgs()
1265 Opts.FixWhatYouCan = Args.hasArg(OPT_fix_what_you_can); in ParseFrontendArgs()
1266 Opts.Modules = Args.getAllArgValues(OPT_import_module); in ParseFrontendArgs()
1268 Opts.ARCMTAction = FrontendOptions::ARCMT_None; in ParseFrontendArgs()
1276 Opts.ARCMTAction = FrontendOptions::ARCMT_Check; in ParseFrontendArgs()
1279 Opts.ARCMTAction = FrontendOptions::ARCMT_Modify; in ParseFrontendArgs()
1282 Opts.ARCMTAction = FrontendOptions::ARCMT_Migrate; in ParseFrontendArgs()
1286 Opts.ARCMTMigrateDir = Args.getLastArgValue(OPT_arcmt_migrate_directory); in ParseFrontendArgs()
1287 Opts.ARCMTMigrateReportOut in ParseFrontendArgs()
1289 Opts.ARCMTMigrateEmitARCErrors in ParseFrontendArgs()
1321 Opts.Inputs.clear(); in ParseFrontendArgs()
1333 Opts.Inputs.push_back(std::make_pair(IK, Inputs[i])); in ParseFrontendArgs()
1356 static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { in ParseHeaderSearchArgs() argument
1358 Opts.Sysroot = Args.getLastArgValue(OPT_isysroot, "/"); in ParseHeaderSearchArgs()
1359 Opts.Verbose = Args.hasArg(OPT_v); in ParseHeaderSearchArgs()
1360 Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc); in ParseHeaderSearchArgs()
1361 Opts.UseStandardIncludes = !Args.hasArg(OPT_nostdinc); in ParseHeaderSearchArgs()
1362 Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx); in ParseHeaderSearchArgs()
1364 Opts.UseLibcxx = (strcmp(A->getValue(Args), "libc++") == 0); in ParseHeaderSearchArgs()
1365 Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir); in ParseHeaderSearchArgs()
1370 Opts.AddPath((*it)->getValue(Args), frontend::Angled, true, in ParseHeaderSearchArgs()
1382 Opts.AddPath(Prefix.str() + A->getValue(Args), in ParseHeaderSearchArgs()
1385 Opts.AddPath(Prefix.str() + A->getValue(Args), in ParseHeaderSearchArgs()
1391 Opts.AddPath((*it)->getValue(Args), frontend::After, true, false, false); in ParseHeaderSearchArgs()
1394 Opts.AddPath((*it)->getValue(Args), frontend::Quoted, true, false, false); in ParseHeaderSearchArgs()
1397 Opts.AddPath((*it)->getValue(Args), in ParseHeaderSearchArgs()
1405 void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, in setLangDefaults() argument
1411 Opts.AsmPreprocessor = 1; in setLangDefaults()
1416 Opts.ObjC1 = Opts.ObjC2 = 1; in setLangDefaults()
1449 Opts.BCPLComment = Std.hasBCPLComments(); in setLangDefaults()
1450 Opts.C99 = Std.isC99(); in setLangDefaults()
1451 Opts.C1X = Std.isC1X(); in setLangDefaults()
1452 Opts.CPlusPlus = Std.isCPlusPlus(); in setLangDefaults()
1453 Opts.CPlusPlus0x = Std.isCPlusPlus0x(); in setLangDefaults()
1454 Opts.Digraphs = Std.hasDigraphs(); in setLangDefaults()
1455 Opts.GNUMode = Std.isGNUMode(); in setLangDefaults()
1456 Opts.GNUInline = !Std.isC99(); in setLangDefaults()
1457 Opts.HexFloats = Std.hasHexFloats(); in setLangDefaults()
1458 Opts.ImplicitInt = Std.hasImplicitInt(); in setLangDefaults()
1462 Opts.OpenCL = 1; in setLangDefaults()
1463 Opts.AltiVec = 1; in setLangDefaults()
1464 Opts.CXXOperatorNames = 1; in setLangDefaults()
1465 Opts.LaxVectorConversions = 1; in setLangDefaults()
1466 Opts.DefaultFPContract = 1; in setLangDefaults()
1470 Opts.CUDA = 1; in setLangDefaults()
1473 Opts.Bool = Opts.OpenCL || Opts.CPlusPlus; in setLangDefaults()
1475 Opts.GNUKeywords = Opts.GNUMode; in setLangDefaults()
1476 Opts.CXXOperatorNames = Opts.CPlusPlus; in setLangDefaults()
1480 Opts.Trigraphs = !Opts.GNUMode; in setLangDefaults()
1482 Opts.DollarIdents = !Opts.AsmPreprocessor; in setLangDefaults()
1485 static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, in ParseLangArgs() argument
1541 CompilerInvocation::setLangDefaults(Opts, IK, LangStd); in ParseLangArgs()
1548 Opts.GNUKeywords = Args.hasFlag(OPT_fgnu_keywords, OPT_fno_gnu_keywords, in ParseLangArgs()
1549 Opts.GNUKeywords); in ParseLangArgs()
1552 Opts.CXXOperatorNames = 0; in ParseLangArgs()
1554 if (Opts.ObjC1) { in ParseLangArgs()
1556 Opts.setGCMode(LangOptions::GCOnly); in ParseLangArgs()
1558 Opts.setGCMode(LangOptions::HybridGC); in ParseLangArgs()
1560 Opts.ObjCAutoRefCount = 1; in ParseLangArgs()
1566 Opts.ObjCRuntimeHasWeak = 1; in ParseLangArgs()
1569 Opts.ObjCInferRelatedResultType = 0; in ParseLangArgs()
1573 Opts.GNUInline = 1; in ParseLangArgs()
1576 if (!Opts.CPlusPlus) in ParseLangArgs()
1579 Opts.AppleKext = 1; in ParseLangArgs()
1583 Opts.ObjCGCBitmapPrint = 1; in ParseLangArgs()
1585 Opts.NoConstantCFStrings = 1; in ParseLangArgs()
1588 Opts.AltiVec = 1; in ParseLangArgs()
1591 Opts.POSIXThreads = 1; in ParseLangArgs()
1594 Opts.DelayedTemplateParsing = 1; in ParseLangArgs()
1598 Opts.setVisibilityMode(DefaultVisibility); in ParseLangArgs()
1600 Opts.setVisibilityMode(HiddenVisibility); in ParseLangArgs()
1602 Opts.setVisibilityMode(ProtectedVisibility); in ParseLangArgs()
1608 Opts.InlineVisibilityHidden = 1; in ParseLangArgs()
1611 Opts.setSignedOverflowBehavior(LangOptions::SOB_Trapping); in ParseLangArgs()
1613 Opts.OverflowHandler = in ParseLangArgs()
1617 Opts.setSignedOverflowBehavior(LangOptions::SOB_Defined); in ParseLangArgs()
1620 Opts.Trigraphs = 1; in ParseLangArgs()
1622 Opts.DollarIdents = Args.hasFlag(OPT_fdollars_in_identifiers, in ParseLangArgs()
1624 Opts.DollarIdents); in ParseLangArgs()
1625 Opts.PascalStrings = Args.hasArg(OPT_fpascal_strings); in ParseLangArgs()
1626 Opts.Microsoft = Args.hasArg(OPT_fms_extensions); in ParseLangArgs()
1627 Opts.MSCVersion = Args.getLastArgIntValue(OPT_fmsc_version, 0, Diags); in ParseLangArgs()
1628 Opts.Borland = Args.hasArg(OPT_fborland_extensions); in ParseLangArgs()
1629 Opts.WritableStrings = Args.hasArg(OPT_fwritable_strings); in ParseLangArgs()
1630 Opts.ConstStrings = Args.hasFlag(OPT_fconst_strings, OPT_fno_const_strings, in ParseLangArgs()
1631 Opts.ConstStrings); in ParseLangArgs()
1633 Opts.LaxVectorConversions = 0; in ParseLangArgs()
1635 Opts.ThreadsafeStatics = 0; in ParseLangArgs()
1636 Opts.Exceptions = Args.hasArg(OPT_fexceptions); in ParseLangArgs()
1637 Opts.ObjCExceptions = Args.hasArg(OPT_fobjc_exceptions); in ParseLangArgs()
1638 Opts.CXXExceptions = Args.hasArg(OPT_fcxx_exceptions); in ParseLangArgs()
1639 Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions); in ParseLangArgs()
1640 Opts.TraditionalCPP = Args.hasArg(OPT_traditional_cpp); in ParseLangArgs()
1642 Opts.RTTI = !Args.hasArg(OPT_fno_rtti); in ParseLangArgs()
1643 Opts.Blocks = Args.hasArg(OPT_fblocks); in ParseLangArgs()
1644 Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char); in ParseLangArgs()
1645 Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); in ParseLangArgs()
1646 Opts.ShortEnums = Args.hasArg(OPT_fshort_enums); in ParseLangArgs()
1647 Opts.Freestanding = Args.hasArg(OPT_ffreestanding); in ParseLangArgs()
1648 Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; in ParseLangArgs()
1649 Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); in ParseLangArgs()
1650 Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); in ParseLangArgs()
1651 Opts.AccessControl = !Args.hasArg(OPT_fno_access_control); in ParseLangArgs()
1652 Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors); in ParseLangArgs()
1653 Opts.MathErrno = Args.hasArg(OPT_fmath_errno); in ParseLangArgs()
1654 Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 1024, in ParseLangArgs()
1656 Opts.DelayedTemplateParsing = Args.hasArg(OPT_fdelayed_template_parsing); in ParseLangArgs()
1657 Opts.NumLargeByValueCopy = Args.getLastArgIntValue(OPT_Wlarge_by_value_copy, in ParseLangArgs()
1659 Opts.MSBitfields = Args.hasArg(OPT_mms_bitfields); in ParseLangArgs()
1660 Opts.NeXTRuntime = !Args.hasArg(OPT_fgnu_runtime); in ParseLangArgs()
1661 Opts.ObjCConstantStringClass = in ParseLangArgs()
1663 Opts.ObjCNonFragileABI = Args.hasArg(OPT_fobjc_nonfragile_abi); in ParseLangArgs()
1664 if (Opts.ObjCNonFragileABI) in ParseLangArgs()
1665 Opts.ObjCNonFragileABI2 = true; in ParseLangArgs()
1666 Opts.ObjCDefaultSynthProperties = in ParseLangArgs()
1668 Opts.CatchUndefined = Args.hasArg(OPT_fcatch_undefined_behavior); in ParseLangArgs()
1669 Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls); in ParseLangArgs()
1670 Opts.PICLevel = Args.getLastArgIntValue(OPT_pic_level, 0, Diags); in ParseLangArgs()
1671 Opts.Static = Args.hasArg(OPT_static_define); in ParseLangArgs()
1672 Opts.DumpRecordLayouts = Args.hasArg(OPT_fdump_record_layouts); in ParseLangArgs()
1673 Opts.DumpVTableLayouts = Args.hasArg(OPT_fdump_vtable_layouts); in ParseLangArgs()
1674 Opts.SpellChecking = !Args.hasArg(OPT_fno_spell_checking); in ParseLangArgs()
1675 Opts.NoBitFieldTypeAlign = Args.hasArg(OPT_fno_bitfield_type_align); in ParseLangArgs()
1676 Opts.SinglePrecisionConstants = Args.hasArg(OPT_cl_single_precision_constant); in ParseLangArgs()
1677 Opts.FastRelaxedMath = Args.hasArg(OPT_cl_fast_relaxed_math); in ParseLangArgs()
1678 Opts.OptimizeSize = 0; in ParseLangArgs()
1679 Opts.MRTD = Args.hasArg(OPT_mrtd); in ParseLangArgs()
1680 Opts.FakeAddressSpaceMap = Args.hasArg(OPT_ffake_address_space_map); in ParseLangArgs()
1681 Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype); in ParseLangArgs()
1682 Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support); in ParseLangArgs()
1685 Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro, in ParseLangArgs()
1687 Opts.Deprecated); in ParseLangArgs()
1691 Opts.Optimize = Opt != 0; in ParseLangArgs()
1698 Opts.NoInline = !Opt; in ParseLangArgs()
1706 case 0: Opts.setStackProtectorMode(LangOptions::SSPOff); break; in ParseLangArgs()
1707 case 1: Opts.setStackProtectorMode(LangOptions::SSPOn); break; in ParseLangArgs()
1708 case 2: Opts.setStackProtectorMode(LangOptions::SSPReq); break; in ParseLangArgs()
1712 static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, in ParsePreprocessorArgs() argument
1716 Opts.ImplicitPCHInclude = Args.getLastArgValue(OPT_include_pch); in ParsePreprocessorArgs()
1717 Opts.ImplicitPTHInclude = Args.getLastArgValue(OPT_include_pth); in ParsePreprocessorArgs()
1719 Opts.TokenCache = A->getValue(Args); in ParsePreprocessorArgs()
1721 Opts.TokenCache = Opts.ImplicitPTHInclude; in ParsePreprocessorArgs()
1722 Opts.UsePredefines = !Args.hasArg(OPT_undef); in ParsePreprocessorArgs()
1723 Opts.DetailedRecord = Args.hasArg(OPT_detailed_preprocessing_record); in ParsePreprocessorArgs()
1724 Opts.DisablePCHValidation = Args.hasArg(OPT_fno_validate_pch); in ParsePreprocessorArgs()
1726 Opts.DumpDeserializedPCHDecls = Args.hasArg(OPT_dump_deserialized_pch_decls); in ParsePreprocessorArgs()
1730 Opts.DeserializedPCHDeclsToErrorOn.insert(A->getValue(Args)); in ParsePreprocessorArgs()
1744 Opts.PrecompiledPreambleBytes.first = Bytes; in ParsePreprocessorArgs()
1745 Opts.PrecompiledPreambleBytes.second = (EndOfLine != 0); in ParsePreprocessorArgs()
1753 Opts.addMacroDef((*it)->getValue(Args)); in ParsePreprocessorArgs()
1755 Opts.addMacroUndef((*it)->getValue(Args)); in ParsePreprocessorArgs()
1758 Opts.MacroIncludes = Args.getAllArgValues(OPT_imacros); in ParsePreprocessorArgs()
1772 Opts.Includes.push_back(OriginalFile); in ParsePreprocessorArgs()
1774 Opts.Includes.push_back(A->getValue(Args)); in ParsePreprocessorArgs()
1780 Opts.ChainedIncludes.push_back(A->getValue(Args)); in ParsePreprocessorArgs()
1785 Opts.Includes.push_back("altivec.h"); in ParsePreprocessorArgs()
1798 Opts.addRemappedFile(Split.first, Split.second); in ParsePreprocessorArgs()
1811 Opts.ObjCXXARCStandardLibrary = (ObjCXXARCStandardLibraryKind)Library; in ParsePreprocessorArgs()
1815 static void ParsePreprocessorOutputArgs(PreprocessorOutputOptions &Opts, in ParsePreprocessorOutputArgs() argument
1818 Opts.ShowCPP = !Args.hasArg(OPT_dM); in ParsePreprocessorOutputArgs()
1819 Opts.ShowComments = Args.hasArg(OPT_C); in ParsePreprocessorOutputArgs()
1820 Opts.ShowLineMarkers = !Args.hasArg(OPT_P); in ParsePreprocessorOutputArgs()
1821 Opts.ShowMacroComments = Args.hasArg(OPT_CC); in ParsePreprocessorOutputArgs()
1822 Opts.ShowMacros = Args.hasArg(OPT_dM) || Args.hasArg(OPT_dD); in ParsePreprocessorOutputArgs()
1825 static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) { in ParseTargetArgs() argument
1827 Opts.ABI = Args.getLastArgValue(OPT_target_abi); in ParseTargetArgs()
1828 Opts.CXXABI = Args.getLastArgValue(OPT_cxx_abi); in ParseTargetArgs()
1829 Opts.CPU = Args.getLastArgValue(OPT_target_cpu); in ParseTargetArgs()
1830 Opts.Features = Args.getAllArgValues(OPT_target_feature); in ParseTargetArgs()
1831 Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version); in ParseTargetArgs()
1832 Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple)); in ParseTargetArgs()
1835 if (Opts.Triple.empty()) in ParseTargetArgs()
1836 Opts.Triple = llvm::sys::getHostTriple(); in ParseTargetArgs()
1846 llvm::OwningPtr<OptTable> Opts(createCC1OptTable()); in CreateFromArgs() local
1849 Opts->ParseArgs(ArgBegin, ArgEnd,MissingArgIndex, MissingArgCount)); in CreateFromArgs()