[llvm] 67c89d9 - [MC] Remove unreachable .comm/.lcomm diagnostic

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 00:11:02 PST 2022


Author: Fangrui Song
Date: 2022-01-27T00:10:57-08:00
New Revision: 67c89d9a3cb4b2a22dd8d55b83b5a8c8e1fb7f98

URL: https://github.com/llvm/llvm-project/commit/67c89d9a3cb4b2a22dd8d55b83b5a8c8e1fb7f98
DIFF: https://github.com/llvm/llvm-project/commit/67c89d9a3cb4b2a22dd8d55b83b5a8c8e1fb7f98.diff

LOG: [MC] Remove unreachable .comm/.lcomm diagnostic

and make another diagnostic math the prevailing format.

Added: 
    

Modified: 
    llvm/lib/MC/MCParser/AsmParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 5c94174aa161f..15b675fc05666 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -5047,15 +5047,7 @@ bool AsmParser::parseDirectiveComm(bool IsLocal) {
   // 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.
   if (Size < 0)
-    return Error(SizeLoc, "invalid '.comm' or '.lcomm' directive size, can't "
-                          "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");
+    return Error(SizeLoc, "size must be non-negative");
 
   Sym->redefineIfPossible();
   if (!Sym->isUndefined())


        


More information about the llvm-commits mailing list