Skip to content

Conversation

@sivan-shani
Copy link
Contributor

Adding an existing AArch64 Build Attributes value is legal. Asserting this case is wrong, it cause wrong behavior when assertions are enabled.

Adding an existing AArch64 Build Attributes value is legal.
Asserting this case is wrong, it cause wrong behavior when assertions are enabled.
@llvmbot
Copy link
Member

llvmbot commented Feb 13, 2025

@llvm/pr-subscribers-backend-aarch64

Author: SivanShani-Arm (sivan-shani)

Changes

Adding an existing AArch64 Build Attributes value is legal. Asserting this case is wrong, it cause wrong behavior when assertions are enabled.


Full diff: https://github.com/llvm/llvm-project/pull/127097.diff

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp (+2-6)
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
index 1ed4a81a97673..cdad5c7de7853 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
@@ -222,13 +222,9 @@ void AArch64TargetStreamer::emitAttribute(StringRef VendorName, unsigned Tag,
                      "Can not add AArch64 build attribute: An attribute with "
                      "the same tag and a different value already exists");
               return;
-            } else {
-              // Case Item.IntValue == Value, no need to emit twice
-              assert(0 &&
-                     "AArch64 build attribute: An attribute with the same tag "
-                     "and a same value already exists");
-              return;
             }
+            // Case (Item.IntValue == Value) is legal.
+            return;
           }
         }
       }

@sivan-shani sivan-shani deleted the NoAssertTagValueExists branch March 10, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants