[PATCH] Make DataLayout Non-Optional in the Module

Chandler Carruth chandlerc at google.com
Mon Mar 2 10:29:48 PST 2015


On Mon, Mar 2, 2015 at 10:21 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:

> > On Mar 2, 2015, at 9:40 AM, Eric Christopher <echristo at gmail.com> wrote:
> >
> > Few small comments:
> >
> > a) You've got Function::getDataLayout - I think I'd prefer people to
> generally have to ask the Function parent to get the data layout. (It's
> also a little inconsistent in the code, but should be fairly sed'able).
>
> Not sure I understand what you mean. Are you saying that getDataLayout()
> should be available on the module only?
> Note: I haven’t added this, there is a getDataLayout() in Instruction,
> BasicBlock, and GlobalValue.
> It saves some space when the only thing you have is an instruction:
>    I->getParent()->getParent()->getParent()->getDataLayout();


Rather than replicating all of the things we want to dig out of the module
at each layer, I'd rather add a "getModule" along side the "getParent".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150302/8adeebe1/attachment.html>


More information about the llvm-commits mailing list