[PATCH] Require an MCContext when constructing an MCDisassembler.

Lang Hames lhames at gmail.com
Fri Apr 11 20:15:28 PDT 2014


Hi All,

I would like to require that MCDisassemblers be constructed with MCContexts.

There are two main reasons for this:

(1) It is reasonable for an MCDisassembler to want to create constant
and/or target-specific MCExprs, but there is currently no attached
MCContext to create the expr in. (There was previously an MCContext member
in MCDisassembler, but this was removed in r 206063, and only
ever initialised in an ad-hoc fashion.)

(2) Many in-tree targets are redundantly constructing MCRegisterInfo
instances that could be obtained via the MCContext.

The attached patch adds an MCContext member to MCDisassembler, and adds an
MCContext argument to the MCDisassembler constructor. All in-tree targets
and tools are updated. Any out-of-tree targets should be easily updated by
following the template used in this patch. There should be no functional
change to the behaviour of any disassembler.

Cheers,
Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140411/50c5f009/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RequireMCContextForMCDisassembler.patch
Type: application/octet-stream
Size: 23801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140411/50c5f009/attachment.obj>


More information about the llvm-commits mailing list