summaryrefslogtreecommitdiff
path: root/gcc/gen-pass-instances.awk
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-12 07:31:38 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-12 07:31:38 +0000
commit9e83618d27d0f318c28ef30f081c38d605b65a91 (patch)
treebd3c6c5758e815439e04040c040db7a23ab72137 /gcc/gen-pass-instances.awk
parent89e9bb5d3306c7af5693ea3a46a4bbea07251e68 (diff)
downloadgcc-9e83618d27d0f318c28ef30f081c38d605b65a91.tar.gz
gen-pass-instances.awk: Add pass_num, prefix and postfix vars in handle_line
2015-11-12 Tom de Vries <tom@codesourcery.com> * gen-pass-instances.awk (handle_line): Add pass_num, prefix and postfix vars. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230212 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gen-pass-instances.awk')
-rw-r--r--gcc/gen-pass-instances.awk13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/gen-pass-instances.awk b/gcc/gen-pass-instances.awk
index 3d5e8b6817a..1aced74bab1 100644
--- a/gcc/gen-pass-instances.awk
+++ b/gcc/gen-pass-instances.awk
@@ -61,17 +61,22 @@ 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 postfix (after pass_name)
+ postfix = substr(line, pass_starts_at + len_of_pass_name)
+
# Set pass_counts
if (pass_name in pass_counts)
pass_counts[pass_name]++;
else
pass_counts[pass_name] = 1;
+ pass_num = pass_counts[pass_name];
+
# Print call expression with extra pass_num argument
- printf "%s, %s%s\n",
- substr(line, 1, pass_starts_at + len_of_pass_name - 1),
- pass_counts[pass_name],
- substr(line, pass_starts_at + len_of_pass_name);
+ printf "%s, %s%s\n", prefix, pass_num, postfix;
}
{ handle_line() }