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