<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Here is the first patch.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Chandler Carruth [mailto:chandlerc@google.com]
<br>
<b>Sent:</b> Thursday, October 04, 2012 11:46 AM<br>
<b>To:</b> Villmow, Micah<br>
<b>Cc:</b> Chris Lattner; llvm-commits@cs.uiuc.edu LLVM; cfe-commits@cs.uiuc.edu cfe<br>
<b>Subject:</b> Re: [llvm-commits] [cfe-commits] [Patch] Move TargetData from Target to Support/VMCore<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On Thu, Oct 4, 2012 at 11:40 AM, Villmow, Micah <<a href="mailto:Micah.Villmow@amd.com" target="_blank">Micah.Villmow@amd.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Chris, the problem with steps #2/#3 is that plenty of clients have forward declarations of TargetData and the typedef won't work in this case, so I need to update the clients anyways.<br>
<br>
What about this sequence:<br>
1) Introduce include/llvm/DataLayout.h and lib/VMCore/DataLayout.cpp(which is a functionally equivalent copy of TargetData).<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">First just copy the files over without any edits, then in a second commit rename stuff to DataLayout. That way we can see the rename. It's all dead code until #2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">2) Update each client to point to DataLayout.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This step needs to be a single commit.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Otherwise, this seems a reasonable way to cope with forward declarations. They make renaming really hard. =/<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">3) Remove TargetData.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal"><br>
<br>
> -----Original Message-----<br>
> From: Chris Lattner [mailto:<a href="mailto:clattner@apple.com">clattner@apple.com</a>]<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">> Sent: Tuesday, October 02, 2012 10:02 PM<br>
> To: Villmow, Micah<br>
> Cc: Evan Cheng; Hal Finkel; <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> LLVM; Nadav Rotem;<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a> cfe<br>
> Subject: Re: [cfe-commits] [llvm-commits] [Patch] Move TargetData from<br>
> Target to Support/VMCore<br>
><br>
><br>
> On Oct 2, 2012, at 5:57 PM, "Villmow, Micah" <<a href="mailto:Micah.Villmow@amd.com">Micah.Villmow@amd.com</a>><br>
> wrote:<br>
><br>
> > Chris,<br>
> > Here is an attachd patch. It is quite large because the number of<br>
> places within the LLVM tree where TargetData is used.<br>
> ><br>
> > My only question is did you want a new subdirectory, VMCore, created<br>
> in the include directory?<br>
><br>
> My mistake, sorry for being unclear.  More specifically, please do this<br>
> as a series of independent patches:<br>
><br>
> 1. Add a typedef for TargetData -> DataLayout in TargetData.h 2. Rename<br>
> the TargetData class & implementation (but not the file or clients) to<br>
> DataLayout.  Switch the typedef to DataLayout -> TargetData.<br>
> 3. Rename uses of the "TargetData" typedef to be DataLayout.  Remove the<br>
> typedef.<br>
> 4. Move lib/Target/TargetData.cpp to lib/VMCore/DataLayout.cpp 5. Move<br>
> the contents the header from include/llvm/Target/TargetData.h to<br>
> include/llvm/DataLayout.h and keep TargetData.h as just a single<br>
> #include of the new header.<br>
> 6. Update all the clients to switch from TargetData.h to DataLayout.h in<br>
> the various projects (clang/llvm/dragonegg/lldb) that include it.  When<br>
> they're all converted, remove the forwarding header.<br>
><br>
> The idea of each of these steps is that they become "obvious" and really<br>
> simple to review.  Thanks for tackling this Micah!<br>
><br>
> -Chris<br>
><br>
> ><br>
> > Micah<br>
> ><br>
> >> -----Original Message-----<br>
> >> From: Chris Lattner [mailto:<a href="mailto:clattner@apple.com">clattner@apple.com</a>]<br>
> >> Sent: Tuesday, October 02, 2012 9:26 AM<br>
> >> To: Villmow, Micah<br>
> >> Cc: Evan Cheng; Hal Finkel; <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> LLVM; Nadav<br>
> >> Rotem; <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a> cfe<br>
> >> Subject: Re: [cfe-commits] [llvm-commits] [Patch] Move TargetData<br>
> >> from Target to Support/VMCore<br>
> >><br>
> >> Yes.  How about just llvm/VMCore/DataLayout.h?<br>
> >><br>
> >> -Chris<br>
> >><br>
> >> On Oct 2, 2012, at 8:55 AM, "Villmow, Micah" <<a href="mailto:Micah.Villmow@amd.com">Micah.Villmow@amd.com</a>><br>
> >> wrote:<br>
> >><br>
> >>> Chris,<br>
> >>> So if I renamed it to something like DataLayoutParser, that would be<br>
> >> acceptable to move the functionality into core?<br>
> >>><br>
> >>> Micah<br>
> >>><br>
> >>>> -----Original Message-----<br>
> >>>> From: Chris Lattner [mailto:<a href="mailto:clattner@apple.com">clattner@apple.com</a>]<br>
> >>>> Sent: Sunday, September 30, 2012 9:03 AM<br>
> >>>> To: Evan Cheng<br>
> >>>> Cc: Hal Finkel; Villmow, Micah; <a href="mailto:llvm-commits@cs.uiuc.edu">
llvm-commits@cs.uiuc.edu</a> LLVM;<br>
> >>>> Nadav Rotem; <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a> cfe<br>
> >>>> Subject: Re: [cfe-commits] [llvm-commits] [Patch] Move TargetData<br>
> >>>> from Target to Support/VMCore<br>
> >>>><br>
> >>>> On Sep 26, 2012, at 9:18 PM, Evan Cheng <<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>><br>
> wrote:<br>
> >>>>> On Sep 26, 2012, at 11:07 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br>
> >>>>><br>
> >>>>>> On Tue, 25 Sep 2012 16:16:22 -0700 Evan Cheng<br>
> >>>>>> <<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>> wrote:<br>
> >>>>>><br>
> >>>>>>> Sorry, I understand why you are requesting this but I thinking<br>
> >>>>>>> moving TargetData to support is conceptually dirty.<br>
> >>>>>><br>
> >>>>>> Can you please explain this? I think that the opposite is true:<br>
> >>>>>> Having TargetData in Target is conceptually dirty. TargetData<br>
> >>>>>> represents 'target information that is available to frontends and<br>
> >>>>>> IR-level passes without linking to the target descriptions'.<br>
> >>>>><br>
> >>>>> Agreed.<br>
> >>>>><br>
> >>>>>> As a result, I feel<br>
> >>>>>> that TargetData does not belong with the target-description<br>
> >>>>>> infrastructure, and so it should be moved out of Target so that<br>
> >>>>>> everyone can use it.<br>
> >>>>><br>
> >>>>> I agree it should be moved out but at least it's target related.<br>
> >>>> Polluting Support / VMCore with it is just worse. They have nothing<br>
> >>>> to do with target data conceptually. This is all a matter of taste.<br>
> >>>> I'll let Chris make the decision.<br>
> >>>><br>
> >>>> I agree with this patch in principle: TargetData should be moved to<br>
> >>>> VMCore.  However, the class should also be renamed.<br>
> >>>><br>
> >>>> -Chris<br>
> >>><br>
> >>><br>
> ><br>
> > <move_TargetData_to_DataLayout.txt><br>
><br>
<br>
<br>
<br>
_______________________________________________<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>