Commit 598f7235 by Martin Sebor Committed by Jeff Law

gimple-fold.c (strlen_range_kind): New enum.

	* gimple-fold.c (strlen_range_kind): New enum.
	(get_range_strlen): Update signature to use strlen_range_kind
	instead of type+fuzzy.
	(get_range_strlen_tree): Update signature to use
	strlen_range_kind instead of type+fuzzy.  Pass rkind down to
	get_range_strlen.  Check the rkind enum value instead of
	type+fuzzy.
	(get_range_strlen): Similarly.
	(get_maxval_strlen): Update signature to make NONSTR argument have
	a default value and make static.  Add asserts to ensure sanity of
	arguments.  Update calls to get_range_strlen.
	(gimple_fold_builtin_strcpy): Update calls to get_maxval_strlen.
	(gimple_fold_builtin_strcat, gimple_fold_builtin_fputs): Similarly.
	(gimple_fold_builtin_memory_chk): Similarly.
	(gimple_fold_builtin_stxcpy_chk): Similarly.
	(gimple_fold_builtin_snprintf_chk): Similarly.
	(gimple_fold_builtin_sprintf, gimple_fold_builtin_snprintf): Similarly.
	* gimple-fold.h (get_maxval_strlen): Delete prototype.

Co-Authored-By: Jeff Law <law@redhat.com>

From-SVN: r267482
parent c43459ca
2018-12-30 Martin Sebor <msebor@redhat.com>
Jeff Law <law@redhat.com>
* gimple-fold.c (strlen_range_kind): New enum.
(get_range_strlen): Update signature to use strlen_range_kind
instead of type+fuzzy.
(get_range_strlen_tree): Update signature to use
strlen_range_kind instead of type+fuzzy. Pass rkind down to
get_range_strlen. Check the rkind enum value instead of
type+fuzzy.
(get_range_strlen): Similarly.
(get_maxval_strlen): Update signature to make NONSTR argument have
a default value and make static. Add asserts to ensure sanity of
arguments. Update calls to get_range_strlen.
(gimple_fold_builtin_strcpy): Update calls to get_maxval_strlen.
(gimple_fold_builtin_strcat, gimple_fold_builtin_fputs): Similarly.
(gimple_fold_builtin_memory_chk): Similarly.
(gimple_fold_builtin_stxcpy_chk): Similarly.
(gimple_fold_builtin_snprintf_chk): Similarly.
(gimple_fold_builtin_sprintf, gimple_fold_builtin_snprintf): Similarly.
* gimple-fold.h (get_maxval_strlen): Delete prototype.
2018-12-29 Jozef Lawrynowicz <jozef.l@mittosystems.com> 2018-12-29 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config/msp430/msp430.c (msp430_attr): Warn when the critical and * config/msp430/msp430.c (msp430_attr): Warn when the critical and
...@@ -27,7 +27,6 @@ extern tree canonicalize_constructor_val (tree, tree); ...@@ -27,7 +27,6 @@ extern tree canonicalize_constructor_val (tree, tree);
extern tree get_symbol_constant_value (tree); extern tree get_symbol_constant_value (tree);
extern bool get_range_strlen (tree, tree[2], unsigned = 1, extern bool get_range_strlen (tree, tree[2], unsigned = 1,
bool = false, tree * = NULL); bool = false, tree * = NULL);
extern tree get_maxval_strlen (tree, int, tree * = NULL);
extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree); extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
extern bool fold_stmt (gimple_stmt_iterator *); extern bool fold_stmt (gimple_stmt_iterator *);
extern bool fold_stmt (gimple_stmt_iterator *, tree (*) (tree)); extern bool fold_stmt (gimple_stmt_iterator *, tree (*) (tree));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment