diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-11-12 07:31:47 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-11-12 07:31:47 +0000 |
commit | 61fb1f74fe6402b72c227181833337acc131f205 (patch) | |
tree | b477e8f7604b4abe2ada41fe4a9f6af9f5e801fe /gcc | |
parent | 504943f42f62f346f09a85e1f8cfaaf1eb734df9 (diff) | |
download | gcc-61fb1f74fe6402b72c227181833337acc131f205.zip gcc-61fb1f74fe6402b72c227181833337acc131f205.tar.gz gcc-61fb1f74fe6402b72c227181833337acc131f205.tar.bz2 |
gen-pass-instances.awk: Make print command clearer in handle_line
2015-11-12 Tom de Vries <tom@codesourcery.com>
* gen-pass-instances.awk (handle_line): Print parentheses and pass_name
explicitly.
From-SVN: r230213
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gen-pass-instances.awk | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2c866f..9ab4c6a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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 vars. diff --git a/gcc/gen-pass-instances.awk b/gcc/gen-pass-instances.awk index 1aced74..b10c26a 100644 --- a/gcc/gen-pass-instances.awk +++ b/gcc/gen-pass-instances.awk @@ -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() } |