Mercurial > projects > ldc
comparison gen/abi-x86-64.cpp @ 1348:f3b92d26ad0f
Revert [1346] for now, it breaks because of padding :(
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Tue, 12 May 2009 16:53:43 +0200 |
parents | 6f4154b318ef |
children | 15e9762bb620 |
comparison
equal
deleted
inserted
replaced
1347:3647bef175d7 | 1348:f3b92d26ad0f |
---|---|
41 #include "gen/logger.h" | 41 #include "gen/logger.h" |
42 #include "gen/dvalue.h" | 42 #include "gen/dvalue.h" |
43 #include "gen/llvmhelpers.h" | 43 #include "gen/llvmhelpers.h" |
44 #include "gen/abi.h" | 44 #include "gen/abi.h" |
45 #include "gen/abi-x86-64.h" | 45 #include "gen/abi-x86-64.h" |
46 //#include "gen/llvm-version.h" // only use is commented out. | |
46 #include "ir/irfunction.h" | 47 #include "ir/irfunction.h" |
47 | 48 |
48 #include <cassert> | 49 #include <cassert> |
49 #include <map> | 50 #include <map> |
50 #include <string> | 51 #include <string> |
398 // Returns true if the struct fits in return registers in the x86-64 fastcc | 399 // Returns true if the struct fits in return registers in the x86-64 fastcc |
399 // calling convention. | 400 // calling convention. |
400 bool retStructInRegs(TypeStruct* st) { | 401 bool retStructInRegs(TypeStruct* st) { |
401 // 'fastcc' allows returns in up to two registers of each kind: | 402 // 'fastcc' allows returns in up to two registers of each kind: |
402 DRegCount state(2, 2, 2); | 403 DRegCount state(2, 2, 2); |
404 #if 1 //LLVM_REV < 67588 | |
405 // (If uncommenting the LLVM_REV line above, also uncomment llvm-version #include | |
406 | |
407 // LLVM before trunk r67588 doesn't allow a second int to be an i1 or | |
408 // i8. (See <http://llvm.org/PR3861>) | |
409 // Rather than complicating shouldPassStructInRegs(), just disallow | |
410 // second integers for now. | |
411 // FIXME: Disabling this for older LLVM only makes the abi dependent on | |
412 // LLVM revision, which seems like a bad idea. We could extend | |
413 // i8 parts to i16 to work around this issue until 2.6... | |
414 // TODO: Remove this workaround when support for LLVM 2.5 is dropped. | |
415 state.ints = 1; | |
416 #endif | |
403 return shouldPassStructInRegs(st, state); | 417 return shouldPassStructInRegs(st, state); |
404 } | 418 } |
405 | 419 |
406 // Heuristic for determining whether to pass a struct type directly or | 420 // Heuristic for determining whether to pass a struct type directly or |
407 // bump it to memory. | 421 // bump it to memory. |