mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 08:30:47 +03:00
Adapt to free-standing size(Type*)
function
This commit is contained in:
parent
665e14ac46
commit
c9ac30c236
25 changed files with 80 additions and 59 deletions
|
@ -20,6 +20,8 @@
|
|||
#include "gen/logger.h"
|
||||
#include "gen/tollvm.h"
|
||||
|
||||
using namespace dmd;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
llvm::StructType *DtoComplexType(Type *type) {
|
||||
|
@ -435,7 +437,7 @@ DValue *DtoCastComplex(const Loc &loc, DValue *val, Type *_to) {
|
|||
Type *to = _to->toBasetype();
|
||||
Type *vty = val->type->toBasetype();
|
||||
if (to->iscomplex()) {
|
||||
if (vty->size() == to->size()) {
|
||||
if (size(vty) == size(to)) {
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -443,7 +445,7 @@ DValue *DtoCastComplex(const Loc &loc, DValue *val, Type *_to) {
|
|||
DtoGetComplexParts(loc, val->type, val, re, im);
|
||||
LLType *toty = DtoComplexBaseType(to);
|
||||
|
||||
if (to->size() < vty->size()) {
|
||||
if (size(to) < size(vty)) {
|
||||
re = gIR->ir->CreateFPTrunc(re, toty);
|
||||
im = gIR->ir->CreateFPTrunc(im, toty);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue