Mercurial > projects > ldc
comparison gen/arrays.cpp @ 157:5c17f81fc1c1 trunk
[svn r173] moved IR state previously stored in Type into IrType and a Type->IrType map; fixes #7
author | ChristianK |
---|---|
date | Thu, 01 May 2008 13:32:08 +0200 |
parents | ccd07d9f2ce9 |
children | 1856c62af24b |
comparison
equal
deleted
inserted
replaced
156:ccd07d9f2ce9 | 157:5c17f81fc1c1 |
---|---|
39 | 39 |
40 ////////////////////////////////////////////////////////////////////////////////////////// | 40 ////////////////////////////////////////////////////////////////////////////////////////// |
41 | 41 |
42 const llvm::ArrayType* DtoStaticArrayType(Type* t) | 42 const llvm::ArrayType* DtoStaticArrayType(Type* t) |
43 { | 43 { |
44 if (t->llvmType) | 44 if (gIR->irType[t].type) |
45 return isaArray(t->llvmType->get()); | 45 return isaArray(gIR->irType[t].type->get()); |
46 | 46 |
47 assert(t->ty == Tsarray); | 47 assert(t->ty == Tsarray); |
48 assert(t->next); | 48 assert(t->next); |
49 | 49 |
50 const llvm::Type* at = DtoType(t->next); | 50 const llvm::Type* at = DtoType(t->next); |
51 | 51 |
52 TypeSArray* tsa = (TypeSArray*)t; | 52 TypeSArray* tsa = (TypeSArray*)t; |
53 assert(tsa->dim->type->isintegral()); | 53 assert(tsa->dim->type->isintegral()); |
54 const llvm::ArrayType* arrty = llvm::ArrayType::get(at,tsa->dim->toUInteger()); | 54 const llvm::ArrayType* arrty = llvm::ArrayType::get(at,tsa->dim->toUInteger()); |
55 | 55 |
56 assert(!tsa->llvmType); | 56 assert(!gIR->irType[tsa].type); |
57 tsa->llvmType = new llvm::PATypeHolder(arrty); | 57 gIR->irType[tsa].type = new llvm::PATypeHolder(arrty); |
58 return arrty; | 58 return arrty; |
59 } | 59 } |
60 | 60 |
61 ////////////////////////////////////////////////////////////////////////////////////////// | 61 ////////////////////////////////////////////////////////////////////////////////////////// |
62 | 62 |