From 6730dc1dc486f9ab2a742e7ae4647af94c6f8a78 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 7 Dec 2021 13:21:24 +0300 Subject: [PATCH] LLVM DSL: print some debug info in get_const_vector --- rpcs3/Emu/CPU/CPUTranslator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUTranslator.cpp b/rpcs3/Emu/CPU/CPUTranslator.cpp index 6af0cdee42..a0a15fb34e 100644 --- a/rpcs3/Emu/CPU/CPUTranslator.cpp +++ b/rpcs3/Emu/CPU/CPUTranslator.cpp @@ -206,13 +206,18 @@ std::pair cpu_translator::get_const_vector(llvm::Value* c, u32 return {}; } + std::string result; + llvm::raw_string_ostream out(result); + c->print(out, true); + out.flush(); + if (llvm::isa(c)) { // Sorry, if we cannot evaluate it we cannot use it - fmt::throw_exception("[0x%x, %u] Constant Expression!", _pos, _line); + fmt::throw_exception("[0x%x, %u] Constant Expression!\n%s", _pos, _line, result); } - fmt::throw_exception("[0x%x, %u] Unexpected constant type", _pos, _line); + fmt::throw_exception("[0x%x, %u] Unexpected constant type!\n%s", _pos, _line, result); } const auto sct = t->getScalarType();