Message ID | 1481166119-45975-1-git-send-email-dmalcolm@redhat.com |
---|---|
State | New |
Headers | show |
On 12/08/2016 04:01 AM, David Malcolm wrote: > gcc/ChangeLog: > * read-md.c (md_reader::read_name_1): Write out the location of > the start of the name, rather than the end, eliminating > unread_char and read_char calls. For avoidance of doubt, ok to check in the currently approved patches with this change as well. > > - unread_char (c); > - *out_loc = get_current_location (); > - read_char (); Might be worth trying to look for this pattern in other parts of the patch kit to see if it can be replaced. Bernd
diff --git a/gcc/read-md.c b/gcc/read-md.c index e581326..ad61cdd 100644 --- a/gcc/read-md.c +++ b/gcc/read-md.c @@ -461,6 +461,8 @@ md_reader::read_name_1 (struct md_name *name, file_location *out_loc) c = read_skip_spaces (); + *out_loc = get_current_location (); + i = 0; angle_bracket_depth = 0; while (1) @@ -491,10 +493,6 @@ md_reader::read_name_1 (struct md_name *name, file_location *out_loc) c = read_char (); } - unread_char (c); - *out_loc = get_current_location (); - read_char (); - if (i == 0) return false;