r233819 - Fix data layout mismatch between LLVM and Clang for i686-pc-windows-msvc-elf
Reid Kleckner
reid at kleckner.net
Wed Apr 1 09:45:07 PDT 2015
Author: rnk
Date: Wed Apr 1 11:45:06 2015
New Revision: 233819
URL: http://llvm.org/viewvc/llvm-project?rev=233819&view=rev
Log:
Fix data layout mismatch between LLVM and Clang for i686-pc-windows-msvc-elf
Do the same thing as win64. If we're not using COFF, use the ELF
manglings. Maybe if we are targetting *-windows-msvc-macho, we should
use darwin manglings, but I don't need to stir that pot today.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/mangle-windows.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=233819&r1=233818&r2=233819&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Apr 1 11:45:06 2015
@@ -3434,7 +3434,10 @@ public:
: WindowsTargetInfo<X86_32TargetInfo>(Triple) {
WCharType = UnsignedShort;
DoubleAlign = LongLongAlign = 64;
- DescriptionString = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-S32";
+ bool IsWinCOFF =
+ getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
+ DescriptionString = IsWinCOFF ? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-S32"
+ : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-S32";
}
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override {
Modified: cfe/trunk/test/CodeGen/mangle-windows.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle-windows.c?rev=233819&r1=233818&r2=233819&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle-windows.c (original)
+++ cfe/trunk/test/CodeGen/mangle-windows.c Wed Apr 1 11:45:06 2015
@@ -1,15 +1,26 @@
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-windows-msvc-elf | FileCheck %s --check-prefix=ELF32
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s --check-prefix=X64
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-mingw32 | FileCheck %s --check-prefix=X64
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc-elf | FileCheck %s --check-prefix=ELF64
+
+// CHECK: target datalayout = "e-m:x-{{.*}}"
+// X64: target datalayout = "e-m:w-{{.*}}"
+// ELF32: target datalayout = "e-m:e-{{.*}}"
+// ELF64: target datalayout = "e-m:e-{{.*}}"
void __stdcall f1(void) {}
// CHECK: define x86_stdcallcc void @"\01_f1 at 0"
// X64: define void @f1(
+// ELF32: define x86_stdcallcc void @"\01_f1 at 0"
+// ELF64: define void @f1(
void __fastcall f2(void) {}
// CHECK: define x86_fastcallcc void @"\01 at f2@0"
// X64: define void @f2(
+// ELF32: define x86_fastcallcc void @"\01 at f2@0"
+// ELF64: define void @f2(
void __stdcall f3() {}
// CHECK: define x86_stdcallcc void @"\01_f3 at 0"
@@ -46,10 +57,14 @@ void f12(void) {}
void __vectorcall v1(void) {}
// CHECK: define x86_vectorcallcc void @"\01v1@@0"(
// X64: define x86_vectorcallcc void @"\01v1@@0"(
+// ELF32: define x86_vectorcallcc void @"\01v1@@0"(
+// ELF64: define x86_vectorcallcc void @"\01v1@@0"(
void __vectorcall v2(char a) {}
// CHECK: define x86_vectorcallcc void @"\01v2@@4"(
// X64: define x86_vectorcallcc void @"\01v2@@8"(
+// ELF32: define x86_vectorcallcc void @"\01v2@@4"(
+// ELF64: define x86_vectorcallcc void @"\01v2@@8"(
void __vectorcall v3(short a) {}
// CHECK: define x86_vectorcallcc void @"\01v3@@4"(
More information about the cfe-commits
mailing list