Mercurial > projects > ldc
comparison gen/arrays.cpp @ 602:48f079b4fe0f
Fixed ArrayLiteralExp::toConstElem for dynamic arrays, tango-user library should now be possible to build. It seems to be related to DMD bug 2356, which must have been introduced recently, as we already handled this fine for ArrayInitializers, just not ArrayLiterals... Kinda annoying to have to do this work due to DMD bugs ...
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 15 Sep 2008 15:48:59 +0200 |
parents | 7042d912767e |
children | 1b62222581fb |
comparison
equal
deleted
inserted
replaced
601:03a5e609eef3 | 602:48f079b4fe0f |
---|---|
345 if (arrinittype->ty == Tsarray) | 345 if (arrinittype->ty == Tsarray) |
346 return constarr; | 346 return constarr; |
347 else | 347 else |
348 assert(arrinittype->ty == Tarray); | 348 assert(arrinittype->ty == Tarray); |
349 | 349 |
350 LLGlobalVariable* gvar = new LLGlobalVariable(arrty,true,LLGlobalValue::InternalLinkage,constarr,"constarray",gIR->module); | 350 LLGlobalVariable* gvar = new LLGlobalVariable(arrty,true,LLGlobalValue::InternalLinkage,constarr,".constarray",gIR->module); |
351 LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) }; | 351 LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) }; |
352 LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2); | 352 LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2); |
353 return DtoConstSlice(DtoConstSize_t(tdim),gep); | 353 return DtoConstSlice(DtoConstSize_t(tdim),gep); |
354 } | 354 } |
355 | 355 |