[MC] Remove unreachable .comm/.lcomm diagnostic

and make another diagnostic math the prevailing format.
This commit is contained in:
Fangrui Song 2022-01-27 00:10:57 -08:00
parent 6a4d3f37b5
commit 67c89d9a3c
1 changed files with 1 additions and 9 deletions

View File

@ -5047,15 +5047,7 @@ bool AsmParser::parseDirectiveComm(bool IsLocal) {
// NOTE: a size of zero for a .comm should create a undefined symbol // NOTE: a size of zero for a .comm should create a undefined symbol
// but a size of .lcomm creates a bss symbol of size zero. // but a size of .lcomm creates a bss symbol of size zero.
if (Size < 0) if (Size < 0)
return Error(SizeLoc, "invalid '.comm' or '.lcomm' directive size, can't " return Error(SizeLoc, "size must be non-negative");
"be less than zero");
// NOTE: The alignment in the directive is a power of 2 value, the assembler
// may internally end up wanting an alignment in bytes.
// FIXME: Diagnose overflow.
if (Pow2Alignment < 0)
return Error(Pow2AlignmentLoc, "invalid '.comm' or '.lcomm' directive "
"alignment, can't be less than zero");
Sym->redefineIfPossible(); Sym->redefineIfPossible();
if (!Sym->isUndefined()) if (!Sym->isUndefined())