annotate dmd/backend/Util.d @ 135:af1bebfd96a4 dmd2037

dmd 2.038
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 13 Sep 2010 22:19:42 +0100
parents e28b18c23469
children 31c086f76669
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
1 module dmd.backend.Util;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 25
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.Array;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.Loc;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 import dmd.backend.elem;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 import dmd.backend.Symbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 import dmd.backend.TYPE;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 import dmd.backend.SC;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 import dmd.backend.dt_t;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12 import dmd.backend.LIST;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 import dmd.backend.block;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 import dmd.backend.targ_types;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 import dmd.backend.SYMIDX;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 import dmd.backend.PARAM;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 import dmd.backend.Blockx;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 import dmd.backend.struct_t;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 import dmd.backend.BC;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 import dmd.backend.code;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22 import std.string;
5
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
23 import core.stdc.stdlib;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
24 import core.stdc.string;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 alias ubyte mangle_t;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 alias SC enum_SC;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 alias uint SYMFLGS;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 version (MARS) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 enum SYM_PREDEF_SZ = 35;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 } else {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34 enum SYM_PREDEF_SZ = 22;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 //extern (C++) extern {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 elem* eictor;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 Symbol* ictorlocalgot;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 elem* ector;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 Array ectorgates;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 elem* edtor;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
43 elem* etest;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
44 int dtorcount;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 Symbol* localgot;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46 //}
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 static this()
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 ectorgates = new Array();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
53 alias size_t tym_t; // data type big enough for type masks
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
54 //alias ulong tym_t; // data type big enough for type masks
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 alias elem* elem_p; // data type big enough for type masks
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
57 void el_setLoc(elem* e, Loc loc) {
5
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
58 size_t len = loc.filename.length;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
59 e.Esrcpos.Sfilename = cast(char*)malloc(len + 1);
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
60 memcpy(e.Esrcpos.Sfilename, loc.filename.ptr, len);
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
61 e.Esrcpos.Sfilename[len] = 0;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
62 e.Esrcpos.Slinnum = loc.linnum;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
63 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
64
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
65 void elem_setLoc(elem* e, Loc loc) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
66 return el_setLoc(e, loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
67 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
68
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
69 struct_t* struct_calloc() {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
70 return cast(struct_t *) mem_fcalloc(struct_t.sizeof);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
71 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
72 ///#define struct_free(st) ((void)(st))
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
73
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
74 version (Bug4059)
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
75 {
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
76 private extern (C) {
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
77 void _Z12obj_initfilePKcS0_S0_(const(char)* filename, const(char)* csegname, const(char)* modname);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
78 elem_p _Z6el_binjmP4elemS0_(uint, tym_t, elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
79 elem_p _Z7el_pairmP4elemS0_(tym_t, elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
80 elem_p _Z10el_combineP4elemS0_(elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
81 elem* _Z8el_paramP4elemS0_(elem* e1, elem* e2);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
82 Symbol* _Z13symbol_callocPKc(const(char)* id);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
83 int _Z9objextdefPKc(const(char)* name);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
84 void _Z14obj_includelibPKc(const(char)* name);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
85 Symbol* _Z11symbol_namePKciP4TYPE(const(char)* name, int sclass, type* t);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
86 dt_t ** _Z8dtnbytesPP4dt_tmPKc(dt_t** pdtend, targ_size_t size, const(char)* ptr);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
87 dt_t** _Z8dtabytesPP4dt_tmmmPKc(dt_t** pdtend, tym_t ty, targ_size_t offset, targ_size_t size, const(char)* ptr);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
88 type* _Z10type_settyPP4TYPEl(type**, long);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
89
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
90 void _Z10cod3_thunkP6SymbolS0_jmmim(Symbol* sthunk, Symbol* sfunc, uint p, tym_t thisty, targ_size_t d, int i, targ_size_t d2);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
91 }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
92 void obj_initfile(const(char)* filename, const(char)* csegname, const(char)* modname) { return _Z12obj_initfilePKcS0_S0_(filename, csegname, modname); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
93 elem_p el_bin(uint a, tym_t b, elem_p c, elem_p d) { return _Z6el_binjmP4elemS0_(a, b, c, d); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
94 elem_p el_pair(tym_t a, elem_p b, elem_p c) { return _Z7el_pairmP4elemS0_(a, b, c); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
95 elem_p el_combine(elem_p a, elem_p b) { return _Z10el_combineP4elemS0_(a, b); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
96 elem* el_param(elem* e1, elem* e2) { return _Z8el_paramP4elemS0_(e1, e2); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
97 Symbol* symbol_calloc(const(char)* id) { return _Z13symbol_callocPKc(id); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
98 int objextdef(const(char)* name) { return _Z9objextdefPKc(name); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
99 void obj_includelib(const(char)* name) { return _Z14obj_includelibPKc(name); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
100 Symbol* symbol_name(const(char)* name, int sclass, type* t) { return _Z11symbol_namePKciP4TYPE(name, sclass, t); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
101 dt_t ** dtnbytes(dt_t** pdtend, targ_size_t size, const(char)* ptr) { return _Z8dtnbytesPP4dt_tmPKc(pdtend, size, ptr); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
102 dt_t** dtabytes(dt_t** pdtend, tym_t ty, targ_size_t offset, targ_size_t size, const(char)* ptr) { return _Z8dtabytesPP4dt_tmmmPKc(pdtend, ty, offset, size, ptr); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
103 type* type_setty(type** a, long b) { return _Z10type_settyPP4TYPEl(a, b); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
104
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
105 void cod3_thunk(Symbol* sthunk, Symbol* sfunc, uint p, tym_t thisty, targ_size_t d, int i, targ_size_t d2) { return _Z10cod3_thunkP6SymbolS0_jmmim(sthunk, sfunc, p, thisty, d, i, d2); }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
106 }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
107 else
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
108 {
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
109 extern (C++) {
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
110 void obj_initfile(const(char)* filename, const(char)* csegname, const(char)* modname);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
111 dt_t ** dtnbytes(dt_t** pdtend, targ_size_t size, const(char)* ptr);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
112 elem_p el_bin(uint, tym_t, elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
113 elem_p el_pair(tym_t, elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
114 elem_p el_combine(elem_p, elem_p);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
115 elem* el_param(elem* e1, elem* e2);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
116 Symbol* symbol_calloc(const(char)* id);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
117 int objextdef(const(char)* name);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
118 void obj_includelib(const(char)* name);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
119 Symbol* symbol_name(const(char)* name, int sclass, type* t);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
120 dt_t** dtabytes(dt_t** pdtend, tym_t ty, targ_size_t offset, targ_size_t size, const(char)* ptr);
25
3f834bed4f13 FWindows linking issues fixed
korDen
parents: 22
diff changeset
121 type* type_setty(type**, int);
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
122
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
123 void cod3_thunk(Symbol* sthunk, Symbol* sfunc, uint p, tym_t thisty, targ_size_t d, int i, targ_size_t d2);
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
124 }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
125 }
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
126
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
127 extern (C++) {
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
128 //__gshared:
22
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 14
diff changeset
129 void obj_ehsections();
fd4acc376c45 Implemented object file output and linking on linux.
Robert Clipsham <robert@octarineparrot.com>
parents: 14
diff changeset
130 void obj_staticdtor(Symbol *s);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
131 void* mem_fcalloc(uint numbytes);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
132 type* type_fake(tym_t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
133 dt_t** dtnzeros(dt_t** pdtend, targ_size_t size);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
134 void outdata(Symbol* s);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
135 int reftoident(int seg, targ_size_t offset, Symbol* s, targ_size_t val, int flags);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
136 type* type_alloc(tym_t ty);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
137 elem_p el_params(elem_p, ...);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
138 elem_p el_ptr(Symbol*);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
139 elem_p el_long(tym_t, targ_long);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
140 elem_p el_var(Symbol*);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
141 block* block_calloc();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
142 void writefunc(Symbol* sfunc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
143 void obj_termfile();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
144 SYMIDX symbol_add(Symbol* s);
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
145 elem_p el_una(uint op, tym_t ty, elem_p e1);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
146 type* type_setcv(type** pt, tym_t cv);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
147 int type_jparam(type* t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
148 void obj_export(Symbol* s, uint argsize);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
149 void obj_startaddress(Symbol* s);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
150 void symbol_func(Symbol* s);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
151 type* type_allocn(tym_t, type* tn);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
152 param_t* param_append_type(param_t** pp, type* t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
153 void block_appendexp(block* b, elem* e);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
154 void block_next(Blockx* bctx, BC bc, block* bn);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
155 dt_t** dtxoff(dt_t** pdtend, Symbol* s,targ_size_t offset, tym_t ty);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
156 dt_t** dtdword(dt_t** pdtend, int value);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
157 void obj_moduleinfo(Symbol* scc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
158 Symbol* symbol_genauto(TYPE* t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
159 elem* el_same(elem**);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
160 void el_free(elem*);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
161 Symbol* symbol_generate(int sclass, type* t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
162 elem* el_calloc();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
163 void dt_optimize(dt_t* dt);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
164 type* type_setmangle(type** pt, mangle_t mangle);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
165 list_t list_append(list_t* plist, void* ptr);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
166 dt_t** dtcat(dt_t** pdtend, dt_t* dt);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
167 elem_p el_copytree(elem_p);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
168 int el_allbits(elem *e, int bit);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
169 block* block_goto(Blockx* bctx, BC bc, block* bn);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
170 block* block_calloc(Blockx* blx);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
171 targ_size_t type_paramsize_i(type* t);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
172 int os_critsecsize();
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
173 void el_setVolatile(elem* e);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
174 elem* exp2_copytotemp(elem* e);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
175 elem* el_const(tym_t, eve*);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
176 elem *el_params(void** args, int length);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
177
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
178
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
179 version (SEH) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
180 void nteh_declarvars(Blockx* bx);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
181 elem* nteh_setScopeTableIndex(Blockx* blx, int scope_index);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
182 }
14
2cc604139636 Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents: 5
diff changeset
183 }