/
dt.d
68 lines (57 loc) · 1.64 KB
/
dt.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (c) 1999-2017 by Digital Mars, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/ddmd/backend/dt.d, backend/dt.d)
*/
module ddmd.backend.dt;
// Online documentation: https://dlang.org/phobos/ddmd_backend_dt.html
import ddmd.backend.cc;
import ddmd.backend.ty;
import ddmd.backend.type;
//struct Symbol;
//alias uint tym_t;
//struct dt_t;
nothrow:
@nogc:
extern (C++)
{
void dt_free(dt_t*);
void dtpatchoffset(dt_t *dt, uint offset);
bool dtallzeros(const(dt_t)* dt);
bool dtpointers(const(dt_t)* dt);
void dt2common(dt_t **pdt);
}
extern (C++) class DtBuilder
{
private:
dt_t* head;
dt_t** pTail;
public:
this()
{
pTail = &head;
}
extern (C++):
dt_t* finish();
final:
void nbytes(uint size, const(char)* ptr);
void abytes(tym_t ty, uint offset, uint size, const(char)* ptr, uint nzeros);
void abytes(uint offset, uint size, const(char)* ptr, uint nzeros);
void dword(int value);
void size(ulong value);
void nzeros(uint size);
void xoff(Symbol* s, uint offset, tym_t ty);
dt_t* xoffpatch(Symbol* s, uint offset, tym_t ty);
void xoff(Symbol* s, uint offset);
Symbol* dtoff(dt_t* dt, uint offset);
void coff(uint offset);
void cat(dt_t* dt);
void cat(DtBuilder dtb);
void repeat(dt_t* dt, size_t count);
uint length();
bool isZeroLength();
};