本文整理汇总了C++中llvm::Triple::isOSVersionLT方法的典型用法代码示例。如果您正苦于以下问题:C++ Triple::isOSVersionLT方法的具体用法?C++ Triple::isOSVersionLT怎么用?C++ Triple::isOSVersionLT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::Triple
的用法示例。
在下文中一共展示了Triple::isOSVersionLT方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wantsObjCRuntime
/// Returns true if the compiler depends on features provided by the ObjC
/// runtime that are not present on the deployment target indicated by
/// \p triple.
static bool wantsObjCRuntime(const llvm::Triple &triple) {
assert((!triple.isTvOS() || triple.isiOS()) &&
"tvOS is considered a kind of iOS");
// When updating the versions listed here, please record the most recent
// feature being depended on and when it was introduced:
//
// - The hook to override class_getImageName (macOS 10.14 and equivalent)
if (triple.isiOS())
return triple.isOSVersionLT(12);
if (triple.isMacOSX())
return triple.isMacOSXVersionLT(10, 14);
if (triple.isWatchOS())
return triple.isOSVersionLT(5);
llvm_unreachable("unknown Darwin OS");
}
示例2: isTargetTooNew
static bool isTargetTooNew(const llvm::Triple &moduleTarget,
const llvm::Triple &ctxTarget) {
unsigned major, minor, micro;
if (moduleTarget.isMacOSX()) {
moduleTarget.getMacOSXVersion(major, minor, micro);
return ctxTarget.isMacOSXVersionLT(major, minor, micro);
}
moduleTarget.getOSVersion(major, minor, micro);
return ctxTarget.isOSVersionLT(major, minor, micro);
}
示例3: wantsObjCRuntime
/// Returns true if the compiler depends on features provided by the ObjC
/// runtime that are not present on the deployment target indicated by
/// \p triple.
static bool wantsObjCRuntime(const llvm::Triple &triple) {
assert((!triple.isTvOS() || triple.isiOS()) &&
"tvOS is considered a kind of iOS");
// When updating the versions listed here, please record the most recent
// feature being depended on and when it was introduced:
//
// - Make assigning 'nil' to an NSMutableDictionary subscript delete the
// entry, like it does for Swift.Dictionary, rather than trap.
if (triple.isiOS())
return triple.isOSVersionLT(9);
if (triple.isMacOSX())
return triple.isMacOSXVersionLT(10, 11);
if (triple.isWatchOS())
return false;
llvm_unreachable("unknown Darwin OS");
}
示例4: getARMTargetFeatures
//.........这里部分代码省略.........
const Arg *HDivArg = Args.getLastArg(options::OPT_mhwdiv_EQ);
if (WaHDiv) {
if (HDivArg)
D.Diag(clang::diag::warn_drv_unused_argument)
<< HDivArg->getAsString(Args);
getARMHWDivFeatures(D, WaHDiv, Args,
StringRef(WaHDiv->getValue()).substr(8), Features);
} else if (HDivArg)
getARMHWDivFeatures(D, HDivArg, Args, HDivArg->getValue(), Features);
// Setting -msoft-float effectively disables NEON because of the GCC
// implementation, although the same isn't true of VFP or VFP3.
if (ABI == arm::FloatABI::Soft) {
Features.push_back("-neon");
// Also need to explicitly disable features which imply NEON.
Features.push_back("-crypto");
}
// En/disable crc code generation.
if (Arg *A = Args.getLastArg(options::OPT_mcrc, options::OPT_mnocrc)) {
if (A->getOption().matches(options::OPT_mcrc))
Features.push_back("+crc");
else
Features.push_back("-crc");
}
// Look for the last occurrence of -mlong-calls or -mno-long-calls. If
// neither options are specified, see if we are compiling for kernel/kext and
// decide whether to pass "+long-calls" based on the OS and its version.
if (Arg *A = Args.getLastArg(options::OPT_mlong_calls,
options::OPT_mno_long_calls)) {
if (A->getOption().matches(options::OPT_mlong_calls))
Features.push_back("+long-calls");
} else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6)) &&
!Triple.isWatchOS()) {
Features.push_back("+long-calls");
}
// Generate execute-only output (no data access to code sections).
// This only makes sense for the compiler, not for the assembler.
if (!ForAS) {
// Supported only on ARMv6T2 and ARMv7 and above.
// Cannot be combined with -mno-movt or -mlong-calls
if (Arg *A = Args.getLastArg(options::OPT_mexecute_only, options::OPT_mno_execute_only)) {
if (A->getOption().matches(options::OPT_mexecute_only)) {
if (getARMSubArchVersionNumber(Triple) < 7 &&
llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2)
D.Diag(diag::err_target_unsupported_execute_only) << Triple.getArchName();
else if (Arg *B = Args.getLastArg(options::OPT_mno_movt))
D.Diag(diag::err_opt_not_valid_with_opt) << A->getAsString(Args) << B->getAsString(Args);
// Long calls create constant pool entries and have not yet been fixed up
// to play nicely with execute-only. Hence, they cannot be used in
// execute-only code for now
else if (Arg *B = Args.getLastArg(options::OPT_mlong_calls, options::OPT_mno_long_calls)) {
if (B->getOption().matches(options::OPT_mlong_calls))
D.Diag(diag::err_opt_not_valid_with_opt) << A->getAsString(Args) << B->getAsString(Args);
}
Features.push_back("+execute-only");
}
}
}
// Kernel code has more strict alignment requirements.
if (KernelOrKext)
Features.push_back("+strict-align");
else if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,