[cfe-commits] r126186 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Mon Feb 21 19:56:58 PST 2011
Author: chapuni
Date: Mon Feb 21 21:56:57 2011
New Revision: 126186
URL: http://llvm.org/viewvc/llvm-project?rev=126186&view=rev
Log:
lib/CodeGen/TargetInfo.cpp: On Win64, arg i128 should be emitted as INDIRECT.
mingw-w64's i128 tweak should be done with x86_64-mingw32.
Modified:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=126186&r1=126185&r2=126186&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Feb 21 21:56:57 2011
@@ -2105,8 +2105,15 @@
RT->getDecl()->hasFlexibleArrayMember())
return ABIArgInfo::getIndirect(0, /*ByVal=*/false);
- // FIXME: mingw64-gcc emits 128-bit struct as i128
- if (Size <= 128 &&
+ // FIXME: mingw-w64-gcc emits 128-bit struct as i128
+ if (Size == 128 &&
+ getContext().Target.getTriple().getOS() == llvm::Triple::MinGW32)
+ return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(),
+ Size));
+
+ // MS x64 ABI requirement: "Any argument that doesn't fit in 8 bytes, or is
+ // not 1, 2, 4, or 8 bytes, must be passed by reference."
+ if (Size <= 64 &&
(Size & (Size - 1)) == 0)
return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(),
Size));
More information about the cfe-commits
mailing list