Skip to content

Commit 306e7f7

Browse files
teodututhewilsonator
authored andcommitted
Remove previously templated hooks
These hooks have been converted to templates and their lowerings changed to use those templates: - dlang/dmd#13116 - dlang/dmd#13495 - dlang/dmd#13398 Signed-off-by: Teodor Dutu <[email protected]>
1 parent e588ec4 commit 306e7f7

File tree

3 files changed

+0
-113
lines changed

3 files changed

+0
-113
lines changed

src/rt/arrayassign.d

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -162,45 +162,6 @@ extern (C) void[] _d_arrayassign_r(TypeInfo ti, void[] src, void[] dst, void* pt
162162
return dst;
163163
}
164164

165-
/**
166-
* Does array initialization (not assignment) from another
167-
* array of the same element type.
168-
* ti is the element type.
169-
*/
170-
extern (C) void[] _d_arrayctor(TypeInfo ti, void[] from, void[] to)
171-
{
172-
debug(PRINTF) printf("_d_arrayctor(from = %p,%d, to = %p,%d) size = %d\n", from.ptr, from.length, to.ptr, to.length, ti.tsize);
173-
174-
175-
auto element_size = ti.tsize;
176-
177-
enforceRawArraysConformable("initialization", element_size, from, to);
178-
179-
size_t i;
180-
try
181-
{
182-
for (i = 0; i < to.length; i++)
183-
{
184-
// Copy construction is defined as bit copy followed by postblit.
185-
memcpy(to.ptr + i * element_size, from.ptr + i * element_size, element_size);
186-
ti.postblit(to.ptr + i * element_size);
187-
}
188-
}
189-
catch (Throwable o)
190-
{
191-
/* Destroy, in reverse order, what we've constructed so far
192-
*/
193-
while (i--)
194-
{
195-
ti.destroy(to.ptr + i * element_size);
196-
}
197-
198-
throw o;
199-
}
200-
return to;
201-
}
202-
203-
204165
/**
205166
* Do assignment to an array.
206167
* p[0 .. count] = value;
@@ -227,36 +188,3 @@ extern (C) void* _d_arraysetassign(void* p, void* value, int count, TypeInfo ti)
227188
free(ptmp);
228189
return pstart;
229190
}
230-
231-
/**
232-
* Do construction of an array.
233-
* ti[count] p = value;
234-
*/
235-
extern (C) void* _d_arraysetctor(void* p, void* value, int count, TypeInfo ti)
236-
{
237-
void* pstart = p;
238-
auto element_size = ti.tsize;
239-
240-
try
241-
{
242-
foreach (i; 0 .. count)
243-
{
244-
// Copy construction is defined as bit copy followed by postblit.
245-
memcpy(p, value, element_size);
246-
ti.postblit(p);
247-
p += element_size;
248-
}
249-
}
250-
catch (Throwable o)
251-
{
252-
// Destroy, in reverse order, what we've constructed so far
253-
while (p > pstart)
254-
{
255-
p -= element_size;
256-
ti.destroy(p);
257-
}
258-
259-
throw o;
260-
}
261-
return pstart;
262-
}

src/rt/lifetime.d

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,6 @@ extern (C) void _d_delclass(Object* p) @weak
163163
}
164164
}
165165

166-
/**
167-
* This is called for a delete statement where the value
168-
* being deleted is a pointer to a struct with a destructor
169-
* but doesn't have an overloaded delete operator.
170-
*/
171-
extern (C) void _d_delstruct(void** p, TypeInfo_Struct inf) @weak
172-
{
173-
if (*p)
174-
{
175-
debug(PRINTF) printf("_d_delstruct(%p, %p)\n", *p, cast(void*)inf);
176-
177-
inf.destroy(*p);
178-
GC.free(*p);
179-
*p = null;
180-
}
181-
}
182-
183166
// strip const/immutable/shared/inout from type info
184167
inout(TypeInfo) unqualify(return scope inout(TypeInfo) cti) pure nothrow @nogc
185168
{
@@ -1872,23 +1855,6 @@ do
18721855
return *p;
18731856
}
18741857

1875-
/**
1876-
* Append y[] to array x[]
1877-
*/
1878-
extern (C) void[] _d_arrayappendT(const TypeInfo ti, ref byte[] x, byte[] y) @weak
1879-
{
1880-
import core.stdc.string;
1881-
auto length = x.length;
1882-
auto tinext = unqualify(ti.next);
1883-
auto sizeelem = tinext.tsize; // array element size
1884-
_d_arrayappendcTX(ti, x, y.length);
1885-
memcpy(x.ptr + length * sizeelem, y.ptr, y.length * sizeelem);
1886-
1887-
// do postblit
1888-
__doPostblit(x.ptr + length * sizeelem, y.length * sizeelem, tinext);
1889-
return x;
1890-
}
1891-
18921858

18931859
/**
18941860
*
@@ -2606,11 +2572,6 @@ deprecated unittest
26062572
}
26072573
}
26082574

2609-
dtorCount = 0;
2610-
S1* s1 = new S1;
2611-
_d_delstruct(cast(void**)&s1, typeid(typeof(*s1))); // delete s1;
2612-
assert(dtorCount == 1);
2613-
26142575
dtorCount = 0;
26152576
S1[] arr1 = new S1[7];
26162577
_d_delarray_t(cast(void[]*)&arr1, typeid(typeof(arr1[0]))); // delete arr1;

src/rt/tracegc.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ extern (C) void _d_callfinalizer(void* p);
2929
extern (C) void _d_callinterfacefinalizer(void *p);
3030
extern (C) void _d_delclass(Object* p);
3131
extern (C) void _d_delinterface(void** p);
32-
extern (C) void _d_delstruct(void** p, TypeInfo_Struct inf);
3332
extern (C) void _d_delarray_t(void[]* p, const TypeInfo_Struct _);
3433
extern (C) void _d_delmemory(void* *p);
3534
extern (C) byte[] _d_arraycatT(const TypeInfo ti, byte[] x, byte[] y);
3635
extern (C) void[] _d_arraycatnTX(const TypeInfo ti, scope byte[][] arrs);
3736
extern (C) void* _d_arrayliteralTX(const TypeInfo ti, size_t length);
3837
extern (C) void* _d_assocarrayliteralTX(const TypeInfo_AssociativeArray ti,
3938
void[] keys, void[] vals);
40-
extern (C) void[] _d_arrayappendT(const TypeInfo ti, ref byte[] x, byte[] y);
4139
extern (C) byte[] _d_arrayappendcTX(const TypeInfo ti, return scope ref byte[] px, size_t n);
4240
extern (C) void[] _d_arrayappendcd(ref byte[] x, dchar c);
4341
extern (C) void[] _d_arrayappendwd(ref byte[] x, dchar c);

0 commit comments

Comments
 (0)