annotate dmd/backend/dt_t.d @ 67:f708f0452e81

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