SPU LLVM: change patchpoint name generation

Allow 2 or more patchpoint from a single address.
This commit is contained in:
Nekotekina 2019-11-17 22:07:08 +03:00
parent 2de3c06781
commit f30b81f8b0

View File

@ -3230,6 +3230,9 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
// Module name
std::string m_hash;
// Patchpoint unique id
u32 m_pp_id = 0;
// Current function (chunk)
llvm::Function* m_function;
@ -3403,7 +3406,7 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
verify(HERE), m_finfo, !m_finfo->fn || m_function == m_finfo->chunk;
// Register under a unique linkable name
const std::string ppname = fmt::format("%s-pp-0x%05x", m_hash, m_pos);
const std::string ppname = fmt::format("%s-pp-%u", m_hash, m_pp_id++);
m_engine->addGlobalMapping(ppname, (u64)m_spurt->make_branch_patchpoint());
// Create function with not exactly correct type
@ -4219,6 +4222,8 @@ public:
const u32 start = m_pos;
const u32 end = start + m_size;
m_pp_id = 0;
if (g_cfg.core.spu_debug && !add_loc->logged.exchange(1))
{
this->dump(func, log);