Use llvm::count{lr}_{zero,one} (NFC)

This commit is contained in:
Kazu Hirata
2023-01-28 12:41:19 -08:00
parent a536d3e40e
commit 55e2cd1609
51 changed files with 92 additions and 97 deletions

View File

@@ -1317,7 +1317,7 @@ static uint64_t getAlignment(ArrayRef<typename ELFT::Shdr> sections,
const typename ELFT::Sym &sym) {
uint64_t ret = UINT64_MAX;
if (sym.st_value)
ret = 1ULL << countTrailingZeros((uint64_t)sym.st_value);
ret = 1ULL << llvm::countr_zero((uint64_t)sym.st_value);
if (0 < sym.st_shndx && sym.st_shndx < sections.size())
ret = std::min<uint64_t>(ret, sections[sym.st_shndx].sh_addralign);
return (ret > UINT32_MAX) ? 0 : ret;