Changing Endian in TargetData

I’m trying to change the Endian of X86 from little to big in the TargetData. I only care about the way in which this effects the LLVM IR, not the actual backend code. I’ve changed the “e-” to “E-” in X86TargetMachine.cpp (where it sets the DataLayout) with no luck. Are there any other obvious places that I need to change this?

The TargetData docs were somewhat helpful but not entirely, if I have missed some obviousness in the docs, I apologize.

Hello Ryan,

I'm trying to change the Endian of X86 from little to big in the TargetData.
I only care about the way in which this effects the LLVM IR, not the actual
backend code. I've changed the "e-" to "E-" in X86TargetMachine.cpp (where
it sets the DataLayout) with no luck. Are there any other obvious places
that I need to change this?

The lowering code in all places might implicitly do little-endian things.

Even if I'm only looking at the ir and emit-llvm?

Ah, sorry, I misread your email. How you're producing the IR then?

-S -emit-llvm

No luck there with modifying clang/lib/Basic/Targets.cpp unfortunately. I only modified BigEndian to ‘true’ and Builder.defineMacro to “BIG_ENDIAN

Anton,

I have fixed this, thanks for the help. I missed the subtargets X86_32/64 (the data layout string) in that file and had previously only changed the generic target X86, thanks again.