[PATCH] Require an MCContext when constructing an MCDisassembler.

Jim Grosbach grosbach at apple.com
Mon Apr 14 17:00:11 PDT 2014


LGTM. Thanks!

On Apr 11, 2014, at 8:15 PM, Lang Hames <lhames at gmail.com> wrote:

> 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.
> 
> 
> <RequireMCContextForMCDisassembler.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140414/f327dcf5/attachment.html>


More information about the llvm-commits mailing list