Skip to content

Commit

Permalink
LLVM DSL: print some debug info in get_const_vector<v128>
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Dec 7, 2021
1 parent 6b40d69 commit 6730dc1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rpcs3/Emu/CPU/CPUTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,18 @@ std::pair<bool, v128> cpu_translator::get_const_vector<v128>(llvm::Value* c, u32
return {};
}

std::string result;
llvm::raw_string_ostream out(result);
c->print(out, true);
out.flush();

if (llvm::isa<llvm::ConstantExpr>(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();
Expand Down

0 comments on commit 6730dc1

Please sign in to comment.