gen-pass-instances.awk: Make print command clearer in handle_line
authorTom de Vries <tom@codesourcery.com>
Thu, 12 Nov 2015 07:31:47 +0000 (07:31 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Thu, 12 Nov 2015 07:31:47 +0000 (07:31 +0000)
2015-11-12  Tom de Vries  <tom@codesourcery.com>

* gen-pass-instances.awk (handle_line): Print parentheses and pass_name
explicitly.

From-SVN: r230213

gcc/ChangeLog
gcc/gen-pass-instances.awk

index f2c866f30a60f1666c29ebd056b4a0565000d58b..9ab4c6ac458f7de18b4e65bb6d1de1b8d1b1d52f 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-12  Tom de Vries  <tom@codesourcery.com>
+
+       * gen-pass-instances.awk (handle_line): Print parentheses and pass_name
+       explicitly.
+
 2015-11-12  Tom de Vries  <tom@codesourcery.com>
 
        * gen-pass-instances.awk (handle_line): Add pass_num, prefix and postfix
index 1aced74bab1aa6eb89fa769274f6c46cb00799c0..b10c26a65c43772e4c1f6fdad442cec0321e5f2c 100644 (file)
@@ -54,6 +54,7 @@ function handle_line()
        len_of_call = RLENGTH;
 
        len_of_start = length("NEXT_PASS (");
+       len_of_open = length("(");
        len_of_close = length(")");
 
        # Find pass_name argument
@@ -61,11 +62,13 @@ function handle_line()
        pass_starts_at = where + len_of_start;
        pass_name = substr(line, pass_starts_at, len_of_pass_name);
 
-       # Find prefix (until and including pass_name)
-       prefix = substr(line, 1, pass_starts_at + len_of_pass_name - 1)
+       # Find call expression prefix (until and including called function)
+       prefix_len = pass_starts_at - 1 - len_of_open;
+       prefix = substr(line, 1, prefix_len);
 
-       # Find postfix (after pass_name)
-       postfix = substr(line, pass_starts_at + len_of_pass_name)
+       # Find call expression postfix
+       postfix_starts_at = pass_starts_at + len_of_pass_name + len_of_close;
+       postfix = substr(line, postfix_starts_at);
 
        # Set pass_counts
        if (pass_name in pass_counts)
@@ -76,7 +79,7 @@ function handle_line()
        pass_num = pass_counts[pass_name];
 
        # Print call expression with extra pass_num argument
-       printf "%s, %s%s\n", prefix, pass_num, postfix;
+       printf "%s(%s, %s)%s\n", prefix, pass_name, pass_num, postfix;
 }
 
 { handle_line() }