本文整理汇总了C++中llvm::Triple::isOSHaiku方法的典型用法代码示例。如果您正苦于以下问题:C++ Triple::isOSHaiku方法的具体用法?C++ Triple::isOSHaiku怎么用?C++ Triple::isOSHaiku使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::Triple
的用法示例。
在下文中一共展示了Triple::isOSHaiku方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osx
std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
clearAllPlatformConditionValues();
if (triple.getOS() == llvm::Triple::Darwin &&
triple.getVendor() == llvm::Triple::Apple) {
// Rewrite darwinX.Y triples to macosx10.X'.Y ones.
// It affects code generation on our platform.
llvm::SmallString<16> osxBuf;
llvm::raw_svector_ostream osx(osxBuf);
osx << llvm::Triple::getOSTypeName(llvm::Triple::MacOSX);
unsigned major, minor, micro;
triple.getMacOSXVersion(major, minor, micro);
osx << major << "." << minor;
if (micro != 0)
osx << "." << micro;
triple.setOSName(osx.str());
}
Target = std::move(triple);
bool UnsupportedOS = false;
// Set the "os" platform condition.
if (Target.isMacOSX())
addPlatformConditionValue(PlatformConditionKind::OS, "OSX");
else if (triple.isTvOS())
addPlatformConditionValue(PlatformConditionKind::OS, "tvOS");
else if (triple.isWatchOS())
addPlatformConditionValue(PlatformConditionKind::OS, "watchOS");
else if (triple.isiOS())
addPlatformConditionValue(PlatformConditionKind::OS, "iOS");
else if (triple.isAndroid())
addPlatformConditionValue(PlatformConditionKind::OS, "Android");
else if (triple.isOSLinux())
addPlatformConditionValue(PlatformConditionKind::OS, "Linux");
else if (triple.isOSFreeBSD())
addPlatformConditionValue(PlatformConditionKind::OS, "FreeBSD");
else if (triple.isOSWindows())
addPlatformConditionValue(PlatformConditionKind::OS, "Windows");
else if (triple.isWindowsCygwinEnvironment())
addPlatformConditionValue(PlatformConditionKind::OS, "Cygwin");
else if (triple.isPS4())
addPlatformConditionValue(PlatformConditionKind::OS, "PS4");
else if (triple.isOSHaiku())
addPlatformConditionValue(PlatformConditionKind::OS, "Haiku");
else
UnsupportedOS = true;
bool UnsupportedArch = false;
// Set the "arch" platform condition.
switch (Target.getArch()) {
case llvm::Triple::ArchType::arm:
case llvm::Triple::ArchType::thumb:
addPlatformConditionValue(PlatformConditionKind::Arch, "arm");
break;
case llvm::Triple::ArchType::aarch64:
addPlatformConditionValue(PlatformConditionKind::Arch, "arm64");
break;
case llvm::Triple::ArchType::ppc64:
addPlatformConditionValue(PlatformConditionKind::Arch, "powerpc64");
break;
case llvm::Triple::ArchType::ppc64le:
addPlatformConditionValue(PlatformConditionKind::Arch, "powerpc64le");
break;
case llvm::Triple::ArchType::x86:
addPlatformConditionValue(PlatformConditionKind::Arch, "i386");
break;
case llvm::Triple::ArchType::x86_64:
addPlatformConditionValue(PlatformConditionKind::Arch, "x86_64");
break;
case llvm::Triple::ArchType::systemz:
addPlatformConditionValue(PlatformConditionKind::Arch, "s390x");
break;
default:
UnsupportedArch = true;
}
if (UnsupportedOS || UnsupportedArch)
return { UnsupportedOS, UnsupportedArch };
// Set the "_endian" platform condition.
switch (Target.getArch()) {
case llvm::Triple::ArchType::arm:
case llvm::Triple::ArchType::thumb:
addPlatformConditionValue(PlatformConditionKind::Endianness, "little");
break;
case llvm::Triple::ArchType::aarch64:
addPlatformConditionValue(PlatformConditionKind::Endianness, "little");
break;
case llvm::Triple::ArchType::ppc64:
addPlatformConditionValue(PlatformConditionKind::Endianness, "big");
break;
case llvm::Triple::ArchType::ppc64le:
addPlatformConditionValue(PlatformConditionKind::Endianness, "little");
break;
case llvm::Triple::ArchType::x86:
addPlatformConditionValue(PlatformConditionKind::Endianness, "little");
break;
//.........这里部分代码省略.........