]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix comment/naming in attribute parsing code
authorChristoph Müllner <christoph.muellner@vrull.eu>
Fri, 5 Jul 2024 02:58:07 +0000 (04:58 +0200)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Tue, 9 Jul 2024 13:21:15 +0000 (15:21 +0200)
Function target attributes have to be separated by semi-colons.
Let's fix the comment and variable naming to better explain what
the code does.

gcc/ChangeLog:

* config/riscv/riscv-target-attr.cc (riscv_process_target_attr):
Fix comments and variable names.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/config/riscv/riscv-target-attr.cc

index 19eb7b06d5481376e2a614b60c079f275218ec74..0bbe7df25d190eb5f3a5c9bf9dd95ed14292ebd0 100644 (file)
@@ -338,11 +338,11 @@ riscv_process_target_attr (tree fndecl, tree args, location_t loc,
   char *str_to_check = buf.get ();
   strcpy (str_to_check, TREE_STRING_POINTER (args));
 
-  /* Used to catch empty spaces between commas i.e.
+  /* Used to catch empty spaces between semi-colons i.e.
      attribute ((target ("attr1;;attr2"))).  */
-  unsigned int num_commas = num_occurences_in_str (';', str_to_check);
+  unsigned int num_semicolons = num_occurences_in_str (';', str_to_check);
 
-  /* Handle multiple target attributes separated by ','.  */
+  /* Handle multiple target attributes separated by ';'.  */
   char *token = strtok_r (str_to_check, ";", &str_to_check);
 
   riscv_target_attr_parser attr_parser (loc);
@@ -354,7 +354,7 @@ riscv_process_target_attr (tree fndecl, tree args, location_t loc,
       token = strtok_r (NULL, ";", &str_to_check);
     }
 
-  if (num_attrs != num_commas + 1)
+  if (num_attrs != num_semicolons + 1)
     {
       error_at (loc, "malformed %<target(\"%s\")%> attribute",
                TREE_STRING_POINTER (args));