On 09/28/2011 03:15 PM, Dodji Seketeli wrote:
+set_arg_token (macro_arg *arg, const cpp_token *token, + source_location location, size_t index, + enum macro_arg_token_kind kind, + bool track_macro_exp_p) +{ + const cpp_token **token_ptr; + source_location *loc = NULL; + + token_ptr = + arg_token_ptr_at (arg, index, kind, + track_macro_exp_p ? &loc : NULL);
...
+ if (virt_location) + { + if (kind == MACRO_ARG_TOKEN_NORMAL) + *virt_location = &arg->virt_locs[index]; + else if (kind == MACRO_ARG_TOKEN_EXPANDED) + *virt_location = &arg->expanded_virt_locs[index]; + else if (kind == MACRO_ARG_TOKEN_STRINGIFIED) + *virt_location = + (source_location *) &tokens_ptr[index]->src_loc; + }
If we make this block conditional on arg->virt_locs being set, then we can pass &loc in unconditionally and don't need the track_macro_exp_p flag to set_arg_token.
Note that the gotos were put there also because we needed to get out of the for (;;) loop, similarly to what the previous return statements were doing; so by doing this doesn't we don't do get rid of the gotos.
Can't you use break instead? Jason