On Thu, Oct 4, 2012 at 11:40 AM, Villmow, Micah <span dir="ltr"><<a href="mailto:Micah.Villmow@amd.com" target="_blank" class="cremed">Micah.Villmow@amd.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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).<br></blockquote><div><br></div><div>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</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) Update each client to point to DataLayout.<br></blockquote><div><br></div><div>This step needs to be a single commit.</div><div><br></div><div>Otherwise, this seems a reasonable way to cope with forward declarations. They make renaming really hard. =/</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3) Remove TargetData.<br></blockquote><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im HOEnZb"><br>
<br>
> -----Original Message-----<br>
> From: Chris Lattner [mailto:<a href="mailto:clattner@apple.com" class="cremed">clattner@apple.com</a>]<br>
</div><div class="HOEnZb"><div class="h5">> 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" class="cremed">llvm-commits@cs.uiuc.edu</a> LLVM; Nadav Rotem;<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu" class="cremed">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" class="cremed">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" class="cremed">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" class="cremed">llvm-commits@cs.uiuc.edu</a> LLVM; Nadav<br>
> >> Rotem; <a href="mailto:cfe-commits@cs.uiuc.edu" class="cremed">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" class="cremed">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" class="cremed">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" class="cremed">llvm-commits@cs.uiuc.edu</a> LLVM;<br>
> >>>> Nadav Rotem; <a href="mailto:cfe-commits@cs.uiuc.edu" class="cremed">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" class="cremed">evan.cheng@apple.com</a>><br>
> wrote:<br>
> >>>>> On Sep 26, 2012, at 11:07 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" class="cremed">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" class="cremed">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>
_______________________________________________<br>
</div></div><div class="HOEnZb"><div class="h5">llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>