comparison gen/toobj.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 c03d164e96d9
children 8d086d552909
comparison
equal deleted inserted replaced
1568:a591aa6bd6dc 1569:755abafbf25d
403 403
404 /* ================================================================== */ 404 /* ================================================================== */
405 405
406 // the following code generates functions and needs to output 406 // the following code generates functions and needs to output
407 // debug info. these macros are useful for that 407 // debug info. these macros are useful for that
408 #define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) ) 408 #define DBG_TYPE ( getPtrToType(llvm::StructType::get(gIR->context(),NULL,NULL)) )
409 #define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) ) 409 #define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) )
410 410
411 // build module ctor 411 // build module ctor
412 412
413 llvm::Function* build_module_ctor() 413 llvm::Function* build_module_ctor()
809 // register this ctor in the magic llvm.global_ctors appending array 809 // register this ctor in the magic llvm.global_ctors appending array
810 const LLFunctionType* magicfty = LLFunctionType::get(LLType::VoidTy, std::vector<const LLType*>(), false); 810 const LLFunctionType* magicfty = LLFunctionType::get(LLType::VoidTy, std::vector<const LLType*>(), false);
811 std::vector<const LLType*> magictypes; 811 std::vector<const LLType*> magictypes;
812 magictypes.push_back(LLType::Int32Ty); 812 magictypes.push_back(LLType::Int32Ty);
813 magictypes.push_back(getPtrToType(magicfty)); 813 magictypes.push_back(getPtrToType(magicfty));
814 const LLStructType* magicsty = LLStructType::get(magictypes); 814 const LLStructType* magicsty = LLStructType::get(gIR->context(), magictypes);
815 815
816 // make the constant element 816 // make the constant element
817 std::vector<LLConstant*> magicconstants; 817 std::vector<LLConstant*> magicconstants;
818 magicconstants.push_back(DtoConstUint(65535)); 818 magicconstants.push_back(DtoConstUint(65535));
819 magicconstants.push_back(mictor); 819 magicconstants.push_back(mictor);