diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-11-12 07:31:13 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-11-12 07:31:13 +0000 |
commit | 0f73e6679b3b9c3b2e21c19e9676d384634e6368 (patch) | |
tree | 86f70006532cdc3b29cef6003e7afe77f85db922 /gcc | |
parent | d2616f3df605bcb301c552bb5ce69798536d8257 (diff) | |
download | gcc-0f73e6679b3b9c3b2e21c19e9676d384634e6368.zip gcc-0f73e6679b3b9c3b2e21c19e9676d384634e6368.tar.gz gcc-0f73e6679b3b9c3b2e21c19e9676d384634e6368.tar.bz2 |
gen-pass-instances.awk: Add len_of_call var in handle_line
2015-11-12 Tom de Vries <tom@codesourcery.com>
* gen-pass-instances.awk (handle_line): Add len_of_call variable.
From-SVN: r230209
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/gen-pass-instances.awk | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ed0f41..535c0cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2015-11-12 Tom de Vries <tom@codesourcery.com> + * gen-pass-instances.awk (handle_line): Add len_of_call variable. + +2015-11-12 Tom de Vries <tom@codesourcery.com> + * gen-pass-instances.awk (handle_line): Restructure using early-out. 2015-11-12 Tom de Vries <tom@codesourcery.com> diff --git a/gcc/gen-pass-instances.awk b/gcc/gen-pass-instances.awk index 27e7a98..70b00b7 100644 --- a/gcc/gen-pass-instances.awk +++ b/gcc/gen-pass-instances.awk @@ -42,6 +42,7 @@ function handle_line() { line = $0; + # Find call expression. where = match(line, /NEXT_PASS \((.+)\)/); if (where == 0) { @@ -49,9 +50,12 @@ function handle_line() return; } + # Length of the call expression. + len_of_call = RLENGTH; + len_of_start = length("NEXT_PASS ("); len_of_end = length(")"); - len_of_pass_name = RLENGTH - (len_of_start + len_of_end); + len_of_pass_name = len_of_call - (len_of_start + len_of_end); pass_starts_at = where + len_of_start; pass_name = substr(line, pass_starts_at, len_of_pass_name); if (pass_name in pass_counts) |