comparison gen/arrays.cpp @ 1529:ad7f2f1862d6

Adjust LDC to work with the LLVMContext LLVM changes. This means we now require a fairly new LLVM revision. I use 75234.
author Christian Kamm <kamm incasoftware de>
date Fri, 10 Jul 2009 21:30:02 +0200
parents 391fdb36f2aa
children 8ca25bd765a3
comparison
equal deleted inserted replaced
1528:15f1707721fa 1529:ad7f2f1862d6
320 return constarr; 320 return constarr;
321 321
322 // for dynamic array we need to make a global with the data, so we have a pointer for the dynamic array 322 // for dynamic array we need to make a global with the data, so we have a pointer for the dynamic array
323 // Important: don't make the gvar constant, since this const initializer might 323 // Important: don't make the gvar constant, since this const initializer might
324 // be used as an initializer for a static T[] - where modifying contents is allowed. 324 // be used as an initializer for a static T[] - where modifying contents is allowed.
325 LLGlobalVariable* gvar = new LLGlobalVariable(constarr->getType(), false, LLGlobalValue::InternalLinkage, constarr, ".constarray", gIR->module); 325 LLGlobalVariable* gvar = new LLGlobalVariable(*gIR->module, constarr->getType(), false, LLGlobalValue::InternalLinkage, constarr, ".constarray");
326 LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) }; 326 LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) };
327 327
328 LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2); 328 LLConstant* gep = llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2);
329 gep = llvm::ConstantExpr::getBitCast(gvar, getPtrToType(llelemty)); 329 gep = llvm::ConstantExpr::getBitCast(gvar, getPtrToType(llelemty));
330 330