[Object] Make IsLittleEndian check constexpr to silence static analyzer dead code warnings.

The "ELFT::TargetEndianness == support::little" check is known at compile time
This commit is contained in:
Simon Pilgrim 2022-06-18 17:35:54 +01:00
parent ac3f967382
commit 37185ceac9
1 changed files with 1 additions and 1 deletions

View File

@ -1174,7 +1174,7 @@ uint8_t ELFObjectFile<ELFT>::getBytesInAddress() const {
template <class ELFT>
StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
bool IsLittleEndian = ELFT::TargetEndianness == support::little;
constexpr bool IsLittleEndian = ELFT::TargetEndianness == support::little;
switch (EF.getHeader().e_ident[ELF::EI_CLASS]) {
case ELF::ELFCLASS32:
switch (EF.getHeader().e_machine) {