From 2ff5ffb623e17b6bb81532394cb1f42fe7b354c8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 27 Nov 2018 13:30:59 +0100 Subject: Come up with memop_ret enum instead of int endp for memory operations. 2018-11-27 Martin Liska * asan.c (asan_emit_stack_protection): Use new enum values instead of int constants. * builtins.c (expand_builtin_memory_copy_args): Replace int type with memop_ret enum type. (expand_builtin_mempcpy_args): Likewise. (expand_builtin_memcpy): Use new enum values instead of int constants. Likewise. (expand_builtin_mempcpy): Likewise. (expand_movstr): Likewise. (expand_builtin_strcpy_args): Likewise. (expand_builtin_stpcpy_1): Likewise. (expand_builtin_strncpy): Likewise. (expand_builtin_memset_args): Likewise. * expr.c (move_by_pieces_d::finish_endp): Rename to ... (move_by_pieces_d::finish_retmode): ... this. (move_by_pieces): Change last argument type to memop_ret. (store_by_pieces): Use new enum values instead of int constants. (emit_block_move_hints): Likewise. (emit_push_insn): Likewise. (store_expr): Likewise. * expr.h (store_by_pieces): Change int to newly added enum type. * rtl.h (enum memop_ret): Define. (move_by_pieces): Use the enum type. From-SVN: r266508 --- gcc/rtl.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'gcc/rtl.h') diff --git a/gcc/rtl.h b/gcc/rtl.h index dd3ce06..c2aaa9e 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -4046,9 +4046,24 @@ extern void expand_null_return (void); extern void expand_naked_return (void); extern void emit_jump (rtx); +/* Memory operation built-ins differ by return value. Mapping + of the enum values is following: + - RETURN_BEGIN - return destination, e.g. memcpy + - RETURN_END - return destination + n, e.g. mempcpy + - RETURN_END_MINUS_ONE - return a pointer to the terminating + null byte of the string, e.g. strcpy +*/ + +enum memop_ret +{ + RETURN_BEGIN, + RETURN_END, + RETURN_END_MINUS_ONE +}; + /* In expr.c */ extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT, - unsigned int, int); + unsigned int, memop_ret); extern poly_int64 find_args_size_adjust (rtx_insn *); extern poly_int64 fixup_args_size_notes (rtx_insn *, rtx_insn *, poly_int64); -- cgit v1.1