Mercurial > projects > ldc
comparison gen/toir.cpp @ 605:e235b80c92bc
Removed useless assert in ArrayLiteralExp::toConstElem
Added second verification pass after optimization
Commented an optimization pass out from lvl2, it turns the IR invalid, see llvm PR 2800
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 16 Sep 2008 16:06:39 +0200 |
parents | 10bc9eb9e262 |
children | 1b62222581fb |
comparison
equal
deleted
inserted
replaced
604:a30fc28e8f23 | 605:e235b80c92bc |
---|---|
2217 // build llvm array type | 2217 // build llvm array type |
2218 const LLArrayType* arrtype = LLArrayType::get(DtoType(elemt), elements->dim); | 2218 const LLArrayType* arrtype = LLArrayType::get(DtoType(elemt), elements->dim); |
2219 | 2219 |
2220 // dynamic arrays can occur here as well ... | 2220 // dynamic arrays can occur here as well ... |
2221 bool dyn = (bt->ty == Tarray); | 2221 bool dyn = (bt->ty == Tarray); |
2222 if (!dyn) | |
2223 assert(arrtype->getNumElements() == elements->dim); | |
2224 | 2222 |
2225 // build the initializer | 2223 // build the initializer |
2226 std::vector<LLConstant*> vals(elements->dim, NULL); | 2224 std::vector<LLConstant*> vals(elements->dim, NULL); |
2227 for (unsigned i=0; i<elements->dim; ++i) | 2225 for (unsigned i=0; i<elements->dim; ++i) |
2228 { | 2226 { |