util/llvmdisassembler: map registers by names

Internal LLVM register IDs can and did change between LLVM versions.
These magic integers are replaced by iterating over all LLVM registers
and mapping them to FAIL* registers by name.
As this iteration requires a LLVM object created from a binary, a static
convenience function is added to LLVMtoFailTranslator which creates a
translator given the binary filename. Building this functionality inside
libfail-llvmdisassembler prevents experiments from needing to add LLVM
includes and library definitions.

Change-Id: I27927f40d5cb6d9a22bb2caf21ca2450f6bcb0b8
This commit is contained in:
Florian Lukas
2014-02-26 14:33:48 +01:00
parent 21f5f681e0
commit 0799e52fde
7 changed files with 111 additions and 57 deletions

View File

@ -7,11 +7,13 @@
namespace fail {
class LLVMDisassembler;
class LLVMtoFailGem5 : public LLVMtoFailTranslator {
public:
LLVMtoFailGem5();
LLVMtoFailGem5(LLVMDisassembler *disas);
};
} // end of namespace