diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-26 22:09:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-26 22:09:03 +0000 |
commit | c3b054d250cdca485c71845089c316e10610ebad (patch) | |
tree | abae0246ec9156cc1a7cbb947b2b0dfe95fa3189 /lib/CodeGen/TargetInfo.cpp | |
parent | bca07a4524feb4edec581062d631a13116320a24 (diff) |
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index d74b3f32d954b..2ffc840b9f921 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -2105,8 +2105,15 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty) const { 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)); |