Mercurial > projects > ldc
diff gen/abi-x86-64.cpp @ 1131:f2f13f111e2e
Workaround for LLVM PR 3861 (http://llvm.org/PR3861).
(LLVM abort()s in codegen if the second integer in a return value is <= i8 on
x86/x86-64)
This was breaking native compilation of Tango's TempFile module on x86-64.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Mon, 23 Mar 2009 01:01:55 +0100 |
parents | 40d7f9b7357f |
children | 152bd2c804d0 |
line wrap: on
line diff
--- a/gen/abi-x86-64.cpp Sun Mar 22 14:51:03 2009 +0100 +++ b/gen/abi-x86-64.cpp Mon Mar 23 01:01:55 2009 +0100 @@ -400,6 +400,15 @@ bool retStructInRegs(TypeStruct* st) { // 'fastcc' allows returns in up to two registers of each kind: DRegCount state(2, 2, 2); + #if 1 + // TODO: Disable this if and when LLVM PR 3861 gets fixed. + + // LLVM currently doesn't allow a second int to be an i1 or i8. + // (See <http://llvm.org/PR3861>) + // Rather than complicating shouldPassStructInRegs(), just disallow + // second integers for now. + state.ints = 1; + #endif return shouldPassStructInRegs(st, state); }