@@ -340,7 +340,7 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
340340
341341 const auto ftype = FunctionType::get (get_type<void >(), {
342342 get_type<u8 *>(), // Exec base
343- GetContextType ()-> getPointerTo (), // PPU context
343+ m_ir-> getPtrTy (), // PPU context
344344 get_type<u64 >(), // Segment address (for PRX)
345345 get_type<u8 *>(), // Memory base
346346 get_type<u64 >(), // r0
@@ -380,7 +380,7 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
380380 const auto addr_array = new GlobalVariable (*m_module, addr_array_type, false , GlobalValue::PrivateLinkage, ConstantDataArray::get (m_context, vec_addrs));
381381
382382 // Create an array of function pointers
383- const auto func_table_type = ArrayType::get (ftype-> getPointerTo (), functions.size ());
383+ const auto func_table_type = ArrayType::get (m_ir-> getPtrTy (), functions.size ());
384384 const auto init_func_table = ConstantArray::get (func_table_type, functions);
385385 const auto func_table = new GlobalVariable (*m_module, func_table_type, false , GlobalVariable::PrivateLinkage, init_func_table);
386386
@@ -407,7 +407,7 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
407407 const auto func_pc = ZExt (m_ir->CreateLoad (ptr_inst->getResultElementType (), ptr_inst), get_type<u64 >());
408408
409409 ptr_inst = dyn_cast<GetElementPtrInst>(m_ir->CreateGEP (func_table->getValueType (), func_table, {m_ir->getInt64 (0 ), index_value}));
410- assert (ptr_inst->getResultElementType () == ftype-> getPointerTo ());
410+ assert (ptr_inst->getResultElementType () == m_ir-> getPtrTy ());
411411
412412 const auto faddr = m_ir->CreateLoad (ptr_inst->getResultElementType (), ptr_inst);
413413 const auto faddr_int = m_ir->CreatePtrToInt (faddr, get_type<uptr>());
@@ -612,7 +612,7 @@ void PPUTranslator::CallFunction(u64 target, Value* indirect)
612612 const auto pos = m_ir->CreateShl (indirect, 1 );
613613 const auto ptr = dyn_cast<GetElementPtrInst>(m_ir->CreateGEP (get_type<u8 >(), m_exec, pos));
614614 const auto val = m_ir->CreateLoad (get_type<u64 >(), ptr);
615- callee = FunctionCallee (type, m_ir->CreateIntToPtr (val, type-> getPointerTo ()));
615+ callee = FunctionCallee (type, m_ir->CreateIntToPtr (val, m_ir-> getPtrTy ()));
616616
617617 // Load new segment address
618618 const auto seg_base_ptr = m_ir->CreateIntToPtr (m_ir->CreateAdd (
@@ -2794,8 +2794,8 @@ void PPUTranslator::MFOCRF(ppu_opcode_t op)
27942794 else if (std::none_of (m_cr + 0 , m_cr + 32 , [](auto * p) { return p; }))
27952795 {
27962796 // MFCR (optimized)
2797- Value* ln0 = m_ir->CreateIntToPtr (m_ir->CreatePtrToInt (m_ir->CreateStructGEP (m_thread_type, m_thread, 99 ), GetType<uptr>()), GetType< u8 [ 16 ]>()-> getPointerTo ());
2798- Value* ln1 = m_ir->CreateIntToPtr (m_ir->CreatePtrToInt (m_ir->CreateStructGEP (m_thread_type, m_thread, 115 ), GetType<uptr>()), GetType< u8 [ 16 ]>()-> getPointerTo ());
2797+ Value* ln0 = m_ir->CreateIntToPtr (m_ir->CreatePtrToInt (m_ir->CreateStructGEP (m_thread_type, m_thread, 99 ), GetType<uptr>()), m_ir-> getPtrTy ());
2798+ Value* ln1 = m_ir->CreateIntToPtr (m_ir->CreatePtrToInt (m_ir->CreateStructGEP (m_thread_type, m_thread, 115 ), GetType<uptr>()), m_ir-> getPtrTy ());
27992799
28002800 ln0 = m_ir->CreateLoad (GetType<u8 [16 ]>(), ln0);
28012801 ln1 = m_ir->CreateLoad (GetType<u8 [16 ]>(), ln1);
@@ -5384,7 +5384,7 @@ MDNode* PPUTranslator::CheckBranchProbability(u32 bo)
53845384void PPUTranslator::build_interpreter ()
53855385{
53865386#define BUILD_VEC_INST (i ) { \
5387- m_function = llvm::cast<llvm::Function>(m_module->getOrInsertFunction (" op_" #i, get_type<void >(), m_thread_type-> getPointerTo ()).getCallee ()); \
5387+ m_function = llvm::cast<llvm::Function>(m_module->getOrInsertFunction (" op_" #i, get_type<void >(), m_ir-> getPtrTy ()).getCallee ()); \
53885388 std::fill (std::begin (m_globals), std::end (m_globals), nullptr ); \
53895389 std::fill (std::begin (m_locals), std::end (m_locals), nullptr ); \
53905390 IRBuilder<> irb (BasicBlock::Create (m_context, " __entry" , m_function)); \
0 commit comments