1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Opt-in LLVM logs

This commit is contained in:
Nekotekina 2017-03-14 15:14:04 +03:00
parent 3648a058d1
commit b45cea1434

View File

@ -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 },
});
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_fast> s_ppu_interpreter_fast;
@ -1142,16 +1144,17 @@ extern void ppu_initialize(const ppu_module& info)
std::string result;
raw_string_ostream out(result);
out << *module; // print IR
fs::file(fs::get_config_dir() + "LLVM.log", fs::rewrite)
.write(out.str());
result.clear();
if (g_cfg_llvm_logs)
{
out << *module; // print IR
fs::file(Emu.GetCachePath() + obj_name + ".log", fs::rewrite).write(out.str());
result.clear();
}
if (verifyModule(*module, &out))
{
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;
}