Mercurial > projects > ldc
comparison gen/toobj.c @ 58:2c3cd3596187 trunk
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
Added initial support for CatExp aka 'a ~ b'
Fixed global constant static arrays initialized with string literals
Fixed casting any dynamic array to void*
Fixed new expression with temporary storage
Fixed alias declarations in function scope
Fixed relational comparisons of pointers
author | lindquist |
---|---|
date | Thu, 25 Oct 2007 09:02:55 +0200 |
parents | a9d29e9f1fed |
children | 2c39b5292cf3 |
comparison
equal
deleted
inserted
replaced
57:a9d29e9f1fed | 58:2c3cd3596187 |
---|---|
545 } | 545 } |
546 // array single value init | 546 // array single value init |
547 else if (llvm::isa<llvm::ArrayType>(_type)) | 547 else if (llvm::isa<llvm::ArrayType>(_type)) |
548 { | 548 { |
549 const llvm::ArrayType* at = llvm::cast<llvm::ArrayType>(_type); | 549 const llvm::ArrayType* at = llvm::cast<llvm::ArrayType>(_type); |
550 assert(_type->getContainedType(0) == _init->getType()); | 550 if (at->getElementType() == _init->getType()) { |
551 std::vector<llvm::Constant*> initvals; | 551 std::vector<llvm::Constant*> initvals; |
552 initvals.resize(at->getNumElements(), _init); | 552 initvals.resize(at->getNumElements(), _init); |
553 _init = llvm::ConstantArray::get(at, initvals); | 553 _init = llvm::ConstantArray::get(at, initvals); |
554 } | |
555 else { | |
556 assert(0); | |
557 } | |
554 } | 558 } |
555 else { | 559 else { |
556 Logger::cout() << "Unexpected initializer type: " << *_type << '\n'; | 560 Logger::cout() << "Unexpected initializer type: " << *_type << '\n'; |
557 //assert(0); | 561 //assert(0); |
558 } | 562 } |