annotate ir/irstruct.cpp @ 193:aca17e55b7a5 trunk

[svn r209] Fixed: exotic array to pointer casts were broken. Changed: classes now have opaque vtables.
author lindquist
date Mon, 12 May 2008 18:44:11 +0200
parents db9890b3fb64
children e3355ce5444b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
1 #include "gen/llvm.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
2 #include "mtype.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
3 #include "aggregate.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
4 #include "ir/irstruct.h"
157
5c17f81fc1c1 [svn r173] moved IR state previously stored in Type into IrType and a Type->IrType map; fixes #7
ChristianK
parents: 137
diff changeset
5 #include "gen/irstate.h"
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
6
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 173
diff changeset
7 #if OPAQUE_VTBLS
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 173
diff changeset
8 IrInterface::IrInterface(BaseClass* b, const llvm::ArrayType* vt)
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 173
diff changeset
9 #else
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
10 IrInterface::IrInterface(BaseClass* b, const llvm::StructType* vt)
193
aca17e55b7a5 [svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents: 173
diff changeset
11 #endif
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
12 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
13 base = b;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
14 decl = b->base;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
15 vtblTy = vt;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
16 vtblInit = NULL;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
17 vtbl = NULL;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
18 infoTy = NULL;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
19 infoInit = NULL;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
20 info = NULL;
137
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
21
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
22 index = -1;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
23 }
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
24
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
25 IrInterface::~IrInterface()
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
26 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
27 }
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
28
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
29 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
30 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
31 //////////////////////////////////////////////////////////////////////////////
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
32
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
33 IrStruct::IrStruct(Type* t)
173
db9890b3fb64 [svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents: 157
diff changeset
34 : recty((t->ir.type) ? *t->ir.type : llvm::OpaqueType::get())
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
35 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
36 type = t;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
37 defined = false;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
38 constinited = false;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
39 interfaceInfosTy = NULL;
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
40 interfaceInfos = NULL;
137
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
41
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
42 vtbl = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
43 constVtbl = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
44 init = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
45 constInit = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
46 classInfo = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
47 constClassInfo = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
48 hasUnions = false;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
49 dunion = NULL;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
50
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
51 classDeclared = false;
ce7b81fb957f [svn r141] fixed more problems with classinfo
lindquist
parents: 136
diff changeset
52 classDefined = false;
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
53 }
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
54
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
55 IrStruct::~IrStruct()
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
56 {
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents:
diff changeset
57 }