IsARMBIgEndian function returns true only if:
- The triples are either arm or thumb and the commandline has the option -mbig-endian
- The triples are either armeb or thumbeb.
Missing the checking of arm or thumb triples in the
first case pass through the --be8 endian flag to
linker For AArch64 as well which is not expected.
This is the regression happened from the previous
patch https://reviews.llvm.org/D154786.
It is better to refactor to only call IsARMBigEndian
for isARM and isthumb satisfying conditions which
keeps ARM and AArch64 separate.
Is this the right place to fix?
I would expect it to be a precondition that the Triple was Arm or Thumb before calling isARMBigEndian?
For example
Shouldn't this be refactored to only call isARMBigEndian for isARM and isThumb? Something like:
This is a bit longer but it is easier to read and keeps ARM and AArch64 separate.