annotate dmd/backend/dt_t.d @ 146:af7e5ebef6ad

redundant extern(C)
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Tue, 14 Sep 2010 23:34:50 +0100
parents e28b18c23469
children
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.dt_t;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 67
diff changeset
3 import dmd.common;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
4 import dmd.backend.targ_types;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
5 import dmd.backend.Symbol;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
6
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
7 struct dt_t
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
8 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
9 dt_t* DTnext; // next in list
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
10 char dt; // type (DTxxxx)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
11 ubyte Dty; // pointer type
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
12
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
13 union
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
14 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
15 struct // DTibytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
16 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
17 char DTn; // number of bytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
18 char DTdata[7]; // data
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
19 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 char DTonebyte; // DT1byte
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
22
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
23 targ_size_t DTazeros; // DTazeros,DTcommon,DTsymsize
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 struct // DTabytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
26 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 char* DTpbytes; // pointer to the bytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 uint DTnbytes; // # of bytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29 version (TX86) {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
30 int DTseg; // segment it went into
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
32 targ_size_t DTabytes; // offset of abytes for DTabytes
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
35 struct // DTxoff
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
37 Symbol* DTsym; // symbol pointer
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
38 targ_size_t DToffset; // offset from symbol
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
41 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42
67
f708f0452e81 some of the backend/codegen stuff implemented
korDen
parents: 0
diff changeset
43 extern (C++) extern uint dt_size(dt_t* dtstart);
f708f0452e81 some of the backend/codegen stuff implemented
korDen
parents: 0
diff changeset
44
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
45 import std.stdio;
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
46
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
47 void dumpDt(dt_t* foo)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
48 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
49 foreach (a, b; foo.tupleof)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
50 {
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
51 std.stdio.writeln(foo.tupleof[a].stringof, " ", cast(char*)&foo.tupleof[a] - cast(char*)foo, " = ", foo.tupleof[a]);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
52 //std.stdio.writeln("printf(\"", foo.tupleof[a].stringof, " %d = %d\\n\",(char*)(&", foo.tupleof[a].stringof, ")-(char*)foo, ", foo.tupleof[a].stringof, ");");
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
53 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 }