Ejemplo n.º 1
0
static FloatABI::Type getARMFloatABI(const llvm::Triple &triple,
                                     const char *llvmArchSuffix) {
  switch (triple.getOS()) {
  case llvm::Triple::Darwin:
  case llvm::Triple::MacOSX:
  case llvm::Triple::IOS: {
    // Darwin defaults to "softfp" for v6 and v7.
    if (llvm::StringRef(llvmArchSuffix).startswith("v6") ||
        llvm::StringRef(llvmArchSuffix).startswith("v7")) {
      return FloatABI::SoftFP;
    }
    return FloatABI::Soft;
  }

  case llvm::Triple::FreeBSD:
    // FreeBSD defaults to soft float
    return FloatABI::Soft;

  default:
    if (triple.getVendorName().startswith("hardfloat"))
      return FloatABI::Hard;
    if (triple.getVendorName().startswith("softfloat"))
      return FloatABI::SoftFP;

    switch (triple.getEnvironment()) {
    case llvm::Triple::GNUEABIHF:
      return FloatABI::Hard;
    case llvm::Triple::GNUEABI:
      return FloatABI::SoftFP;
    case llvm::Triple::EABI:
      // EABI is always AAPCS, and if it was not marked 'hard', it's softfp
      return FloatABI::SoftFP;
    case llvm::Triple::Android: {
      if (llvm::StringRef(llvmArchSuffix).startswith("v7")) {
        return FloatABI::SoftFP;
      }
      return FloatABI::Soft;
    }
    default:
      // Assume "soft".
      // TODO: Warn the user we are guessing.
      return FloatABI::Soft;
    }
  }
}
Ejemplo n.º 2
0
RenderScript32TargetInfo::RenderScript32TargetInfo(const llvm::Triple &Triple,
                                                   const TargetOptions &Opts)
    : ARMleTargetInfo(llvm::Triple("armv7", Triple.getVendorName(),
                                   Triple.getOSName(),
                                   Triple.getEnvironmentName()),
                      Opts) {
  IsRenderScriptTarget = true;
  LongWidth = LongAlign = 64;
}
Ejemplo n.º 3
0
std::unique_ptr<ELFLinkingContext>
elf::createExampleLinkingContext(llvm::Triple triple) {
  if (triple.getVendorName() == "example")
    return llvm::make_unique<ExampleLinkingContext>(triple);
  return nullptr;
}