Indu Bhagat <indu.bha...@oracle.com> writes:
> Currently, the data type of sanitizer flags is unsigned int, with
> SANITIZE_SHADOW_CALL_STACK (1UL << 31) being highest individual
> enumerator for enum sanitize_code.  Use 'unsigned HOST_WIDE_INT' data
> type to allow for more distinct instrumentation modes be added when
> needed.
>
> FIXME:
> 1. Is using d_ulong_type for build_int_cst in gcc/d/d-attribs.cc, and
>    uint64_type_node in gcc/c-family/c-attribs.cc OK ? To get type
>    associated with unsigned HOST_WIDE_INT ?
>
> gcc/ChangeLog:
>
>         * asan.h (sanitize_flags_p): Use 'unsigned HOST_WIDE_INT'
>       instead of 'unsigned int'.
>         * common.opt: Likewise.
>         * dwarf2asm.cc (dw2_output_indirect_constant_1): Likewise.
>         * opts.cc (find_sanitizer_argument): Likewise.
>         (report_conflicting_sanitizer_options): Likewise.
>         (parse_sanitizer_options): Likewise.
>         (parse_no_sanitize_attribute): Likewise.
>         * opts.h (parse_sanitizer_options): Likewise.
>         (parse_no_sanitize_attribute): Likewise.
>         * tree-cfg.cc (print_no_sanitize_attr_value): Likewise.
>
> gcc/c-family/ChangeLog:
>
>         * c-attribs.cc (add_no_sanitize_value): Likewise.
>         (handle_no_sanitize_attribute): Likewise.
>         (handle_no_sanitize_address_attribute): Likewise.
>         (handle_no_sanitize_thread_attribute): Likewise.
>         (handle_no_address_safety_analysis_attribute): Likewise.
>         * c-common.h (add_no_sanitize_value): Likewise.
>
> gcc/c/ChangeLog:
>
>         * c-parser.cc (c_parser_declaration_or_fndef): Likewise.
>
> gcc/cp/ChangeLog:
>
>         * typeck.cc (get_member_function_from_ptrfunc): Likewise.
>
> gcc/d/ChangeLog:
>
>         * d-attribs.cc (d_handle_no_sanitize_attribute): Likewise.

I don't have any good suggestions here.  But if possible, I think
it would be good to introduce a typedef for the flags, rather than
simply hard-coding HOST_WIDE_INT.  It might be even more forward-looking
to use a bbitmap.

Then we could have target-independent functions to convert the flags
to and from an attribute argument.  I would hope that these attribute
arguments are well enough shielded from the usual frontend type system
that we could use build_nonstandard_integer_type.  But this isn't
really my area.

Thanks,
Richard

Reply via email to