# HG changeset patch # User Frits van Bommel # Date 1235839493 -3600 # Node ID 010b8b67de1a77a5679a1b72f664cbe4f2028286 # Parent bad2044a1597deb5aadf8db16f257402877f2e13 Apply previous changes to dmd2/mtype.c as well. diff -r bad2044a1597 -r 010b8b67de1a dmd2/mtype.c --- a/dmd2/mtype.c Sat Feb 28 17:35:45 2009 +0100 +++ b/dmd2/mtype.c Sat Feb 28 17:44:53 2009 +0100 @@ -9,7 +9,7 @@ // See the included readme.txt for details. #define __USE_ISOC99 1 // so signbit() gets defined -#include +#include #include #include @@ -32,13 +32,13 @@ #endif #if __APPLE__ -#include +#include static double zero = 0; #elif __MINGW32__ -#include +#include static double zero = 0; #elif __GNUC__ -#include +#include #include #include static double zero = 0; @@ -60,6 +60,8 @@ #include "aggregate.h" #include "hdrgen.h" +#include "gen/tollvm.h" + FuncDeclaration *hasThis(Scope *sc); @@ -1229,38 +1231,8 @@ } unsigned TypeBasic::alignsize() -{ unsigned sz; - - //LDC: it's bad that we always have to check LLVM's align and - // dmd's align info match. Can't we somehow get at LLVM's align - // here? - - switch (ty) - { - case Tfloat80: - case Timaginary80: - case Tcomplex80: - if (global.params.cpu == ARCHx86_64) - sz = 16; - else - sz = 4; - break; - - case Tint64: - case Tuns64: - case Tfloat64: - case Timaginary64: - if (global.params.cpu == ARCHx86_64) - sz = 8; - else - sz = 4; - break; - - default: - sz = size(0); - break; - } - return sz; +{ + return getABITypeAlign(DtoType(this)); } @@ -1354,7 +1326,7 @@ // constant folding. volatile d_float80 foo; foo = NAN; - if (signbit(foo)) // signbit sometimes, not always, set + if (std::signbit(foo)) // signbit sometimes, not always, set foo = -foo; // turn off sign bit fvalue = foo; #elif _MSC_VER