[llvm-commits] [PATCH] Perform initialization when building an EDDisassembler

Gregory Szorc gregory.szorc at gmail.com
Sat Mar 10 13:23:51 PST 2012


LLVMCreateDisasm() calls llvm::InitializeAll* to ensure that all
targets and disassemblers are registered automagically when a
disassembler is created [1].

EDDisassembler doesn't, unfortunately. And, since the LLVMInitialize*
symbols aren't exported as part of the llvm-c API (unlike what the
documentation for Target.t claims [2]), we need to work around this.

This patch makes EDDisassembler's ctor initialize the world so
disassemblers can be created from the C API.

I'm open to suggestions on the best way to fix the C API. One option
is certainly to remove the LLVMInitializeAll* functions and leave that
job to the internal C API implementation.

[1] http://llvm.org/doxygen/MC_2MCDisassembler_2Disassembler_8cpp_source.html#l00036
[2] http://llvm.org/doxygen/Target_8h.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Perform-initialization-when-building-an-EDDisassembl.patch
Type: text/x-patch
Size: 1497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120310/0123ebb6/attachment.bin>


More information about the llvm-commits mailing list