[LLVMdev] endian independence
jay.foad at gmail.com
Mon Oct 27 11:01:57 PDT 2008
> Yes, I can see that the llvm part of this is more straightforward and
> less controversial than the llvm-gcc part. Maybe I should submit the
> llvm part (since it applies to all source languages) and keep the
> llvm-gcc part as a local hack.
Here (attached) is a patch for the llvm parts of this. It doesn't
introduce any new failures in "make check". Some points:
1. I don't understand why Module has its own DataLayout string, and
its own code to parse it (in getEndianness and getPointerSize).
Couldn't it have an instance of TargetData instead? Or is it just that
Module wants a concept of unknown endianness/pointer size, which
TargetData didn't support?
2. I'm assuming that for most code in lib/Target/, lib/CodeGen and
lib/ExecutionEngine you have a real CPU target with known endianness,
so I haven't changed any of that code to check for unknown endianness.
3. The Endianness enumeration should probably live somewhere other
than Module. But I don't know where.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12339 bytes
Desc: not available
More information about the llvm-dev