[llvm] [AArch64][Build Attributes] Improve Parsing and Formatting (PR #126530)

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 02:59:39 PST 2025


================
@@ -7986,14 +7987,22 @@ bool AArch64AsmParser::parseDirectiveAeabiAArch64Attr(SMLoc L) {
 
   StringRef TagStr = "";
   unsigned Tag;
-  if (Parser.getTok().is(AsmToken::Identifier)) {
+  if (Parser.getTok().is(AsmToken::Integer)) {
+    Tag = getTok().getIntVal();
+  } else if (Parser.getTok().is(AsmToken::Identifier)) {
     TagStr = Parser.getTok().getIdentifier();
     switch (ActiveSubsectionID) {
     default:
+      // Should not happen
----------------
ostannard wrote:

This comment isn't adding anything useful. It would actually be better to remove the default case, since we expect this enum to be fully covered: https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

https://github.com/llvm/llvm-project/pull/126530


More information about the llvm-commits mailing list