[llvm-commits] [llvm] r114856 - in /llvm/trunk/lib/Target/ARM: ARMELFWriterInfo.cpp ARMELFWriterInfo.h ARMSubtarget.h ARMTargetMachine.cpp ARMTargetMachine.h CMakeLists.txt

Rafael Espíndola rafael.espindola at gmail.com
Tue Sep 28 08:42:05 PDT 2010


>> An easy way to refactor this is to have a is64Bit method instead of a
>> field, but I am not sure about the runtime cost of it. Any other idea?
>
> The TargetELFWriter wants to know is64Bit and endian-ness in the constructor, both of which it calls into the target data for. It seems to me those are both things that the  caller will already know explicitly (indeed is64Bit is already a parameter for the X86TargetMachine constructor, for example) and so can be changed to explicit parameters of the TargetELFWriter constructor. What do you think?

I should be possible. The attached patch is probably 1/3rd of the way
there. The problem is that the same issue happens in other areas. For
example, with the attached patch we will get a failure in
TargetLowering::TargetLowering calling TD(TM.getTargetData()) with a
TM provided with "TLInfo(*this)" from the X86TargetMachine
constructor.

Maybe it is better to go the other way and try to make getTargetData
non virtual? The necessary information to create it can then be passed
down by the constructors.

> -Jim

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 6381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100928/5a3d06a7/attachment.bin>


More information about the llvm-commits mailing list