Mercurial > projects > dang
comparison gen/CodeGen.d @ 137:efbf51d85f4d
No reason to explicitly add structs as llvm types
If they are referenced anywhere they are already added
author | Anders Halager <halager@gmail.com> |
---|---|
date | Fri, 18 Jul 2008 13:10:53 +0200 |
parents | 2be29b296081 |
children | b61de188cd0d |
comparison
equal
deleted
inserted
replaced
136:2be29b296081 | 137:efbf51d85f4d |
---|---|
51 public: | 51 public: |
52 this() | 52 this() |
53 { | 53 { |
54 b = new Builder; | 54 b = new Builder; |
55 ZeroIndex = ConstantInt.GetU(Type.Int32, 0); | 55 ZeroIndex = ConstantInt.GetU(Type.Int32, 0); |
56 | 56 |
57 table = new SimpleSymbolTable(); | 57 table = new SimpleSymbolTable(); |
58 | 58 |
59 createBasicTypes(); | 59 createBasicTypes(); |
60 } | 60 } |
61 | 61 |
218 Type t = llvm(id.type); | 218 Type t = llvm(id.type); |
219 GlobalVariable g = m.addGlobal(t, id.get); | 219 GlobalVariable g = m.addGlobal(t, id.get); |
220 g.initializer = ConstantInt.GetS(t, 0); | 220 g.initializer = ConstantInt.GetS(t, 0); |
221 table[varDecl.identifier.get] = g; | 221 table[varDecl.identifier.get] = g; |
222 break; | 222 break; |
223 | |
224 case DeclType.StructDecl: | |
225 auto structDecl = cast(StructDecl)decl; | |
226 llvm(structDecl.type); | |
227 //m.addTypeName(structDecl.identifier.get, llvm(structDecl.type)); | |
228 break; | |
229 | 223 |
230 default: | 224 default: |
231 break; | 225 break; |
232 } | 226 } |
233 } | 227 } |
254 break; | 248 break; |
255 | 249 |
256 case DeclType.FuncDecl: | 250 case DeclType.FuncDecl: |
257 genRootDecl(decl); | 251 genRootDecl(decl); |
258 break; | 252 break; |
259 | 253 |
260 default: | 254 default: |
261 } | 255 } |
262 } | 256 } |
263 | 257 |
264 // Remove - do it right (basic/Messages.d) | 258 // Remove - do it right (basic/Messages.d) |