Mercurial > projects > ldc
comparison gen/abi-x86-64.cpp @ 1134:152bd2c804d0
Update comments now that LLVM PR3861 has been fixed. However, since
conditionally removing the workaround makes the ABI dependent on LLVM version,
I reconsidered that.
(The same revision of LDC compiling for the same target should probably produce
code that follows the same ABI, right?)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Tue, 24 Mar 2009 02:46:57 +0100 |
parents | f2f13f111e2e |
children | 3d6a908a34e9 |
comparison
equal
deleted
inserted
replaced
1133:eeb8b95ea92e | 1134:152bd2c804d0 |
---|---|
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 | 403 #if 1 //LLVM_REV < 67588 |
404 // TODO: Disable this if and when LLVM PR 3861 gets fixed. | 404 // LLVM before trunk r67588 doesn't allow a second int to be an i1 or |
405 | 405 // i8. (See <http://llvm.org/PR3861>) |
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 | 406 // Rather than complicating shouldPassStructInRegs(), just disallow |
409 // second integers for now. | 407 // second integers for now. |
408 // FIXME: Disabling this for older LLVM only makes the abi dependent on | |
409 // LLVM revision, which seems like a bad idea. We could extend | |
410 // i8 parts to i16 to work around this issue until 2.6... | |
411 // TODO: Remove this workaround when support for LLVM 2.5 is dropped. | |
410 state.ints = 1; | 412 state.ints = 1; |
411 #endif | 413 #endif |
412 return shouldPassStructInRegs(st, state); | 414 return shouldPassStructInRegs(st, state); |
413 } | 415 } |
414 | 416 |