]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
aarch64: Drop "" from hint option hash table
authorAlice Carlotti <alice.carlotti@arm.com>
Wed, 18 Feb 2026 14:25:58 +0000 (14:25 +0000)
committerAlice Carlotti <alice.carlotti@arm.com>
Fri, 10 Jul 2026 15:09:06 +0000 (16:09 +0100)
An empty string is the only option where the upper and lower case forms
are identical, so this allows the upper case insertion logic to be
simplified as well.

gas/config/tc-aarch64.c

index 6d412651354aa872faa1baebddc54703efe1092a..373b97b15345431d5635fcc99eaac34b91fce150 100644 (file)
@@ -10773,15 +10773,15 @@ md_begin (void)
   for (i = 0; aarch64_hint_options[i].name != NULL; i++)
     {
       const char* name = aarch64_hint_options[i].name;
-      const char* upper_name = get_upper_str(name);
-
+      /* Empty strings represent an absent optional operand, so won't be looked
+        up in the hash table.  */
+      if (*name == '\0')
+       continue;
       checked_hash_insert (aarch64_hint_opt_hsh, name,
                           aarch64_hint_options + i);
-
-      /* Also hash the name in the upper case if not the same.  */
-      if (strcmp (name, upper_name) != 0)
-       checked_hash_insert (aarch64_hint_opt_hsh, upper_name,
-                            aarch64_hint_options + i);
+      /* Also hash the name in the upper case.  */
+      checked_hash_insert (aarch64_hint_opt_hsh, get_upper_str (name),
+                          aarch64_hint_options + i);
     }
 
   for (i = 0; aarch64_sys_ins_gic[i].name != NULL; i++)