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

1 //===--- Hexagon.cpp - Hexagon ToolChain Implementations --------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
28 // Default hvx-length for various versions.
38 // Handle the unsupported values passed to mhvx-length. in handleHVXWarnings()
40 StringRef Val = A->getValue(); in handleHVXWarnings()
42 D.Diag(diag::err_drv_unsupported_option_argument) in handleHVXWarnings()
43 << A->getSpelling() << Val; in handleHVXWarnings()
54 auto makeFeature = [&Args](Twine T, bool Enable) -> StringRef { in handleHVXTargetFeatures()
58 if (Opt.starts_with("mno-")) in handleHVXTargetFeatures()
62 return Args.MakeArgString(Twine(Enable ? "+" : "-") + Twine(Opt)); in handleHVXTargetFeatures()
65 auto withMinus = [](StringRef S) -> std::string { in handleHVXTargetFeatures()
66 return "-" + S.str(); in handleHVXTargetFeatures()
69 // Drop tiny core suffix for HVX version. in handleHVXTargetFeatures()
74 // Handle -mhvx, -mhvx=, -mno-hvx. If versioned and versionless flags in handleHVXTargetFeatures()
80 if (HvxEnablingArg->getOption().matches(options::OPT_mno_hexagon_hvx)) in handleHVXTargetFeatures()
85 // If -mhvx[=] was given, it takes precedence. in handleHVXTargetFeatures()
88 // If the version was given, set HvxVer. Otherwise HvxVer in handleHVXTargetFeatures()
89 // will remain equal to the CPU version. in handleHVXTargetFeatures()
90 if (A->getOption().matches(options::OPT_mhexagon_hvx_EQ)) in handleHVXTargetFeatures()
91 HvxVer = StringRef(A->getValue()).lower(); in handleHVXTargetFeatures()
96 // If there was an explicit -mno-hvx, add -hvx to target features. in handleHVXTargetFeatures()
97 Features.push_back(makeFeature(A->getOption().getName(), false)); in handleHVXTargetFeatures()
102 // Handle -mhvx-length=. in handleHVXTargetFeatures()
106 D.Diag(diag::err_drv_needs_hvx) << withMinus(A->getOption().getName()); in handleHVXTargetFeatures()
107 else if (A->getOption().matches(options::OPT_mhexagon_hvx_length_EQ)) in handleHVXTargetFeatures()
108 HvxLen = A->getValue(); in handleHVXTargetFeatures()
112 StringRef L = makeFeature(Twine("hvx-length") + HvxLen.lower(), true); in handleHVXTargetFeatures()
124 unsigned MinVerNum) -> std::optional<StringRef> { in handleHVXTargetFeatures()
126 // - std::nullopt indicates a verification failure, or that the flag was not in handleHVXTargetFeatures()
128 // - Otherwise the returned value is that name of the feature to add in handleHVXTargetFeatures()
134 StringRef OptName = A->getOption().getName(); in handleHVXTargetFeatures()
135 if (A->getOption().matches(FlagOff)) in handleHVXTargetFeatures()
139 D.Diag(diag::err_drv_needs_hvx) << withMinus(OptName); in handleHVXTargetFeatures()
143 D.Diag(diag::err_drv_needs_hvx_version) in handleHVXTargetFeatures()
171 if (A->getOption().matches(options::OPT_mlong_calls)) in getHexagonTargetFeatures()
175 Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls"); in getHexagonTargetFeatures()
179 // 't' in Cpu denotes tiny-core micro-architecture. For now, the co-processors in getHexagonTargetFeatures()
180 // have no dependency on micro-architecture. in getHexagonTargetFeatures()
184 Cpu = Cpu.take_front(Cpu.size() - 1); in getHexagonTargetFeatures()
189 D.Diag(diag::warn_drv_needs_hvx) << "auto-vectorization"; in getHexagonTargetFeatures()
208 CmdArgs.push_back("--arch=hexagon"); in ConstructJob()
212 const char *AsName = "llvm-mc"; in ConstructJob()
213 CmdArgs.push_back("-filetype=obj"); in ConstructJob()
215 "-mcpu=hexagon" + in ConstructJob()
222 CmdArgs.push_back("-o"); in ConstructJob()
225 CmdArgs.push_back("-fsyntax-only"); in ConstructJob()
230 if (A->getOption().matches(options::OPT_mhexagon_hvx_ieee_fp)) in ConstructJob()
231 CmdArgs.push_back("-mhvx-ieee-fp"); in ConstructJob()
235 CmdArgs.push_back(Args.MakeArgString("-gpsize=" + Twine(*G))); in ConstructJob()
240 // Only pass -x if gcc will understand it; otherwise hope gcc in ConstructJob()
244 // like '-x foobar a.c' which will treat a.c like a linker input. in ConstructJob()
247 // inputs into '-Wl,' options? in ConstructJob()
251 D.Diag(clang::diag::err_drv_no_linker_llvm_support) in ConstructJob()
254 D.Diag(clang::diag::err_drv_no_ast_support) in ConstructJob()
257 D.Diag(diag::err_drv_no_module_support) in ConstructJob()
287 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
289 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
307 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
309 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
316 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
318 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
320 CmdArgs.push_back("-s"); in constructHexagonLinkArgs()
323 CmdArgs.push_back("-r"); in constructHexagonLinkArgs()
329 CmdArgs.push_back("-march=hexagon"); in constructHexagonLinkArgs()
330 CmdArgs.push_back(Args.MakeArgString("-mcpu=hexagon" + CpuVer)); in constructHexagonLinkArgs()
334 CmdArgs.push_back("-shared"); in constructHexagonLinkArgs()
335 // The following should be the default, but doing as hexagon-gcc does. in constructHexagonLinkArgs()
336 CmdArgs.push_back("-call_shared"); in constructHexagonLinkArgs()
340 CmdArgs.push_back("-static"); in constructHexagonLinkArgs()
343 CmdArgs.push_back("-pie"); in constructHexagonLinkArgs()
346 CmdArgs.push_back(Args.MakeArgString("-G" + Twine(*G))); in constructHexagonLinkArgs()
350 CmdArgs.push_back("-o"); in constructHexagonLinkArgs()
355 CmdArgs.push_back("-dynamic-linker=/lib/ld-musl-hexagon.so.1"); in constructHexagonLinkArgs()
365 Args.MakeArgString(StringRef("-L") + D.SysRoot + "/usr/lib")); in constructHexagonLinkArgs()
377 CmdArgs.push_back("-lunwind"); in constructHexagonLinkArgs()
382 CmdArgs.push_back("-lclang_rt.builtins-hexagon"); in constructHexagonLinkArgs()
384 CmdArgs.push_back("-lc"); in constructHexagonLinkArgs()
392 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath)); in constructHexagonLinkArgs()
397 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
399 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
403 A->claim(); in constructHexagonLinkArgs()
404 OsLibs.emplace_back(A->getValue()); in constructHexagonLinkArgs()
412 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
414 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
423 const char *Name) -> std::string { in constructHexagonLinkArgs()
446 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
448 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
451 CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath)); in constructHexagonLinkArgs()
454 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
456 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
462 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
464 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
469 CmdArgs.push_back("-lm"); in constructHexagonLinkArgs()
472 CmdArgs.push_back("--start-group"); in constructHexagonLinkArgs()
476 CmdArgs.push_back(Args.MakeArgString("-l" + Lib)); in constructHexagonLinkArgs()
478 CmdArgs.push_back("-lc"); in constructHexagonLinkArgs()
480 CmdArgs.push_back("-lgcc"); in constructHexagonLinkArgs()
482 CmdArgs.push_back("--end-group"); in constructHexagonLinkArgs()
485 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
487 //---------------------------------------------------------------------------- in constructHexagonLinkArgs()
537 Gn = A->getValue(); in getSmallDataThreshold()
563 //---------------------------------------------------------------------------- in getHexagonLibraryPaths()
564 // -L Args in getHexagonLibraryPaths()
565 //---------------------------------------------------------------------------- in getHexagonLibraryPaths()
567 llvm::append_range(LibPaths, A->getValues()); in getHexagonLibraryPaths()
569 //---------------------------------------------------------------------------- in getHexagonLibraryPaths()
571 //---------------------------------------------------------------------------- in getHexagonLibraryPaths()
581 // Assume G0 with -shared. in getHexagonLibraryPaths()
629 getDriver().Diag(diag::err_drv_unsupported_unwind_for_platform) in AddCXXStdlibLibArgs()
630 << A->getValue() << getTriple().normalize(); in AddCXXStdlibLibArgs()
637 CmdArgs.push_back("-lc++"); in AddCXXStdlibLibArgs()
639 CmdArgs.push_back("-lc++experimental"); in AddCXXStdlibLibArgs()
640 CmdArgs.push_back("-lc++abi"); in AddCXXStdlibLibArgs()
642 CmdArgs.push_back("-lunwind"); in AddCXXStdlibLibArgs()
646 CmdArgs.push_back("-lstdc++"); in AddCXXStdlibLibArgs()
666 if (A->getOption().matches(options::OPT_O0)) in getOptimizationLevel()
668 if (A->getOption().matches(options::OPT_Ofast) || in getOptimizationLevel()
669 A->getOption().matches(options::OPT_O4)) in getOptimizationLevel()
671 assert(A->getNumValues() != 0); in getOptimizationLevel()
672 StringRef S(A->getValue()); in getOptimizationLevel()
693 CC1Args.push_back("-fno-use-init-array"); in addClangTargetOptions()
696 CC1Args.push_back("-target-feature"); in addClangTargetOptions()
697 CC1Args.push_back("+reserved-r19"); in addClangTargetOptions()
700 CC1Args.push_back("-mllvm"); in addClangTargetOptions()
701 CC1Args.push_back("-hexagon-autohvx"); in addClangTargetOptions()
782 StringRef Value = A->getValue(); in GetCXXStdlibType()
784 getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args); in GetCXXStdlibType()
797 return A->getOption().matches(options::OPT_fvectorize); in isAutoHVXEnabled()
803 // if no Hexagon processor is selected at the command-line.
814 StringRef CPU = CpuArg ? CpuArg->getValue() : GetDefaultCPU(); in GetTargetCPUVersion()