diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp --- a/lld/COFF/Chunks.cpp +++ b/lld/COFF/Chunks.cpp @@ -12,14 +12,15 @@ #include "SymbolTable.h" #include "Symbols.h" #include "Writer.h" -#include "llvm/ADT/Twine.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/COFF.h" #include "llvm/Object/COFF.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Endian.h" #include "llvm/Support/raw_ostream.h" #include +#include using namespace llvm; using namespace llvm::object; @@ -947,7 +948,7 @@ void MergeChunk::addSection(COFFLinkerContext &ctx, SectionChunk *c) { assert(isPowerOf2_32(c->getAlignment())); uint8_t p2Align = llvm::Log2_32(c->getAlignment()); - assert(p2Align < array_lengthof(ctx.mergeChunkInstances)); + assert(p2Align < std::size(ctx.mergeChunkInstances)); auto *&mc = ctx.mergeChunkInstances[p2Align]; if (!mc) mc = make(c->getAlignment());