Opt-in LLVM logs
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
out << *module; // print IR
|
if (g_cfg_llvm_logs)
|
||||||
fs::file(fs::get_config_dir() + "LLVM.log", fs::rewrite)
|
{
|
||||||
.write(out.str());
|
out << *module; // print IR
|
||||||
|
fs::file(Emu.GetCachePath() + obj_name + ".log", fs::rewrite).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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user