Integration of the disassembler occurs in the same way as the
instruction assembler, with a static
create
function being defined, which creates and returns a new
arch
Disassembler
.
arch
Disassembler
static MCDisassembler *createarch
Disassembler(const Target &T, const MCSubtargetInfo &STI) { return newarch
Disassembler(STI, T.createMCRegInfo("")); }
The LLVMInitialize
function is also defined which registers the disassembler with the rest
of the system.
arch
Disassembler
extern "C" void LLVMInitializearch
Disassembler() { // Register the disassembler TargetRegistry::RegisterMCDisassembler(Thearch
Target, createarch
Disassembler); }