mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-30 07:21:30 +02:00
Removed TypeOpaque from DMD.
Changed runtime functions taking opaque[] to void[]. Implemented proper type painting, to avoid "resizing" array casts in runtime calls that previously took opaque[]. Implemented dynamic arrays as first class types, this implements proper ABI for these types on x86. Added dwarf region end after call to assert function, fixes some problems with llvm not allowing this to be missing. Reverted change to WithStatement from rev [704] it breaks MiniD, mini/with2.d needs to be fixed some other way... Fixed tango bug 1339 in runtime, problem with _adReverseChar on invalid UTF-8. Disabled .bc generation in the compiler runtime part, genobj.d triggers some llvm bug when using debug info. the .o seems to work fine.
This commit is contained in:
@@ -1092,17 +1092,12 @@ extern (C) void* _d_arrayliteralT(TypeInfo ti, size_t length, ...)
|
||||
/**
|
||||
* Support for array.dup property.
|
||||
*/
|
||||
struct Array2
|
||||
{
|
||||
size_t length;
|
||||
void* ptr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
extern (C) Array2 _adDupT(TypeInfo ti, Array2 a)
|
||||
extern (C) void[] _adDupT(TypeInfo ti, void[] a)
|
||||
out (result)
|
||||
{
|
||||
auto sizeelem = ti.next.tsize(); // array element size
|
||||
@@ -1110,17 +1105,16 @@ out (result)
|
||||
}
|
||||
body
|
||||
{
|
||||
Array2 r;
|
||||
void* ptr;
|
||||
|
||||
if (a.length)
|
||||
{
|
||||
auto sizeelem = ti.next.tsize(); // array element size
|
||||
auto size = a.length * sizeelem;
|
||||
r.ptr = gc_malloc(size, !(ti.next.flags() & 1) ? BlkAttr.NO_SCAN : 0);
|
||||
r.length = a.length;
|
||||
memcpy(r.ptr, a.ptr, size);
|
||||
ptr = gc_malloc(size, !(ti.next.flags() & 1) ? BlkAttr.NO_SCAN : 0);
|
||||
memcpy(ptr, a.ptr, size);
|
||||
}
|
||||
return r;
|
||||
return ptr[0 .. a.length];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user