On 09/18/2017 12:26 PM, Steve Ellcey wrote:
This patch is for PR target/79868, where some aarch64 diagnostics are
said to be not translatable due to how they are implemented.  See the
bug report for more details on why the current setup of passing
the string 'pragma' or 'attribute' doesn't work.

This patch fixes it, unfortunately by increasing the number of calls we
have to 'error' (16 calls become 32 calls), but that seems to be the
most straight forward way to get translatable strings.

I haven't looked at all of them but from the few I have seen it
seems that rephrasing the messages along the following lines would
be a way to get around the translation issue and without increasing
the number of calls (though not without the conditional):

  error (is_pragma
         ? G_("missing name in %<#pragma target\(\"%s=\")%>")
         : G_("missing name in %<target(\"%s=\")%> attribute"),
         "arch");

The additional benefit of this approach is that it would also make
the quoting consistent with what seems to be the prevailing style
of these sorts of messages.  (It would be nice to eventually
converge on the same style/quoting and phrasing across all back
and front ends.)

Martin


This patch is an update to the one I originally attached to the bug
report and I have fixed the issue that Frederic Marchal found in my
original patch.

OK to checkin?

Steve Ellcey
sell...@cavium.com



2017-09-18  Steve Ellcey  <sell...@cavium.com>

        PR target/79868
        * config/aarch64/aarch64-c.c (aarch64_pragma_target_parse):
        Change argument type on aarch64_process_target_attr call.
        * config/aarch64/aarch64-protos.h (aarch64_process_target_attr):
        Change argument type.
        * config/aarch64/aarch64.c (aarch64_attribute_info): Change
        field type.
        (aarch64_handle_attr_arch): Change argument type, use boolean
        argument to make different error calls.
        (aarch64_handle_attr_cpu): Ditto.
        (aarch64_handle_attr_tune): Ditto.
        (aarch64_handle_attr_isa_flags): Ditto.
        (aarch64_process_one_target_attr): Ditto.
        (aarch64_process_target_attr): Ditto.
        (aarch64_option_valid_attribute_p): Change argument type on
        aarch64_process_target_attr call.



Reply via email to