[clang][driver][NFC] Call IsARMBigEndain function only for isARM and isThumb.
authorSimi Pallipurath <simi.pallipurath@arm.com>
Thu, 20 Jul 2023 09:26:45 +0000 (10:26 +0100)
committerSimi Pallipurath <simi.pallipurath@arm.com>
Tue, 25 Jul 2023 08:20:59 +0000 (09:20 +0100)
commit9dcd232f4afabdad46e5bc2d71834765acd7738c
tree3446d059db53120913fe0e4a21c977a8f0a27031
parent4eff7fae60ff9c4640752ae88befcd9f6428ee10
[clang][driver][NFC] Call IsARMBigEndain function only for isARM and isThumb.

IsARMBIgEndian function returns true only if:
  1. The triples are either arm or thumb and the
     commandline has the  option -mbig-endian
  2. 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.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D155808
clang/lib/Driver/ToolChains/BareMetal.cpp
clang/lib/Driver/ToolChains/Gnu.cpp