Mercurial > projects > ldc
changeset 1010:bad2044a1597
Automated merge with http://hg.dsource.org/projects/ldc
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 28 Feb 2009 17:35:45 +0100 |
parents | 55051098d9fc (current diff) b1b23a64ad8c (diff) |
children | 010b8b67de1a |
files | |
diffstat | 1 files changed, 6 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/dmd/mtype.c Sat Feb 28 15:06:09 2009 +0100 +++ b/dmd/mtype.c Sat Feb 28 17:35:45 2009 +0100 @@ -15,7 +15,7 @@ #include <alloca.h> #endif -#include <math.h> +#include <cmath> #include <stdio.h> #include <assert.h> @@ -38,13 +38,10 @@ #endif #if __APPLE__ -#include <math.h> static double zero = 0; #elif __MINGW32__ -#include <math.h> static double zero = 0; #elif __GNUC__ -#include <math.h> #if !(defined (__SVR4) && defined (__sun)) #include <bits/nan.h> #include <bits/mathdef.h> @@ -68,6 +65,8 @@ #include "aggregate.h" #include "hdrgen.h" +#include "gen/tollvm.h" + FuncDeclaration *hasThis(Scope *sc); @@ -1002,43 +1001,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: - case Tcomplex64: - if (global.params.cpu == ARCHx86_64) - sz = 8; - else - sz = 4; - break; - - case Tcomplex32: - sz = 4; - break; - - default: - sz = size(0); - break; - } - return sz; +{ + return getABITypeAlign(DtoType(this)); } @@ -1134,7 +1098,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