From 0f73e6679b3b9c3b2e21c19e9676d384634e6368 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 12 Nov 2015 07:31:13 +0000 Subject: [PATCH] gen-pass-instances.awk: Add len_of_call var in handle_line 2015-11-12 Tom de Vries * gen-pass-instances.awk (handle_line): Add len_of_call variable. From-SVN: r230209 --- gcc/ChangeLog | 4 ++++ gcc/gen-pass-instances.awk | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ed0f411c0b..535c0cfcf0a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-11-12 Tom de Vries + + * gen-pass-instances.awk (handle_line): Add len_of_call variable. + 2015-11-12 Tom de Vries * gen-pass-instances.awk (handle_line): Restructure using early-out. diff --git a/gcc/gen-pass-instances.awk b/gcc/gen-pass-instances.awk index 27e7a98a8d5..70b00b7655d 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) -- 2.30.2