当前位置: 首页>>代码示例>>C++>>正文


C++ Triple::getVendor方法代码示例

本文整理汇总了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;
}
开发者ID:yxsamliu,项目名称:llvm,代码行数:9,代码来源:IRMover.cpp

示例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;
  }
}
开发者ID:nickl-,项目名称:xchain-ios,代码行数:40,代码来源:SubtargetFeature.cpp

示例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();
}
开发者ID:yxsamliu,项目名称:llvm,代码行数:10,代码来源:IRMover.cpp

示例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");
    }
  }
}
开发者ID:dongAxis,项目名称:clang-700.0.72,代码行数:18,代码来源:SubtargetFeature.cpp


注:本文中的Triple::getVendor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。