[PATCH 3/7] Emit macro expansion related diagnostics

Jason Merrill jason@redhat.com
Fri Sep 30 21:04:00 GMT 2011


On 09/30/2011 11:28 AM, Jason Merrill wrote:
> +linemap_location_before_p (struct line_maps *set,
> +                          source_location  pre,
> +                          source_location post)
> +{
> +  bool pre_from_macro_p, post_from_macro_p;
> +
> +  if (pre == post)
> +    return false;
> +
> +  pre_from_macro_p =
> +    linemap_location_from_macro_expansion_p (set, pre);
> +  post_from_macro_p =
> +    linemap_location_from_macro_expansion_p (set, post);
> +
> +  if (pre_from_macro_p != post_from_macro_p)
> +    {
> +      if (pre_from_macro_p)
> +       pre = linemap_macro_loc_to_exp_point (set, pre, NULL);
> +      else
> +       post = linemap_macro_loc_to_exp_point (set, post, NULL);
> +    }

What if the two locations are from different macros?

Jason



More information about the Gcc-patches mailing list