[llvm-commits] [llvm] r111230 - /llvm/trunk/include/llvm/MC/MCObjectWriter.h

Chris Lattner clattner at apple.com
Tue Aug 17 08:38:57 PDT 2010


On Aug 17, 2010, at 8:28 AM, Benjamin Kramer wrote:

>> 
>> Gross, IMHO. Adding Host dependencies to portable code, which isn't
>> performance sensitive, seems like a bad trade to me.
> 
> When rummaging in ELFObjectWriter I saw the gross code this generates and made a workaround.
> I will revert if it's not perf sensitive and less grossness makes you sleep better at night :)
> 
> It would be nice if we put all the endian conversion stuff in a common place and make it really fast,
> but MCObjectWriter doesn't seem to be the right place for that.

I agree, it seems that we really want some routines in libsupport like:

uint32_t Convert32BitToLE(uint32_t x);
uint32_t Convert32BitToBE(uint32_t x);
uint32_t Convert32BitToAny(uint32_t x, Endianness_t);

That way, the routines could be used for "push_back" as well as "write to memory" types of API.  For "reading", we'd also want Convert...From

-Chris



More information about the llvm-commits mailing list