[lld] r221427 - [ELF] Implement isLittleEndian for all architectures

Charlie Turner charlie.turner at arm.com
Thu Nov 6 09:57:49 PST 2014


> We have one in llvm.

I wonder if it's possible to use an approach similar to that taken by LLVM
object library.

I'm not familiar with lld, but can you not pick up the endianness from the
ELFLinkingContext::create(llvm::Triple)  factory? You're switching on the
triple there, so you can detect the endianness for arch's on which that
matters (see ArchType in Triple.h) instead of replicating the logic in the
isLittleEndian methods again.

It's also odd that for PPC, you always return false of isLittleEndian, I
thought PPC does allow endian switching?

Maybe I'm misunderstanding the wider context, this just smells a bit odd :)

Kind regards,
Charlie.









More information about the llvm-commits mailing list