r197628 - Fix the DataLayout string produced by clang for NaCl.
Rafael Espindola
rafael.espindola at gmail.com
Wed Dec 18 15:41:04 PST 2013
Author: rafael
Date: Wed Dec 18 17:41:04 2013
New Revision: 197628
URL: http://llvm.org/viewvc/llvm-project?rev=197628&view=rev
Log:
Fix the DataLayout string produced by clang for NaCl.
Reviewed by Derek Schuff.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/target-data.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=197628&r1=197627&r2=197628&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Dec 18 17:41:04 2013
@@ -624,7 +624,18 @@ public:
this->IntPtrType = TargetInfo::SignedInt;
// RegParmMax is inherited from the underlying architecture
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(
CallingConv CC) const {
Modified: cfe/trunk/test/CodeGen/target-data.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/target-data.c?rev=197628&r1=197627&r2=197628&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/target-data.c (original)
+++ cfe/trunk/test/CodeGen/target-data.c Wed Dec 18 17:41:04 2013
@@ -60,15 +60,15 @@
// RUN: %clang_cc1 -triple i686-nacl -o - -emit-llvm %s | \
// 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: 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: 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: FileCheck %s -check-prefix=MIPS-NACL
@@ -76,7 +76,7 @@
// RUN: %clang_cc1 -triple le32-nacl -o - -emit-llvm %s | \
// 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: FileCheck %s -check-prefix=PPC
More information about the cfe-commits
mailing list