comparison 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
comparison
equal deleted inserted replaced
1130:30663babccff 1131:f2f13f111e2e
398 // Returns true if the struct fits in return registers in the x86-64 fastcc 398 // Returns true if the struct fits in return registers in the x86-64 fastcc
399 // calling convention. 399 // calling convention.
400 bool retStructInRegs(TypeStruct* st) { 400 bool retStructInRegs(TypeStruct* st) {
401 // 'fastcc' allows returns in up to two registers of each kind: 401 // 'fastcc' allows returns in up to two registers of each kind:
402 DRegCount state(2, 2, 2); 402 DRegCount state(2, 2, 2);
403 #if 1
404 // TODO: Disable this if and when LLVM PR 3861 gets fixed.
405
406 // LLVM currently doesn't allow a second int to be an i1 or i8.
407 // (See <http://llvm.org/PR3861>)
408 // Rather than complicating shouldPassStructInRegs(), just disallow
409 // second integers for now.
410 state.ints = 1;
411 #endif
403 return shouldPassStructInRegs(st, state); 412 return shouldPassStructInRegs(st, state);
404 } 413 }
405 414
406 // Heuristic for determining whether to pass a struct type directly or 415 // Heuristic for determining whether to pass a struct type directly or
407 // bump it to memory. 416 // bump it to memory.