Lines Matching +full:diag +full:- +full:version

1 //===- CompilerInvocation.cpp ---------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
26 #include "clang/Basic/Version.h"
59 #include "llvm/Config/llvm-config.h"
110 //===----------------------------------------------------------------------===//
112 //===----------------------------------------------------------------------===//
124 //===----------------------------------------------------------------------===//
126 //===----------------------------------------------------------------------===//
274 //===----------------------------------------------------------------------===//
276 //===----------------------------------------------------------------------===//
302 /// The tblgen-erated code passes in a fifth parameter of an arbitrary type, but
303 /// denormalizeSimpleFlags never looks at it. Avoid bloating compile-time with
320 DiagnosticsEngine &) -> std::optional<T> { in makeFlagToValueNormalizer()
337 DiagnosticsEngine &) -> std::optional<bool> { in makeBooleanOptionNormalizer()
339 return A->getOption().matches(Opt) ? Value : OtherValue; in makeBooleanOptionNormalizer()
410 StringRef ArgValue = Arg->getValue(); in normalizeSimpleEnum()
412 return MaybeEnumVal->Value; in normalizeSimpleEnum()
414 Diags.Report(diag::err_drv_invalid_value) in normalizeSimpleEnum()
415 << Arg->getAsString(Args) << ArgValue; in normalizeSimpleEnum()
427 MaybeEnumVal->Name); in denormalizeSimpleEnumImpl()
450 return std::string(Arg->getValue()); in normalizeString()
461 if (StringRef(Arg->getValue()).getAsInteger(0, Res)) { in normalizeStringIntegral()
462 Diags.Report(diag::err_drv_invalid_int_value) in normalizeStringIntegral()
463 << Arg->getAsString(Args) << Arg->getValue(); in normalizeStringIntegral()
513 return llvm::Triple::normalize(Arg->getValue()); in normalizeTriple()
599 Diags.Report(diag::err_fe_invalid_exception_model) in FixupInvocation()
603 Diags.Report(diag::warn_c_kext); in FixupInvocation()
608 Diags.Report(diag::err_fe_invalid_alignment) in FixupInvocation()
609 << A->getAsString(Args) << A->getValue(); in FixupInvocation()
613 // The -f[no-]raw-string-literals option is only valid in C and in C++ in FixupInvocation()
618 Diags.Report(diag::warn_drv_fraw_string_literals_in_cxx11) in FixupInvocation()
626 // Prevent the user from specifying both -fsycl-is-device and -fsycl-is-host. in FixupInvocation()
628 Diags.Report(diag::err_drv_argument_not_allowed_with) << "-fsycl-is-device" in FixupInvocation()
629 << "-fsycl-is-host"; in FixupInvocation()
632 Diags.Report(diag::err_drv_argument_not_allowed_with) in FixupInvocation()
633 << "-fgnu89-inline" << GetInputKindName(IK); in FixupInvocation()
636 Diags.Report(diag::err_drv_argument_not_allowed_with) in FixupInvocation()
637 << "-hlsl-entry" << GetInputKindName(IK); in FixupInvocation()
640 Diags.Report(diag::warn_ignored_hip_only_option) in FixupInvocation()
641 << Args.getLastArg(OPT_fgpu_allow_device_init)->getAsString(Args); in FixupInvocation()
644 Diags.Report(diag::warn_ignored_hip_only_option) in FixupInvocation()
645 << Args.getLastArg(OPT_gpu_max_threads_per_block_EQ)->getAsString(Args); in FixupInvocation()
656 Diags.Report(diag::err_incompatible_fp_eval_method_options) << 0; in FixupInvocation()
658 Diags.Report(diag::err_incompatible_fp_eval_method_options) << 1; in FixupInvocation()
660 Diags.Report(diag::err_incompatible_fp_eval_method_options) << 2; in FixupInvocation()
663 // -cl-strict-aliasing needs to emit diagnostic in the case where CL > 1.0. in FixupInvocation()
668 Diags.Report(diag::warn_option_invalid_ocl_version) in FixupInvocation()
670 << Args.getLastArg(OPT_cl_strict_aliasing)->getAsString(Args); in FixupInvocation()
683 Diags.Report(diag::err_drv_argument_not_allowed_with) in FixupInvocation()
684 << A->getSpelling() << T.getTriple(); in FixupInvocation()
690 //===----------------------------------------------------------------------===//
692 //===----------------------------------------------------------------------===//
703 if (A->getOption().matches(options::OPT_O0)) in getOptimizationLevel()
706 if (A->getOption().matches(options::OPT_Ofast)) in getOptimizationLevel()
709 assert(A->getOption().matches(options::OPT_O)); in getOptimizationLevel()
711 StringRef S(A->getValue()); in getOptimizationLevel()
726 if (A->getOption().matches(options::OPT_O)) { in getOptimizationLevelSize()
727 switch (A->getValue()[0]) { in getOptimizationLevelSize()
764 /// May perform round-trip of command line arguments. By default, the round-trip
765 /// is enabled in assert builds. This can be overwritten at run-time via the
766 /// "-round-trip-args" and "-no-round-trip-args" command line flags, or via the
769 /// During round-trip, the command line arguments are parsed into a dummy
780 /// compare it to the original command line to verify the original command-line
781 /// was canonical and can round-trip exactly.
800 if (Arg == StringRef("-round-trip-args")) in RoundTrip()
802 if (Arg == StringRef("-no-round-trip-args")) in RoundTrip()
807 // If round-trip was not requested, simply run the parser with the real in RoundTrip()
835 // invocation and diagnostics, so all side-effects of parsing are visible. in RoundTrip()
843 Diags.Report(diag::err_cc1_round_trip_fail_then_ok); in RoundTrip()
844 Diags.Report(diag::note_cc1_round_trip_original) in RoundTrip()
871 Diags.Report(diag::err_cc1_round_trip_ok_then_fail); in RoundTrip()
872 Diags.Report(diag::note_cc1_round_trip_generated) in RoundTrip()
897 // be non-deterministic. in RoundTrip()
899 Diags.Report(diag::err_cc1_round_trip_mismatch); in RoundTrip()
900 Diags.Report(diag::note_cc1_round_trip_generated) in RoundTrip()
902 Diags.Report(diag::note_cc1_round_trip_generated) in RoundTrip()
907 Diags.Report(diag::remark_cc1_round_trip_generated) in RoundTrip()
909 Diags.Report(diag::remark_cc1_round_trip_generated) in RoundTrip()
926 Args.push_back("-cc1"); in checkCC1RoundTrip()
937 if (A->getOption().getKind() == Option::FlagClass) { in addDiagnosticArgs()
941 std::string(A->getOption().getName().drop_front(1))); in addDiagnosticArgs()
942 } else if (A->getOption().matches(GroupWithValue)) { in addDiagnosticArgs()
943 // This is -Wfoo= or -Rfoo=, where foo is the name of the diagnostic in addDiagnosticArgs()
946 std::string(A->getOption().getName().drop_front(1).rtrim("=-"))); in addDiagnosticArgs()
949 Diagnostics.push_back(A->getValue()); in addDiagnosticArgs()
1042 if (Entry != ConfigOpts.Config.end() && Entry->getValue() == Value) in GenerateAnalyzerArgs()
1063 StringRef Name = A->getValue(); in ParseAnalyzerArgs()
1070 Diags.Report(diag::err_drv_invalid_value) in ParseAnalyzerArgs()
1071 << A->getAsString(Args) << Name; in ParseAnalyzerArgs()
1075 Diags.Report(diag::err_analyzer_not_built_with_z3); in ParseAnalyzerArgs()
1083 StringRef Name = A->getValue(); in ParseAnalyzerArgs()
1090 Diags.Report(diag::err_drv_invalid_value) in ParseAnalyzerArgs()
1091 << A->getAsString(Args) << Name; in ParseAnalyzerArgs()
1098 StringRef Name = A->getValue(); in ParseAnalyzerArgs()
1105 Diags.Report(diag::err_drv_invalid_value) in ParseAnalyzerArgs()
1106 << A->getAsString(Args) << Name; in ParseAnalyzerArgs()
1113 StringRef Name = A->getValue(); in ParseAnalyzerArgs()
1120 Diags.Report(diag::err_drv_invalid_value) in ParseAnalyzerArgs()
1121 << A->getAsString(Args) << Name; in ParseAnalyzerArgs()
1130 A->claim(); in ParseAnalyzerArgs()
1131 bool IsEnabled = A->getOption().getID() == OPT_analyzer_checker; in ParseAnalyzerArgs()
1133 // '-analyzer-checker=cocoa,unix' in ParseAnalyzerArgs()
1134 StringRef CheckerAndPackageList = A->getValue(); in ParseAnalyzerArgs()
1146 // '-analyzer-config key1=val1,key2=val2' in ParseAnalyzerArgs()
1147 StringRef configList = A->getValue(); in ParseAnalyzerArgs()
1155 diag::err_analyzer_config_no_value) << configVal; in ParseAnalyzerArgs()
1160 diag::err_analyzer_config_multiple_values) in ParseAnalyzerArgs()
1166 // Leave unknown non-checker configs unclaimed. in ParseAnalyzerArgs()
1169 Diags.Report(diag::err_analyzer_config_unknown) << key; in ParseAnalyzerArgs()
1173 A->claim(); in ParseAnalyzerArgs()
1196 return Config.insert({OptionName, std::string(DefaultVal)}).first->second; in getStringOption()
1221 Diags->Report(diag::err_analyzer_config_invalid_input) in initOption()
1238 Diags->Report(diag::err_analyzer_config_invalid_input) in initOption()
1284 Diags->Report(diag::err_unknown_analyzer_checker_or_package) in parseAnalyzerConfigs()
1296 Diags->Report(diag::err_analyzer_config_invalid_input) in parseAnalyzerConfigs()
1297 << "track-conditions-debug" << "'track-conditions' to also be enabled"; in parseAnalyzerConfigs()
1300 Diags->Report(diag::err_analyzer_config_invalid_input) << "ctu-dir" in parseAnalyzerConfigs()
1305 Diags->Report(diag::err_analyzer_config_invalid_input) << "model-path" in parseAnalyzerConfigs()
1319 GenerateArg(Consumer, OPT_R_Joined, StringRef("no-") + Name); in GenerateOptimizationRemark()
1324 /// '-R[no-]group' or specified with a regular expression by '-Rgroup=regexp'.
1325 /// On top of that, it can be disabled/enabled globally by '-R[no-]everything'.
1337 if (!Result.Regex->isValid(RegexError)) { in ParseOptimizationRemark()
1338 Diags.Report(diag::err_drv_optimization_remark_pattern) in ParseOptimizationRemark()
1339 << RegexError << A->getAsString(Args); in ParseOptimizationRemark()
1347 if (A->getOption().matches(OPT_R_Joined)) { in ParseOptimizationRemark()
1348 StringRef Value = A->getValue(); in ParseOptimizationRemark()
1354 else if (Value.split('-') == std::make_pair(StringRef("no"), Name)) in ParseOptimizationRemark()
1356 else if (Value == "no-everything") in ParseOptimizationRemark()
1368 } else if (A->getOption().matches(OptEQ)) { in ParseOptimizationRemark()
1370 if (!InitializeResultPattern(A, A->getValue())) in ParseOptimizationRemark()
1393 Diags.Report(diag::err_drv_invalid_value) << FlagName << Level; in parseDiagnosticLevelMask()
1406 Diags.Report(diag::err_drv_invalid_value) << FlagName << Sanitizer; in parseSanitizerKinds()
1427 D.Report(diag::err_drv_invalid_value) << FlagName << Bundle; in parseXRayInstrumentationBundle()
1446 // Set the profile kind using fprofile-instrument-use-path.
1465 if (PGOReader->isIRLevelProfile() || PGOReader->hasMemoryProfile()) { in setPGOUseInstrumentor()
1466 if (PGOReader->hasCSIRLevelProfile()) in setPGOUseInstrumentor()
1549 if (Opts.DirectAccessExternalData && LangOpts->PICLevel != 0) in GenerateCodeGenArgs()
1551 else if (!Opts.DirectAccessExternalData && LangOpts->PICLevel == 0) in GenerateCodeGenArgs()
1557 DebugInfoVal = "line-tables-only"; in GenerateCodeGenArgs()
1560 DebugInfoVal = "line-directives-only"; in GenerateCodeGenArgs()
1572 DebugInfoVal = "unused-types"; in GenerateCodeGenArgs()
1600 // SimplifyLibCalls is set only in the absence of -fno-builtin and in GenerateCodeGenArgs()
1601 // -ffreestanding. We'll consider that when generating them. in GenerateCodeGenArgs()
1636 GenerateArg(Consumer, OPT_ftime_report_EQ, "per-pass-run"); in GenerateCodeGenArgs()
1659 Opts.MemoryProfileOutput.size() - MemProfileBasename.size(); in GenerateCodeGenArgs()
1670 // '-fembed_bitcode', which does not map to any CompilerInvocation field and in GenerateCodeGenArgs()
1688 GenerateArg(Consumer, OPT_mfunction_return_EQ, "thunk-extern"); in GenerateCodeGenArgs()
1734 GenerateOptimizationRemark(Consumer, OPT_Rpass_missed_EQ, "pass-missed", in GenerateCodeGenArgs()
1737 GenerateOptimizationRemark(Consumer, OPT_Rpass_analysis_EQ, "pass-analysis", in GenerateCodeGenArgs()
1783 Diags.Report(diag::warn_drv_optimization_value) in ParseCodeGenArgs()
1784 << Args.getLastArg(OPT_O)->getAsString(Args) << "-O" << MaxOptLevel; in ParseCodeGenArgs()
1811 if (A->getOption().matches(options::OPT_finline_functions)) in ParseCodeGenArgs()
1813 else if (A->getOption().matches(options::OPT_finline_hint_functions)) in ParseCodeGenArgs()
1821 // PIC defaults to -fno-direct-access-external-data while non-PIC defaults to in ParseCodeGenArgs()
1822 // -fdirect-access-external-data. in ParseCodeGenArgs()
1826 LangOpts->PICLevel == 0); in ParseCodeGenArgs()
1830 llvm::StringSwitch<unsigned>(A->getValue()) in ParseCodeGenArgs()
1831 .Case("line-tables-only", llvm::codegenoptions::DebugLineTablesOnly) in ParseCodeGenArgs()
1832 .Case("line-directives-only", in ParseCodeGenArgs()
1837 .Case("unused-types", llvm::codegenoptions::UnusedTypeInfo) in ParseCodeGenArgs()
1840 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) in ParseCodeGenArgs()
1841 << A->getValue(); in ParseCodeGenArgs()
1846 // If -fuse-ctor-homing is set and limited debug info is already on, then use in ParseCodeGenArgs()
1847 // constructor homing, and vice versa for -fno-use-ctor-homing. in ParseCodeGenArgs()
1850 if (A->getOption().matches(OPT_fuse_ctor_homing) && in ParseCodeGenArgs()
1853 if (A->getOption().matches(OPT_fno_use_ctor_homing) && in ParseCodeGenArgs()
1878 Diags.Report(diag::warn_ignoring_verify_debuginfo_preserve_export) in ParseCodeGenArgs()
1886 Opts.SimplifyLibCalls = !LangOpts->NoBuiltin; in ParseCodeGenArgs()
1888 Opts.NoBuiltinFuncs = LangOpts->NoBuiltinFuncs; in ParseCodeGenArgs()
1904 StringRef Value = A->getValue(); in ParseCodeGenArgs()
1906 Diags.Report(diag::err_drv_unsupported_option_argument) in ParseCodeGenArgs()
1907 << A->getSpelling() << A->getValue(); in ParseCodeGenArgs()
1909 StringRef(A->getValue()) == "simple" in ParseCodeGenArgs()
1917 // -ftime-report= is only for new pass manager. in ParseCodeGenArgs()
1918 if (A->getOption().getID() == OPT_ftime_report_EQ) { in ParseCodeGenArgs()
1919 StringRef Val = A->getValue(); in ParseCodeGenArgs()
1920 if (Val == "per-pass") in ParseCodeGenArgs()
1922 else if (Val == "per-pass-run") in ParseCodeGenArgs()
1925 Diags.Report(diag::err_drv_invalid_value) in ParseCodeGenArgs()
1926 << A->getAsString(Args) << A->getValue(); in ParseCodeGenArgs()
1934 StringRef S = A->getValue(); in ParseCodeGenArgs()
1938 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << S; in ParseCodeGenArgs()
1944 Diags.Report(diag::err_drv_argument_only_allowed_with) in ParseCodeGenArgs()
1945 << A->getAsString(Args) << "-x ir"; in ParseCodeGenArgs()
1951 llvm::StringSwitch<std::string>(A->getValue()) in ParseCodeGenArgs()
1970 Diags.Report(diag::err_drv_invalid_value) in ParseCodeGenArgs()
1971 << Args.getLastArg(OPT_coverage_version_EQ)->getAsString(Args) in ParseCodeGenArgs()
1983 if (A->getOption().getID() == options::OPT_o || in ParseCodeGenArgs()
1984 A->getOption().getID() == options::OPT_INPUT || in ParseCodeGenArgs()
1985 A->getOption().getID() == options::OPT_x || in ParseCodeGenArgs()
1986 A->getOption().getID() == options::OPT_fembed_bitcode || in ParseCodeGenArgs()
1987 A->getOption().matches(options::OPT_W_Group)) in ParseCodeGenArgs()
1990 A->render(Args, ASL); in ParseCodeGenArgs()
2005 parseXRayInstrumentationBundle("-fxray-instrumentation-bundle=", A, Args, in ParseCodeGenArgs()
2009 StringRef Name = A->getValue(); in ParseCodeGenArgs()
2018 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Name; in ParseCodeGenArgs()
2022 auto Val = llvm::StringSwitch<llvm::FunctionReturnThunksKind>(A->getValue()) in ParseCodeGenArgs()
2024 .Case("thunk-extern", llvm::FunctionReturnThunksKind::Extern) in ParseCodeGenArgs()
2028 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseCodeGenArgs()
2029 << A->getSpelling() << T.getTriple(); in ParseCodeGenArgs()
2031 Diags.Report(diag::err_drv_invalid_value) in ParseCodeGenArgs()
2032 << A->getAsString(Args) << A->getValue(); in ParseCodeGenArgs()
2035 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseCodeGenArgs()
2036 << A->getAsString(Args) in ParseCodeGenArgs()
2037 << Args.getLastArg(OPT_mcmodel_EQ)->getAsString(Args); in ParseCodeGenArgs()
2045 F.Filename = A->getValue(); in ParseCodeGenArgs()
2046 if (A->getOption().matches(OPT_mlink_builtin_bitcode)) { in ParseCodeGenArgs()
2049 // e.g. libdevice gets fast-math attrs if we're building with fast-math. in ParseCodeGenArgs()
2057 StringRef Val = A->getValue(); in ParseCodeGenArgs()
2061 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; in ParseCodeGenArgs()
2065 StringRef Val = A->getValue(); in ParseCodeGenArgs()
2068 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; in ParseCodeGenArgs()
2071 // X86_32 has -fppc-struct-return and -freg-struct-return. in ParseCodeGenArgs()
2072 // PPC32 has -maix-struct-return and -msvr4-struct-return. in ParseCodeGenArgs()
2079 Diags.Report(diag::err_drv_unsupported_opt_for_target) in ParseCodeGenArgs()
2080 << A->getSpelling() << T.str(); in ParseCodeGenArgs()
2082 const Option &O = A->getOption(); in ParseCodeGenArgs()
2095 Diags.Report(diag::err_drv_unsupported_opt_for_target) in ParseCodeGenArgs()
2096 << A->getSpelling() << T.str(); in ParseCodeGenArgs()
2099 // without using data sections, it is less effective to use read-only in ParseCodeGenArgs()
2100 // pointers. Using read-only pointers may cause other RO variables in the in ParseCodeGenArgs()
2101 // same csect to become RW when the linker acts upon `-bforceimprw`; in ParseCodeGenArgs()
2103 // are used when `-mxcoff-roptr` is in effect. We respect the setting of in ParseCodeGenArgs()
2104 // data-sections since we have not found reasons to do otherwise that in ParseCodeGenArgs()
2107 Diags.Report(diag::err_roptr_requires_data_sections); in ParseCodeGenArgs()
2114 Diags.Report(diag::err_drv_unsupported_opt_for_target) in ParseCodeGenArgs()
2115 << A->getSpelling() << T.str(); in ParseCodeGenArgs()
2124 Opts.OptRecordPasses = A->getValue(); in ParseCodeGenArgs()
2129 Opts.OptRecordFormat = A->getValue(); in ParseCodeGenArgs()
2137 ParseOptimizationRemark(Diags, Args, OPT_Rpass_missed_EQ, "pass-missed"); in ParseCodeGenArgs()
2140 Diags, Args, OPT_Rpass_analysis_EQ, "pass-analysis"); in ParseCodeGenArgs()
2153 Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo) in ParseCodeGenArgs()
2154 << "-fdiagnostics-show-hotness"; in ParseCodeGenArgs()
2160 llvm::remarks::parseHotnessThresholdOption(arg->getValue()); in ParseCodeGenArgs()
2163 Diags.Report(diag::err_drv_invalid_diagnotics_hotness_threshold) in ParseCodeGenArgs()
2164 << "-fdiagnostics-hotness-threshold="; in ParseCodeGenArgs()
2170 Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo) in ParseCodeGenArgs()
2171 << "-fdiagnostics-hotness-threshold="; in ParseCodeGenArgs()
2177 auto ResultOrErr = parseToleranceOption(arg->getValue()); in ParseCodeGenArgs()
2180 Diags.Report(diag::err_drv_invalid_diagnotics_misexpect_tolerance) in ParseCodeGenArgs()
2181 << "-fdiagnostics-misexpect-tolerance="; in ParseCodeGenArgs()
2187 Diags.Report(diag::warn_drv_diagnostics_misexpect_requires_pgo) in ParseCodeGenArgs()
2188 << "-fdiagnostics-misexpect-tolerance="; in ParseCodeGenArgs()
2207 // Parse -fsanitize-recover= arguments. in ParseCodeGenArgs()
2209 parseSanitizerKinds("-fsanitize-recover=", in ParseCodeGenArgs()
2212 parseSanitizerKinds("-fsanitize-trap=", in ParseCodeGenArgs()
2218 if (!LangOpts->CUDAIsDevice) in ParseCodeGenArgs()
2229 Diags.Report(diag::err_drv_amdgpu_ieee_without_no_honor_nans); in ParseCodeGenArgs()
2294 StringRef Val = A->getValue(); in ParseDependencyOutputArgs()
2300 StringRef Val = A->getValue(); in ParseDependencyOutputArgs()
2307 // -fprofile-list= dependencies. in ParseDependencyOutputArgs()
2313 Opts.ExtraDeps.emplace_back(A->getValue(), EDK_DepFileEntry); in ParseDependencyOutputArgs()
2315 // Only the -fmodule-file=<file> form. in ParseDependencyOutputArgs()
2317 StringRef Val = A->getValue(); in ParseDependencyOutputArgs()
2322 // Check for invalid combinations of header-include-format in ParseDependencyOutputArgs()
2323 // and header-include-filtering. in ParseDependencyOutputArgs()
2328 Diags.Report(diag::err_drv_print_header_env_var_combination_cc1) in ParseDependencyOutputArgs()
2329 << Args.getLastArg(OPT_header_include_format_EQ)->getValue() in ParseDependencyOutputArgs()
2330 << Args.getLastArg(OPT_header_include_filtering_EQ)->getValue(); in ParseDependencyOutputArgs()
2338 // Support both clang's -f[no-]color-diagnostics and gcc's in parseShowColorsArgs()
2339 // -f[no-]diagnostics-colors[=never|always|auto]. in parseShowColorsArgs()
2346 const Option &O = A->getOption(); in parseShowColorsArgs()
2352 StringRef Value(A->getValue()); in parseShowColorsArgs()
2373 return !isAlphanumeric(C) && C != '-' && C != '_'; in checkVerifyPrefixes()
2377 Diags.Report(diag::err_drv_invalid_value) << "-verify=" << Prefix; in checkVerifyPrefixes()
2378 Diags.Report(diag::note_drv_verify_prefix_spelling); in checkVerifyPrefixes()
2473 if (Warning == "undef-prefix") in GenerateDiagnosticArgs()
2476 if (Warning == "invalid-constexpr" || Warning == "no-invalid-constexpr") in GenerateDiagnosticArgs()
2478 Consumer(StringRef("-W") + Warning); in GenerateDiagnosticArgs()
2484 StringRef IgnoredRemarks[] = {"pass", "no-pass", in GenerateDiagnosticArgs()
2485 "pass-analysis", "no-pass-analysis", in GenerateDiagnosticArgs()
2486 "pass-missed", "no-pass-missed"}; in GenerateDiagnosticArgs()
2490 Consumer(StringRef("-R") + Remark); in GenerateDiagnosticArgs()
2504 NoColor && !NoColor->empty()) { in CreateAndPopulateDiagOpts()
2527 unsigned NumErrorsBefore = Diags->getNumErrors(); in ParseDiagnosticArgs()
2530 // "DiagnosticOpts->". Let's provide the expected variable name and type. in ParseDiagnosticArgs()
2542 Opts.DiagnosticSerializationFile = A->getValue(); in ParseDiagnosticArgs()
2557 "-verify-ignore-unexpected=", in ParseDiagnosticArgs()
2563 Diags->Report(diag::warn_ignoring_ftabstop_value) in ParseDiagnosticArgs()
2571 return Diags->getNumErrors() == NumErrorsBefore; in ParseDiagnosticArgs()
2574 /// Parse the argument to the -ftest-module-file-extension
2575 /// command-line argument.
2750 GenerateArg(Consumer, OPT_ftest_module_file_extension_EQ, TestExt->str()); in GenerateFrontendArgs()
2772 StringRef Preprocessed = Opts.DashX.isPreprocessed() ? "-cpp-output" : ""; in GenerateFrontendArgs()
2774 Opts.DashX.getFormat() == InputKind::ModuleMap ? "-module-map" : ""; in GenerateFrontendArgs()
2780 HeaderUnit = "-user"; in GenerateFrontendArgs()
2783 HeaderUnit = "-system"; in GenerateFrontendArgs()
2786 HeaderUnit = "-header-unit"; in GenerateFrontendArgs()
2789 StringRef Header = IsHeader ? "-header" : ""; in GenerateFrontendArgs()
2812 Lang = "objective-c"; in GenerateFrontendArgs()
2815 Lang = "objective-c++"; in GenerateFrontendArgs()
2821 Lang = "assembler-with-cpp"; in GenerateFrontendArgs()
2825 "Generating -x argument for unknown language (not precompiled)."); in GenerateFrontendArgs()
2861 OptSpecifier Opt = OptSpecifier(A->getOption().getID()); in ParseFrontendArgs()
2867 unsigned Val = llvm::StringSwitch<unsigned>(A->getValue()) in ParseFrontendArgs()
2875 Diags.Report(diag::err_drv_invalid_value) in ParseFrontendArgs()
2876 << A->getAsString(Args) << A->getValue(); in ParseFrontendArgs()
2882 Opts.FixItSuffix = A->getValue(); in ParseFrontendArgs()
2888 : "ifs-v1"; in ParseFrontendArgs()
2889 if (ArgStr == "experimental-yaml-elf-v1" || in ParseFrontendArgs()
2890 ArgStr == "experimental-ifs-v1" || ArgStr == "experimental-ifs-v2" || in ParseFrontendArgs()
2891 ArgStr == "experimental-tapi-elf-v1") { in ParseFrontendArgs()
2895 Diags.Report(diag::err_drv_invalid_value) in ParseFrontendArgs()
2897 "-interface-stub-version=ifs-v1" in ParseFrontendArgs()
2900 } else if (!ArgStr.starts_with("ifs-")) { in ParseFrontendArgs()
2903 Diags.Report(diag::err_drv_invalid_value) in ParseFrontendArgs()
2905 "-interface-stub-version=ifs-v1" in ParseFrontendArgs()
2914 // -S -emit-llvm means -emit-llvm while -emit-llvm -S means -S). However, to in ParseFrontendArgs()
2915 // support driver `-c -Xclang ACTION` (-cc1 -emit-llvm file -main-file-name in ParseFrontendArgs()
2917 // -main-file-name. in ParseFrontendArgs()
2919 // As an exception, accept composable -ast-dump*. in ParseFrontendArgs()
2920 if (!A->getSpelling().starts_with("-ast-dump")) { in ParseFrontendArgs()
2924 if (AA->getOption().matches(OPT_main_file_name)) { in ParseFrontendArgs()
2929 if (!A->getOption().matches(OPT_ast_dump_EQ)) in ParseFrontendArgs()
2930 Diags.Report(diag::err_fe_invalid_multiple_actions) in ParseFrontendArgs()
2931 << SavedAction->getSpelling() << A->getSpelling(); in ParseFrontendArgs()
2939 Opts.Plugins.emplace_back(A->getValue(0)); in ParseFrontendArgs()
2941 Opts.ActionName = A->getValue(); in ParseFrontendArgs()
2944 Opts.PluginArgs[AA->getValue(0)].emplace_back(AA->getValue(1)); in ParseFrontendArgs()
2955 Diags.Report(diag::err_test_module_file_extension_format) << Arg; in ParseFrontendArgs()
2968 ParsedSourceLocation::FromString(A->getValue()); in ParseFrontendArgs()
2970 Diags.Report(diag::err_drv_invalid_value) in ParseFrontendArgs()
2971 << A->getAsString(Args) << A->getValue(); in ParseFrontendArgs()
2977 // Only the -fmodule-file=<file> form. in ParseFrontendArgs()
2979 StringRef Val = A->getValue(); in ParseFrontendArgs()
2985 Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module" in ParseFrontendArgs()
2986 << "-emit-module"; in ParseFrontendArgs()
2997 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseFrontendArgs()
3003 StringRef XValue = A->getValue(); in ParseFrontendArgs()
3006 // '<lang>(-[{header-unit,user,system}-]header|[-module-map][-cpp-output])'. in ParseFrontendArgs()
3007 // FIXME: Supporting '<lang>-header-cpp-output' would be useful. in ParseFrontendArgs()
3008 bool Preprocessed = XValue.consume_back("-cpp-output"); in ParseFrontendArgs()
3009 bool ModuleMap = XValue.consume_back("-module-map"); in ParseFrontendArgs()
3012 XValue != "precompiled-header" && XValue.consume_back("-header"); in ParseFrontendArgs()
3014 // If we have c++-{user,system}-header, that indicates a header unit input in ParseFrontendArgs()
3015 // likewise, if the user put -fmodule-header together with a header with an in ParseFrontendArgs()
3016 // absolute path (header-unit-header). in ParseFrontendArgs()
3019 if (XValue.consume_back("-header-unit")) in ParseFrontendArgs()
3021 else if (XValue.consume_back("-system")) in ParseFrontendArgs()
3023 else if (XValue.consume_back("-user")) in ParseFrontendArgs()
3027 // The value set by this processing is an un-preprocessed source which is in ParseFrontendArgs()
3040 .Case("objective-c", Language::ObjC) in ParseFrontendArgs()
3041 .Case("objective-c++", Language::ObjCXX) in ParseFrontendArgs()
3046 // "objc[++]-cpp-output" is an acceptable synonym for in ParseFrontendArgs()
3047 // "objective-c[++]-cpp-output". in ParseFrontendArgs()
3059 .Case("cpp-output", InputKind(Language::C).getPreprocessed()) in ParseFrontendArgs()
3060 .Case("assembler-with-cpp", Language::Asm) in ParseFrontendArgs()
3061 .Cases("ast", "pcm", "precompiled-header", in ParseFrontendArgs()
3068 Diags.Report(diag::err_drv_invalid_value) in ParseFrontendArgs()
3069 << A->getAsString(Args) << A->getValue(); in ParseFrontendArgs()
3083 // '-' is the default input if none is given. in ParseFrontendArgs()
3087 Inputs.push_back("-"); in ParseFrontendArgs()
3091 Diags.Report(diag::err_drv_header_unit_extra_inputs) << Inputs[1]; in ParseFrontendArgs()
3108 // The -emit-module action implicitly takes a module map. in ParseFrontendArgs()
3165 // Add -I..., -F..., and -index-header-map options in order. in GenerateHeaderSearchArgs()
3181 if (It->Group == frontend::IndexHeaderMap) in GenerateHeaderSearchArgs()
3183 GenerateArg(Consumer, Opt, It->Path); in GenerateHeaderSearchArgs()
3186 // Note: some paths that came from "[-iprefix=xx] -iwithprefixbefore=yy" may in GenerateHeaderSearchArgs()
3187 // have already been generated as "-I[xx]yy". If that's the case, their in GenerateHeaderSearchArgs()
3194 It->Group == frontend::After ? OPT_iwithprefix : OPT_iwithprefixbefore; in GenerateHeaderSearchArgs()
3195 GenerateArg(Consumer, Opt, It->Path); in GenerateHeaderSearchArgs()
3198 // Note: Some paths that came from "-idirafter=xxyy" may have already been in GenerateHeaderSearchArgs()
3199 // generated as "-iwithprefix=xxyy". If that's the case, their position on in GenerateHeaderSearchArgs()
3202 GenerateArg(Consumer, OPT_idirafter, It->Path); in GenerateHeaderSearchArgs()
3204 GenerateArg(Consumer, OPT_iquote, It->Path); in GenerateHeaderSearchArgs()
3207 GenerateArg(Consumer, It->IgnoreSysRoot ? OPT_isystem : OPT_iwithsysroot, in GenerateHeaderSearchArgs()
3208 It->Path); in GenerateHeaderSearchArgs()
3210 GenerateArg(Consumer, OPT_iframework, It->Path); in GenerateHeaderSearchArgs()
3212 GenerateArg(Consumer, OPT_iframeworkwithsysroot, It->Path); in GenerateHeaderSearchArgs()
3216 GenerateArg(Consumer, OPT_c_isystem, It->Path); in GenerateHeaderSearchArgs()
3218 GenerateArg(Consumer, OPT_cxx_isystem, It->Path); in GenerateHeaderSearchArgs()
3220 GenerateArg(Consumer, OPT_objc_isystem, It->Path); in GenerateHeaderSearchArgs()
3222 GenerateArg(Consumer, OPT_objcxx_isystem, It->Path); in GenerateHeaderSearchArgs()
3225 // Note: Some paths that came from "-internal-isystem" arguments may have in GenerateHeaderSearchArgs()
3226 // already been generated as "-isystem". If that's the case, their position on in GenerateHeaderSearchArgs()
3231 OptSpecifier Opt = It->Group == frontend::System in GenerateHeaderSearchArgs()
3234 GenerateArg(Consumer, Opt, It->Path); in GenerateHeaderSearchArgs()
3263 Opts.UseLibcxx = (strcmp(A->getValue(), "libc++") == 0); in ParseHeaderSearchArgs()
3265 // Canonicalize -fmodules-cache-path before storing it. in ParseHeaderSearchArgs()
3276 // Only the -fmodule-file=<name>=<file> form. in ParseHeaderSearchArgs()
3278 StringRef Val = A->getValue(); in ParseHeaderSearchArgs()
3286 Opts.AddPrebuiltModulePath(A->getValue()); in ParseHeaderSearchArgs()
3289 StringRef MacroDef = A->getValue(); in ParseHeaderSearchArgs()
3294 // Add -I..., -F..., and -index-header-map options in order. in ParseHeaderSearchArgs()
3303 bool IsFramework = false) -> std::string { in ParseHeaderSearchArgs()
3304 assert(A->getNumValues() && "Unexpected empty search path flag!"); in ParseHeaderSearchArgs()
3305 if (IsSysrootSpecified && !IsFramework && A->getValue()[0] == '=') { in ParseHeaderSearchArgs()
3308 llvm::StringRef(A->getValue()).substr(1)); in ParseHeaderSearchArgs()
3311 return A->getValue(); in ParseHeaderSearchArgs()
3315 if (A->getOption().matches(OPT_index_header_map)) { in ParseHeaderSearchArgs()
3316 // -index-header-map applies to the next -I or -F. in ParseHeaderSearchArgs()
3324 bool IsFramework = A->getOption().matches(OPT_F); in ParseHeaderSearchArgs()
3330 // Add -iprefix/-iwithprefix/-iwithprefixbefore options. in ParseHeaderSearchArgs()
3334 if (A->getOption().matches(OPT_iprefix)) in ParseHeaderSearchArgs()
3335 Prefix = A->getValue(); in ParseHeaderSearchArgs()
3336 else if (A->getOption().matches(OPT_iwithprefix)) in ParseHeaderSearchArgs()
3337 Opts.AddPath(Prefix.str() + A->getValue(), frontend::After, false, true); in ParseHeaderSearchArgs()
3339 Opts.AddPath(Prefix.str() + A->getValue(), frontend::Angled, false, true); in ParseHeaderSearchArgs()
3348 if (A->getOption().matches(OPT_iwithsysroot)) { in ParseHeaderSearchArgs()
3349 Opts.AddPath(A->getValue(), frontend::System, false, in ParseHeaderSearchArgs()
3356 Opts.AddPath(A->getValue(), frontend::System, true, true); in ParseHeaderSearchArgs()
3358 Opts.AddPath(A->getValue(), frontend::System, /*IsFramework=*/true, in ParseHeaderSearchArgs()
3363 Opts.AddPath(A->getValue(), frontend::CSystem, false, true); in ParseHeaderSearchArgs()
3365 Opts.AddPath(A->getValue(), frontend::CXXSystem, false, true); in ParseHeaderSearchArgs()
3367 Opts.AddPath(A->getValue(), frontend::ObjCSystem, false,true); in ParseHeaderSearchArgs()
3369 Opts.AddPath(A->getValue(), frontend::ObjCXXSystem, false, true); in ParseHeaderSearchArgs()
3375 if (A->getOption().matches(OPT_internal_externc_isystem)) in ParseHeaderSearchArgs()
3377 Opts.AddPath(A->getValue(), Group, false, true); in ParseHeaderSearchArgs()
3384 A->getValue(), A->getOption().matches(OPT_system_header_prefix)); in ParseHeaderSearchArgs()
3387 Opts.AddVFSOverlayFile(A->getValue()); in ParseHeaderSearchArgs()
3405 if (Opts.SwiftVersion.tryParse(A->getValue())) in ParseAPINotesArgs()
3406 diags.Report(diag::err_drv_invalid_value) in ParseAPINotesArgs()
3407 << A->getAsString(Args) << A->getValue(); in ParseAPINotesArgs()
3410 Opts.ModuleSearchPaths.push_back(A->getValue()); in ParseAPINotesArgs()
3483 // FIXME: What -std= values should be permitted for CUDA compilations? in IsInputCompatibleWithStandard()
3491 // Accept (and ignore) all -std= values. in IsInputCompatibleWithStandard()
3492 // FIXME: The -std= value is not ignored; it affects the tokenization in IsInputCompatibleWithStandard()
3509 return "Objective-C"; in GetInputKindName()
3513 return "Objective-C++"; in GetInputKindName()
3591 // The '-fcf-protection=' option is generated by CodeGenOpts generator. in GenerateLangArgs()
3670 // Not generating '-mrtd', it's just an alias for '-fdefault-calling-conv='. in GenerateLangArgs()
3672 // OpenMP was requested via '-fopenmp', not implied by '-fopenmp-simd' or in GenerateLangArgs()
3673 // '-fopenmp-targets='. in GenerateLangArgs()
3751 GenerateArg(Consumer, OPT_ffp_contract, "fast-honor-pragmas"); in GenerateLangArgs()
3756 // Conflating '-fsanitize-system-ignorelist' and '-fsanitize-ignorelist'. in GenerateLangArgs()
3803 GenerateArg(Consumer, OPT_msign_return_address_EQ, "non-leaf"); in GenerateLangArgs()
3848 parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ), in ParseLangArgs()
3857 // FIXME: Cleanup per-file based stuff. in ParseLangArgs()
3860 LangStd = LangStandard::getLangKind(A->getValue()); in ParseLangArgs()
3862 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
3863 << A->getAsString(Args) << A->getValue(); in ParseLangArgs()
3871 auto Diag = Diags.Report(diag::note_drv_use_standard); in ParseLangArgs() local
3872 Diag << Std.getName() << Std.getDescription(); in ParseLangArgs()
3879 Diag << NumAliases; in ParseLangArgs()
3882 if (KindValue == LangStandard::lang_##id) Diag << alias; in ParseLangArgs()
3892 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseLangArgs()
3893 << A->getAsString(Args) << GetInputKindName(IK); in ParseLangArgs()
3898 // -cl-std only applies for OpenCL language standards. in ParseLangArgs()
3899 // Override the -std option in this case. in ParseLangArgs()
3902 = llvm::StringSwitch<LangStandard::Kind>(A->getValue()) in ParseLangArgs()
3915 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
3916 << A->getAsString(Args) << A->getValue(); in ParseLangArgs()
3929 // "LangOpts->". Let's provide the expected variable name and type. in ParseLangArgs()
3938 StringRef Name = A->getValue(); in ParseLangArgs()
3946 // If the user supplied -fsycl-is-device or -fsycl-is-host, but failed to in ParseLangArgs()
3947 // provide -sycl-std=, we want to default it to whatever the default SYCL in ParseLangArgs()
3948 // version is. I could not find a way to express this with the options in ParseLangArgs()
3956 StringRef value = arg->getValue(); in ParseLangArgs()
3958 Diags.Report(diag::err_drv_unknown_objc_runtime) << value; in ParseLangArgs()
3968 Diags.Report(diag::err_arc_unsupported_on_runtime); in ParseLangArgs()
3973 // determined by -fobjc-runtime, but we allow it to be overridden in ParseLangArgs()
3981 // Note that we allow -fno-objc-weak to disable this even in ARC mode. in ParseLangArgs()
3983 if (!weakArg->getOption().matches(OPT_fobjc_weak)) { in ParseLangArgs()
3986 Diags.Report(diag::err_objc_weak_with_gc); in ParseLangArgs()
3988 Diags.Report(diag::err_objc_weak_unsupported); in ParseLangArgs()
4002 // Check that the version has 1 to 3 components and the minor and patch in ParseLangArgs()
4005 bool Invalid = GNUCVer.tryParse(A->getValue()); in ParseLangArgs()
4010 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
4011 << A->getAsString(Args) << A->getValue(); in ParseLangArgs()
4031 if (VT.tryParse(A->getValue())) in ParseLangArgs()
4032 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) in ParseLangArgs()
4033 << A->getValue(); in ParseLangArgs()
4039 // Mimicking gcc's behavior, trigraphs are only enabled if -trigraphs in ParseLangArgs()
4040 // is specified, or -std is set to a conforming mode. in ParseLangArgs()
4060 if (A->getOption().matches(options::OPT_mlong_double_64)) in ParseLangArgs()
4062 else if (A->getOption().matches(options::OPT_mlong_double_80)) in ParseLangArgs()
4064 else if (A->getOption().matches(options::OPT_mlong_double_128)) in ParseLangArgs()
4074 // -mrtd option in ParseLangArgs()
4077 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseLangArgs()
4078 << A->getSpelling() << "-fdefault-calling-conv"; in ParseLangArgs()
4088 Diags.Report(diag::err_drv_argument_not_allowed_with) in ParseLangArgs()
4089 << A->getSpelling() << T.getTriple(); in ParseLangArgs()
4094 // Check if -fopenmp is specified and set default version to 5.0. in ParseLangArgs()
4096 // Check if -fopenmp-simd is specified. in ParseLangArgs()
4114 if (int Version = getLastArgIntValue( in ParseLangArgs() local
4117 Opts.OpenMP = Version; in ParseLangArgs()
4127 Diags.Report(diag::err_drv_omp_host_target_not_supported) << T.str(); in ParseLangArgs()
4178 assert(T.isArch64Bit() && "Expected 64-bit architecture"); in ParseLangArgs()
4182 for (unsigned i = 0; i < A->getNumValues(); ++i) { in ParseLangArgs()
4183 llvm::Triple TT(A->getValue(i)); in ParseLangArgs()
4193 Diags.Report(diag::err_drv_invalid_omp_target) << A->getValue(i); in ParseLangArgs()
4195 Diags.Report(diag::err_drv_incompatible_omp_arch) in ParseLangArgs()
4196 << A->getValue(i) << T.str(); in ParseLangArgs()
4205 Opts.OMPHostIRFile = A->getValue(); in ParseLangArgs()
4207 Diags.Report(diag::err_drv_omp_host_ir_file_not_found) in ParseLangArgs()
4221 Opts.OpenACCMacroOverride = A->getValue(); in ParseLangArgs()
4231 // optimization level and -fno-inline, not actually whether the backend has in ParseLangArgs()
4237 if (InlineArg->getOption().matches(options::OPT_fno_inline)) in ParseLangArgs()
4241 StringRef Val = A->getValue(); in ParseLangArgs()
4248 else if (Val == "fast-honor-pragmas") in ParseLangArgs()
4251 Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; in ParseLangArgs()
4254 // Parse -fsanitize= arguments. in ParseLangArgs()
4255 parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ), in ParseLangArgs()
4267 StringRef Ver = A->getValue(); in ParseLangArgs()
4271 // Check the version number is valid: either 3.x (0 <= x <= 9) or in ParseLangArgs()
4272 // y or y.0 (4 <= y <= current version). in ParseLangArgs()
4280 // Got a valid version number. in ParseLangArgs()
4304 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
4305 << A->getAsString(Args) << A->getValue(); in ParseLangArgs()
4310 StringRef SignScope = A->getValue(); in ParseLangArgs()
4318 else if (SignScope.equals_insensitive("non-leaf")) in ParseLangArgs()
4322 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
4323 << A->getAsString(Args) << SignScope; in ParseLangArgs()
4326 StringRef SignKey = A->getValue(); in ParseLangArgs()
4335 Diags.Report(diag::err_drv_invalid_value) in ParseLangArgs()
4336 << A->getAsString(Args) << SignKey; in ParseLangArgs()
4345 Diags.Report(diag::err_invalid_cxx_abi) << CXXABI; in ParseLangArgs()
4349 Diags.Report(diag::err_unsupported_cxx_abi) << CXXABI << T.str(); in ParseLangArgs()
4366 Diags.Report(diag::err_drv_using_omit_rtti_component_without_no_rtti); in ParseLangArgs()
4380 // Error if -mvscale-min is unbounded. in ParseLangArgs()
4383 if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0) in ParseLangArgs()
4384 Diags.Report(diag::err_cc1_unbounded_vscale_min); in ParseLangArgs()
4388 std::ifstream SeedFile(A->getValue(0)); in ParseLangArgs()
4391 Diags.Report(diag::err_drv_cannot_open_randomize_layout_seed_file) in ParseLangArgs()
4392 << A->getValue(0); in ParseLangArgs()
4398 Opts.RandstructSeed = A->getValue(0); in ParseLangArgs()
4402 // TODO: Revisit restricting SPIR-V to logical once we've figured out how to in ParseLangArgs()
4411 Diags.Report(diag::err_drv_hlsl_bad_shader_required_in_target) in ParseLangArgs()
4414 Diags.Report(diag::err_drv_hlsl_bad_shader_required_in_target) in ParseLangArgs()
4417 Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported) in ParseLangArgs()
4423 Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported) in ParseLangArgs()
4426 // Validate that if fnative-half-type is given, that in ParseLangArgs()
4434 Diags.Report(diag::err_drv_hlsl_16bit_types_unsupported) in ParseLangArgs()
4435 << "-enable-16bit-types" << true << Std.getName() in ParseLangArgs()
4440 Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported) in ParseLangArgs()
4447 Diags.Report(diag::err_drv_hlsl_16bit_types_unsupported) in ParseLangArgs()
4448 << "-fnative-half-type" << false << Std.getName(); in ParseLangArgs()
4451 llvm_unreachable("expected DXIL or SPIR-V target"); in ParseLangArgs()
4454 Diags.Report(diag::err_drv_hlsl_unsupported_target) << T.str(); in ParseLangArgs()
4532 // -fcf-protection option that is generated elsewhere. in GeneratePreprocessorArgs()
4550 ((LangOpts.DeclareOpenCLBuiltins && I == "opencl-c-base.h") || in GeneratePreprocessorArgs()
4551 I == "opencl-c.h")) in GeneratePreprocessorArgs()
4597 Opts.DeserializedPCHDeclsToErrorOn.insert(A->getValue()); in ParsePreprocessorArgs()
4600 StringRef Value(A->getValue()); in ParsePreprocessorArgs()
4608 Diags.Report(diag::err_drv_preamble_format); in ParsePreprocessorArgs()
4617 StringRef Name = A->getValue(); in ParsePreprocessorArgs()
4628 if (A->getOption().matches(OPT_D)) in ParsePreprocessorArgs()
4629 Opts.addMacroDef(A->getValue()); in ParsePreprocessorArgs()
4631 Opts.addMacroUndef(A->getValue()); in ParsePreprocessorArgs()
4634 // Add the ordered list of -includes. in ParsePreprocessorArgs()
4636 Opts.Includes.emplace_back(A->getValue()); in ParsePreprocessorArgs()
4639 Opts.ChainedIncludes.emplace_back(A->getValue()); in ParsePreprocessorArgs()
4642 std::pair<StringRef, StringRef> Split = StringRef(A->getValue()).split(';'); in ParsePreprocessorArgs()
4645 Diags.Report(diag::err_drv_invalid_remap_file) << A->getAsString(Args); in ParsePreprocessorArgs()
4653 StringRef Epoch = A->getValue(); in ParsePreprocessorArgs()
4654 // SOURCE_DATE_EPOCH, if specified, must be a non-negative decimal integer. in ParsePreprocessorArgs()
4656 // 9999-12-31T23:59:59Z) as the upper bound. in ParsePreprocessorArgs()
4661 Diags.Report(diag::err_fe_invalid_source_date_epoch) in ParsePreprocessorArgs()
4669 StringRef Val = A->getValue(); in ParsePreprocessorArgs()
4753 llvm::VersionTuple Version; in ParseTargetArgs() local
4754 if (Version.tryParse(A->getValue())) in ParseTargetArgs()
4755 Diags.Report(diag::err_drv_invalid_value) in ParseTargetArgs()
4756 << A->getAsString(Args) << A->getValue(); in ParseTargetArgs()
4758 Opts.SDKVersion = Version; in ParseTargetArgs()
4762 llvm::VersionTuple Version; in ParseTargetArgs() local
4763 if (Version.tryParse(A->getValue())) in ParseTargetArgs()
4764 Diags.Report(diag::err_drv_invalid_value) in ParseTargetArgs()
4765 << A->getAsString(Args) << A->getValue(); in ParseTargetArgs()
4767 Opts.DarwinTargetVariantSDKVersion = Version; in ParseTargetArgs()
4788 Diags.Report(diag::err_drv_missing_argument) in CreateFromArgsImpl()
4793 auto ArgString = A->getAsString(Args); in CreateFromArgsImpl()
4796 Diags.Report(diag::err_drv_unknown_argument) << ArgString; in CreateFromArgsImpl()
4798 Diags.Report(diag::err_drv_unknown_argument_with_suggestion) in CreateFromArgsImpl()
4825 !Diags.isIgnored(diag::warn_profile_data_misexpect, SourceLocation())) { in CreateFromArgsImpl()
4831 // During CUDA device-side compilation, the aux triple is the in CreateFromArgsImpl()
4864 Diags.Report(diag::err_fe_dependency_file_requires_MT); in CreateFromArgsImpl()
4870 Diags.Report(diag::warn_drv_fine_grained_bitfield_accesses_ignored); in CreateFromArgsImpl()
4873 // Store the command-line for using in the CodeView backend. in CreateFromArgsImpl()
4908 Args.push_back("-cc1"); in CreateFromArgs()
4919 // dumped via the -module-info flag. in getModuleHash()
4921 // Start the signature with the compiler version. in getModuleHash()
4924 // Also include the serialization version, in case LLVM_APPEND_VC_REV is off in getModuleHash()
4929 #define LANGOPT(Name, Bits, Default, Description) HBuilder.add(LangOpts->Name); in getModuleHash()
4931 HBuilder.add(static_cast<unsigned>(LangOpts->get##Name())); in getModuleHash()
4991 ext->hashExtension(HBuilder); in getModuleHash()
4993 // Extend the signature with the Swift version for API notes. in getModuleHash()
5005 // When compiling with -gmodules, also hash -fdebug-prefix-map as it in getModuleHash()
5012 #define DEBUGOPT(Name, Bits, Default) HBuilder.add(CodeGenOpts->Name); in getModuleHash()
5013 #define VALUE_DEBUGOPT(Name, Bits, Default) HBuilder.add(CodeGenOpts->Name); in getModuleHash()
5015 HBuilder.add(static_cast<unsigned>(CodeGenOpts->get##Name())); in getModuleHash()
5060 std::vector<std::string> Args{"-cc1"}; in getCC1CommandLine()
5079 /// so use the default values so they may be dropped from the command-line. in clearImplicitModuleBuildOptions()
5109 Result->getBufferForFile(File); in createVFSFromOverlayFiles()
5111 Diags.Report(diag::err_missing_vfs_overlay_file) << File; in createVFSFromOverlayFiles()
5119 Diags.Report(diag::err_invalid_vfs_overlay) << File; in createVFSFromOverlayFiles()