[llvm-commits] [llvm] r77927 - in /llvm/trunk: include/llvm/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/Blackfin/ lib/Target/CBackend/ lib/Target/CellSPU/ lib/Target/CppBackend/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Ta

Daniel Dunbar daniel at zuster.org
Mon Aug 3 08:11:06 PDT 2009


On Mon, Aug 3, 2009 at 1:07 AM, Eli Friedman<eli.friedman at gmail.com> wrote:
> On Sun, Aug 2, 2009 at 4:37 PM, Daniel Dunbar<daniel at zuster.org> wrote:
>> Author: ddunbar
>> Date: Sun Aug  2 18:37:13 2009
>> New Revision: 77927
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77927&view=rev
>> Log:
>> Move most targets TargetMachine constructor to only taking a target triple.
>>  - The C, C++, MSIL, and Mips backends still need the module.
>
> I took care of the Mips backend earlier.

Thanks!

> It looks like the C, C++ and MSIL backends need the DataLayout member of
> the Module; perhaps the standard signature for initializing a target should include
> that as a separate argument?

I'm not sure that is the right way to go; currently it is a little odd
that the targets make up their own DataLayout independent of what was
specified in the module, and various bits of code use that instead of
the module layout. Intrinsically this seems bad, it seems like the
module layout should be used everywhere, and the target should just
validate that that layout is sane.

But I don't really know how getTargetData is used in the back end, an
alternate approach is to have each target provide a default layout
string, and have the base TargetMachine class select either the
default layout or the module layout, after it has the module
available. This would also kill the unnecessarily duplicated
getTargetData methods.

 - Daniel




More information about the llvm-commits mailing list