comparison gen/arrays.cpp @ 1569:755abafbf25d

Push the context through StructType::get. Requires LLVM >= 78258. Also remove old #if's.
author Benjamin Kramer <benny.kra@gmail.com>
date Thu, 06 Aug 2009 01:47:39 +0200
parents 1d5c3354b3c2
children 8d086d552909
comparison
equal deleted inserted replaced
1568:a591aa6bd6dc 1569:755abafbf25d
24 { 24 {
25 assert(arrayTy->nextOf()); 25 assert(arrayTy->nextOf());
26 const LLType* elemty = DtoType(arrayTy->nextOf()); 26 const LLType* elemty = DtoType(arrayTy->nextOf());
27 if (elemty == LLType::VoidTy) 27 if (elemty == LLType::VoidTy)
28 elemty = LLType::Int8Ty; 28 elemty = LLType::Int8Ty;
29 return LLStructType::get(DtoSize_t(), getPtrToType(elemty), NULL); 29 return LLStructType::get(gIR->context(), DtoSize_t(), getPtrToType(elemty), NULL);
30 } 30 }
31 31
32 const LLStructType* DtoArrayType(const LLType* t) 32 const LLStructType* DtoArrayType(const LLType* t)
33 { 33 {
34 return LLStructType::get(DtoSize_t(), getPtrToType(t), NULL); 34 return LLStructType::get(gIR->context(), DtoSize_t(), getPtrToType(t), NULL);
35 } 35 }
36 36
37 ////////////////////////////////////////////////////////////////////////////////////////// 37 //////////////////////////////////////////////////////////////////////////////////////////
38 38
39 const LLArrayType* DtoStaticArrayType(Type* t) 39 const LLArrayType* DtoStaticArrayType(Type* t)
307 mismatch = true; 307 mismatch = true;
308 } 308 }
309 309
310 LLConstant* constarr; 310 LLConstant* constarr;
311 if (mismatch) 311 if (mismatch)
312 constarr = LLConstantStruct::get(initvals); 312 constarr = LLConstantStruct::get(gIR->context(), initvals);
313 else 313 else
314 constarr = LLConstantArray::get(LLArrayType::get(llelemty, arrlen), initvals); 314 constarr = LLConstantArray::get(LLArrayType::get(llelemty, arrlen), initvals);
315 315
316 // std::cout << "constarr: " << *constarr << std::endl; 316 // std::cout << "constarr: " << *constarr << std::endl;
317 317
392 392
393 ////////////////////////////////////////////////////////////////////////////////////////// 393 //////////////////////////////////////////////////////////////////////////////////////////
394 LLConstant* DtoConstSlice(LLConstant* dim, LLConstant* ptr) 394 LLConstant* DtoConstSlice(LLConstant* dim, LLConstant* ptr)
395 { 395 {
396 LLConstant* values[2] = { dim, ptr }; 396 LLConstant* values[2] = { dim, ptr };
397 return LLConstantStruct::get(values, 2); 397 return LLConstantStruct::get(gIR->context(), values, 2);
398 } 398 }
399 399
400 ////////////////////////////////////////////////////////////////////////////////////////// 400 //////////////////////////////////////////////////////////////////////////////////////////
401 static bool isInitialized(Type* et) { 401 static bool isInitialized(Type* et) {
402 // Strip static array types from element type 402 // Strip static array types from element type