本文整理汇总了C++中Triple::getVendor方法的典型用法代码示例。如果您正苦于以下问题:C++ Triple::getVendor方法的具体用法?C++ Triple::getVendor怎么用?C++ Triple::getVendor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triple
的用法示例。
在下文中一共展示了Triple::getVendor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: triplesMatch
// This function returns true if the triples match.
static bool triplesMatch(const Triple &T0, const Triple &T1) {
// If vendor is apple, ignore the version number.
if (T0.getVendor() == Triple::Apple)
return T0.getArch() == T1.getArch() && T0.getSubArch() == T1.getSubArch() &&
T0.getVendor() == T1.getVendor() && T0.getOS() == T1.getOS();
return T0 == T1;
}
示例2: getDefaultSubtargetFeatures
/// getDefaultSubtargetFeatures - Return a string listing the features
/// associated with the target triple.
///
/// FIXME: This is an inelegant way of specifying the features of a
/// subtarget. It would be better if we could encode this information
/// into the IR. See <rdar://5972456>.
///
void SubtargetFeatures::getDefaultSubtargetFeatures(const std::string &CPU,
const Triple& Triple) {
setCPU(CPU);
const char *Attrs = 0;
switch (Triple.getVendor()) {
case Triple::Apple:
switch (Triple.getArch()) {
case Triple::ppc: // powerpc-apple-*
Attrs = "altivec";
break;
case Triple::ppc64: // powerpc64-apple-*
Attrs = "64bit,altivec";
break;
default:
break;
}
break;
default:
break;
}
if (!Attrs) return;
StringRef SR(Attrs);
while (!SR.empty()) {
std::pair<StringRef, StringRef> Res = SR.split(',');
AddFeature(Res.first);
SR = Res.second;
}
}
示例3: mergeTriples
// This function returns the merged triple.
static std::string mergeTriples(const Triple &SrcTriple,
const Triple &DstTriple) {
// If vendor is apple, pick the triple with the larger version number.
if (SrcTriple.getVendor() == Triple::Apple)
if (DstTriple.isOSVersionLT(SrcTriple))
return SrcTriple.str();
return DstTriple.str();
}
示例4: getDefaultSubtargetFeatures
/// Adds the default features for the specified target triple.
///
/// FIXME: This is an inelegant way of specifying the features of a
/// subtarget. It would be better if we could encode this information
/// into the IR. See <rdar://5972456>.
///
void SubtargetFeatures::getDefaultSubtargetFeatures(const Triple& Triple) {
if (Triple.getVendor() == Triple::Apple) {
if (Triple.getArch() == Triple::ppc) {
// powerpc-apple-*
AddFeature("altivec");
} else if (Triple.getArch() == Triple::ppc64) {
// powerpc64-apple-*
AddFeature("64bit");
AddFeature("altivec");
}
}
}