mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-16 11:20:05 +02:00
[svn r229] Updated the object.d implementation to the latest Tango.
Fixed a bunch of the built-in typeinfos for arrays, they did not inherit TypeInfo_Array. Applied patch to tango/text/convert/Layout.d by fvbommel, closes #47 . Cleaned up some type code. Replaced uses of llvm::Type with LLType (a typedef), same for Value and Constant. Fixed a few cases where typeinfo for user structs could be emitted multiple times, seems to still be some cases of this :/
This commit is contained in:
@@ -193,8 +193,26 @@ class Layout(T)
|
||||
assert (formatStr, "null format specifier");
|
||||
assert (arguments.length < 64, "too many args in Layout.convert");
|
||||
|
||||
version (X86_64)
|
||||
version (LLVMDC)
|
||||
{
|
||||
static va_list get_va_arg(TypeInfo ti, ref va_list vp)
|
||||
{
|
||||
auto tisize = ti.tsize;
|
||||
size_t size = tisize > size_t.sizeof ? size_t.sizeof : tisize;
|
||||
va_list vptmp = cast(va_list)((cast(size_t)vp + size - 1) & ~(size - 1));
|
||||
vp = vptmp + tisize;
|
||||
return vptmp;
|
||||
}
|
||||
|
||||
Arg[64] arglist = void;
|
||||
foreach (i, arg; arguments)
|
||||
{
|
||||
arglist[i] = get_va_arg(arg, args);
|
||||
}
|
||||
}
|
||||
else version (X86_64)
|
||||
{
|
||||
// code for x86-64 GDC
|
||||
Arg[64] arglist = void;
|
||||
int[64] intargs = void;
|
||||
byte[64] byteargs = void;
|
||||
@@ -265,25 +283,9 @@ class Layout(T)
|
||||
}
|
||||
}
|
||||
}
|
||||
else version (LLVMDC)
|
||||
{
|
||||
static va_list get_va_arg(TypeInfo ti, ref va_list vp)
|
||||
{
|
||||
auto tisize = ti.tsize;
|
||||
size_t size = tisize > size_t.sizeof ? size_t.sizeof : tisize;
|
||||
va_list vptmp = cast(va_list)((cast(size_t)vp + size - 1) & ~(size - 1));
|
||||
vp = vptmp + tisize;
|
||||
return vptmp;
|
||||
}
|
||||
|
||||
Arg[64] arglist = void;
|
||||
foreach (i, arg; arguments)
|
||||
{
|
||||
arglist[i] = get_va_arg(arg, args);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// code for DMD & x86 GDC (may also work on other 32-bit targets)
|
||||
Arg[64] arglist = void;
|
||||
foreach (i, arg; arguments)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user