[llvm-commits] [cfe-commits] [Patch] Move TargetData from Target to Support/VMCore

Chandler Carruth chandlerc at google.com
Thu Oct 4 16:59:50 PDT 2012


On Thu, Oct 4, 2012 at 4:48 PM, Villmow, Micah <Micah.Villmow at amd.com>wrote:

>  Here is my first run at implementing TargetData with DataLayout.****
>
> ** **
>
> This should allow all the clients to start switching over to datalayout
> without any functionality breaking.
>
There are comments in TargetData that may need updating.

You've made the destructor virtual. I don't think you should need this. The
code responsible for creating and destroying these will need to be the last
migrated (which is fine) and that code should use TargetData consistently
until every client is updated to use DataLayout. Then it can switch, and
the virtual destructor won't matter.

Some comments:

+ DataLayout(*reinterpret_cast<const DataLayout*>(&TD))

No, you should just call DataLayout(TD). Derived-to-base conversion will
handle the rest.

With those changes, if everything builds and tests pass, LGTM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121004/30dcd493/attachment.html>


More information about the llvm-commits mailing list