Fix the DataLayout string produced by clang for NaCl.

Reviewed by Derek Schuff.

llvm-svn: 197628
This commit is contained in:
Rafael Espindola 2013-12-18 23:41:04 +00:00
parent b79ee57080
commit 1c09b264e3
2 changed files with 16 additions and 5 deletions

View File

@ -624,7 +624,18 @@ public:
this->IntPtrType = TargetInfo::SignedInt; this->IntPtrType = TargetInfo::SignedInt;
// RegParmMax is inherited from the underlying architecture // RegParmMax is inherited from the underlying architecture
this->LongDoubleFormat = &llvm::APFloat::IEEEdouble; this->LongDoubleFormat = &llvm::APFloat::IEEEdouble;
this->DescriptionString = "e-p:32:32-i64:64-v128:32"; if (Triple.getArch() == llvm::Triple::arm) {
this->DescriptionString = "e-p:32:32-i64:64-v128:64:128-n32-S128";
} else if (Triple.getArch() == llvm::Triple::x86) {
this->DescriptionString = "e-p:32:32-i64:64-n8:16:32-S128";
} else if (Triple.getArch() == llvm::Triple::x86_64) {
this->DescriptionString = "e-p:32:32-i64:64-s:64-n8:16:32:64-S128";
} else if (Triple.getArch() == llvm::Triple::mipsel) {
// Handled on mips' setDescriptionString.
} else {
assert(Triple.getArch() == llvm::Triple::le32);
this->DescriptionString = "e-p:32:32-i64:64";
}
} }
virtual typename Target::CallingConvCheckResult checkCallingConvention( virtual typename Target::CallingConvCheckResult checkCallingConvention(
CallingConv CC) const { CallingConv CC) const {

View File

@ -60,15 +60,15 @@
// RUN: %clang_cc1 -triple i686-nacl -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple i686-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=I686-NACL // RUN: FileCheck %s -check-prefix=I686-NACL
// I686-NACL: target datalayout = "e-p:32:32-i64:64-v128:32" // I686-NACL: target datalayout = "e-p:32:32-i64:64-n8:16:32-S128"
// RUN: %clang_cc1 -triple x86_64-nacl -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple x86_64-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=X86_64-NACL // RUN: FileCheck %s -check-prefix=X86_64-NACL
// X86_64-NACL: target datalayout = "e-p:32:32-i64:64-v128:32" // X86_64-NACL: target datalayout = "e-p:32:32-i64:64-s:64-n8:16:32:64-S128"
// RUN: %clang_cc1 -triple arm-nacl-gnueabi -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple arm-nacl-gnueabi -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=ARM-NACL // RUN: FileCheck %s -check-prefix=ARM-NACL
// ARM-NACL: target datalayout = "e-p:32:32-i64:64-v128:32" // ARM-NACL: target datalayout = "e-p:32:32-i64:64-v128:64:128-n32-S128"
// RUN: %clang_cc1 -triple mipsel-nacl -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple mipsel-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=MIPS-NACL // RUN: FileCheck %s -check-prefix=MIPS-NACL
@ -76,7 +76,7 @@
// RUN: %clang_cc1 -triple le32-nacl -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple le32-nacl -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=LE32-NACL // RUN: FileCheck %s -check-prefix=LE32-NACL
// LE32-NACL: target datalayout = "e-p:32:32-i64:64-v128:32" // LE32-NACL: target datalayout = "e-p:32:32-i64:64"
// RUN: %clang_cc1 -triple powerpc-unknown -o - -emit-llvm %s | \ // RUN: %clang_cc1 -triple powerpc-unknown -o - -emit-llvm %s | \
// RUN: FileCheck %s -check-prefix=PPC // RUN: FileCheck %s -check-prefix=PPC