Mercurial > projects > ldc
comparison ir/irstruct.cpp @ 1231:212ec2d9d176
Fixed some minitest regressions.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 16 Apr 2009 19:21:30 +0200 |
parents | 79758fd2f48a |
children | f295e51d2dd0 |
comparison
equal
deleted
inserted
replaced
1230:e67c85d6e680 | 1231:212ec2d9d176 |
---|---|
21 { | 21 { |
22 aggrdecl = aggr; | 22 aggrdecl = aggr; |
23 | 23 |
24 type = aggr->type; | 24 type = aggr->type; |
25 | 25 |
26 packed = false; | 26 packed = (type->ty == Tstruct) |
27 ? type->alignsize() == 1 | |
28 : false; | |
27 | 29 |
28 // above still need to be looked at | 30 // above still need to be looked at |
29 | 31 |
30 init = NULL; | 32 init = NULL; |
31 constInit = NULL; | 33 constInit = NULL; |
188 // build constant struct | 190 // build constant struct |
189 llvm::Constant* definit = llvm::ConstantStruct::get(constants, packed); | 191 llvm::Constant* definit = llvm::ConstantStruct::get(constants, packed); |
190 IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl; | 192 IF_LOG Logger::cout() << "final default initializer: " << *definit << std::endl; |
191 | 193 |
192 // sanity check | 194 // sanity check |
193 assert(definit->getType() == type->irtype->get() && | 195 if (definit->getType() != type->irtype->get()) |
194 "default initializer type does not match the default struct type"); | 196 { |
197 assert(0 && "default initializer type does not match the default struct type"); | |
198 } | |
195 | 199 |
196 return definit; | 200 return definit; |
197 } | 201 } |
198 | 202 |
199 ////////////////////////////////////////////////////////////////////////////// | 203 ////////////////////////////////////////////////////////////////////////////// |