aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristoph Müllner <christoph.muellner@vrull.eu>2024-07-05 04:58:07 +0200
committerChristoph Müllner <christoph.muellner@vrull.eu>2024-07-09 15:21:15 +0200
commit5ef0b7d2048a7142174ee3e8e021fc1a9c3e3334 (patch)
treef48c37e3cbace7312002c39f9691c7f9ab52b679 /gcc
parent85fa334fbcaa8e4b98ab197a8c9410dde87f0ae3 (diff)
downloadgcc-5ef0b7d2048a7142174ee3e8e021fc1a9c3e3334.zip
gcc-5ef0b7d2048a7142174ee3e8e021fc1a9c3e3334.tar.gz
gcc-5ef0b7d2048a7142174ee3e8e021fc1a9c3e3334.tar.bz2
RISC-V: Fix comment/naming in attribute parsing code
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/riscv/riscv-target-attr.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/config/riscv/riscv-target-attr.cc b/gcc/config/riscv/riscv-target-attr.cc
index 19eb7b0..0bbe7df 100644
--- a/gcc/config/riscv/riscv-target-attr.cc
+++ b/gcc/config/riscv/riscv-target-attr.cc
@@ -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));