Mercurial > projects > ldc
comparison gen/toir.cpp @ 1496:b4fc62f047cd
More DtoType -> DtoTypeNotVoid for getting the array element llvm type.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 12 Jun 2009 21:34:35 +0200 |
parents | 4f7d50c744ed |
children | d9d50163e1a4 |
comparison
equal
deleted
inserted
replaced
1495:0c8d6d345001 | 1496:b4fc62f047cd |
---|---|
464 Type* cty = t->nextOf()->toBasetype(); | 464 Type* cty = t->nextOf()->toBasetype(); |
465 | 465 |
466 bool nullterm = (t->ty != Tsarray); | 466 bool nullterm = (t->ty != Tsarray); |
467 size_t endlen = nullterm ? len+1 : len; | 467 size_t endlen = nullterm ? len+1 : len; |
468 | 468 |
469 const LLType* ct = DtoType(cty); | 469 const LLType* ct = DtoTypeNotVoid(cty); |
470 const LLArrayType* at = LLArrayType::get(ct,endlen); | 470 const LLArrayType* at = LLArrayType::get(ct,endlen); |
471 | 471 |
472 LLConstant* _init; | 472 LLConstant* _init; |
473 if (cty->size() == 1) { | 473 if (cty->size() == 1) { |
474 uint8_t* str = (uint8_t*)string; | 474 uint8_t* str = (uint8_t*)string; |
2375 // extract D types | 2375 // extract D types |
2376 Type* bt = type->toBasetype(); | 2376 Type* bt = type->toBasetype(); |
2377 Type* elemt = bt->nextOf(); | 2377 Type* elemt = bt->nextOf(); |
2378 | 2378 |
2379 // build llvm array type | 2379 // build llvm array type |
2380 const LLArrayType* arrtype = LLArrayType::get(DtoType(elemt), elements->dim); | 2380 const LLArrayType* arrtype = LLArrayType::get(DtoTypeNotVoid(elemt), elements->dim); |
2381 | 2381 |
2382 // dynamic arrays can occur here as well ... | 2382 // dynamic arrays can occur here as well ... |
2383 bool dyn = (bt->ty == Tarray); | 2383 bool dyn = (bt->ty == Tarray); |
2384 | 2384 |
2385 // build the initializer | 2385 // build the initializer |