diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-05-14 11:04:43 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-05-14 14:46:22 +0200 |
commit | 2b7d6678eed25ade1351c12fe5919dd7120f37b2 (patch) | |
tree | 7fc39904aa01b07082ad1825c1f8769152655ccb | |
parent | ac7e59f92eabb7c200e84e5a6947ac139810d8c0 (diff) |
Adds fuzz mode
-rw-r--r-- | gcc/ipa-escape-analysis.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ipa-escape-analysis.c b/gcc/ipa-escape-analysis.c index 5b0e878fb2c..ba0ae26c88e 100644 --- a/gcc/ipa-escape-analysis.c +++ b/gcc/ipa-escape-analysis.c @@ -36,6 +36,8 @@ #include "collect-types.h" #include "name-types.h" +#define FUZZ_MODE 0 + namespace type_playground { enum type_comparison_func_enum { EQ_POINTER = 0, @@ -177,6 +179,9 @@ collect_types_from_constructor_array(const_tree expr, typeset &types) const_tree type = TREE_TYPE(expr); assert_is_type(type, ARRAY_TYPE); //TODO: Collect types from here +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif } static void @@ -191,6 +196,9 @@ collect_types_from_constructor_record_or_union(const_tree expr, typeset &types) const bool is_valid_input = is_record || is_union || is_qual_union; gcc_assert(is_valid_input); //TODO: Collect types from here +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif } static void @@ -222,6 +230,9 @@ collect_types_from_constructor(const_tree expr, typeset &types) break; default: // TODO: I should fuzz this, I got a constructor of an integer type? +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif return; break; } @@ -252,6 +263,9 @@ static void collect_types_from_bit_field_ref(const_tree expr, typeset &types) { // TODO: How to collect types from bit_field_ref? +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif } static void @@ -264,6 +278,9 @@ collect_types_from_view_convert_expr(const_tree expr, typeset &types) // through an integer mode and an intermediate BIT_FIELD_REF. // https://gcc.gnu.org/wiki/MemRef //TODO: How to collect types from VIEW_CONVERT_EXPR? +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif } static void @@ -475,7 +492,7 @@ collect_types_from_stmt_return(gimple *stmt, typeset &types) is_gimple_code(stmt, GIMPLE_RETURN); const_tree retval = gimple_return_retval(stmt); gcc_assert(retval); - collect_types_from_expr(retval); + collect_types_from_expr(retval, types); } static void @@ -498,6 +515,9 @@ collect_types_from_stmt(gimple *stmt, typeset &types) break; case GIMPLE_LABEL: case GIMPLE_PREDICT: +#ifdef FUZZ_MODE + gcc_unreachable(); +#endif break; default: { @@ -733,7 +753,6 @@ iphw_execute() // We still need to collect types from // the function signatures of functions without gimple bodies... - filter_out_types_in_set(types); compare_types_in_set(types); return 0; |