mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
Use llvm::count{lr}_{zero,one} (NFC)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user