mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
Opt-in LLVM logs
This commit is contained in:
parent
3648a058d1
commit
b45cea1434
1 changed files with 9 additions and 6 deletions
|
@ -92,6 +92,8 @@ cfg::map_entry<ppu_decoder_type> g_cfg_ppu_decoder(cfg::root.core, "PPU Decoder"
|
||||||
{ "Recompiler (LLVM)", ppu_decoder_type::llvm },
|
{ "Recompiler (LLVM)", ppu_decoder_type::llvm },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cfg::bool_entry g_cfg_llvm_logs(cfg::root.core, "Save LLVM logs");
|
||||||
|
|
||||||
const ppu_decoder<ppu_interpreter_precise> s_ppu_interpreter_precise;
|
const ppu_decoder<ppu_interpreter_precise> s_ppu_interpreter_precise;
|
||||||
const ppu_decoder<ppu_interpreter_fast> s_ppu_interpreter_fast;
|
const ppu_decoder<ppu_interpreter_fast> s_ppu_interpreter_fast;
|
||||||
|
|
||||||
|
@ -1142,16 +1144,17 @@ extern void ppu_initialize(const ppu_module& info)
|
||||||
std::string result;
|
std::string result;
|
||||||
raw_string_ostream out(result);
|
raw_string_ostream out(result);
|
||||||
|
|
||||||
|
if (g_cfg_llvm_logs)
|
||||||
|
{
|
||||||
out << *module; // print IR
|
out << *module; // print IR
|
||||||
fs::file(fs::get_config_dir() + "LLVM.log", fs::rewrite)
|
fs::file(Emu.GetCachePath() + obj_name + ".log", fs::rewrite).write(out.str());
|
||||||
.write(out.str());
|
|
||||||
|
|
||||||
result.clear();
|
result.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (verifyModule(*module, &out))
|
if (verifyModule(*module, &out))
|
||||||
{
|
{
|
||||||
out.flush();
|
out.flush();
|
||||||
LOG_ERROR(PPU, "LLVM: Translation failed:\n%s", result);
|
LOG_ERROR(PPU, "LLVM: Verification failed for %s:\n%s", obj_name, result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue