aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-11-16 12:40:05 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-11-16 12:40:05 +0000
commitb0c77505ddbc1ebdecb71042e824fa4e36ba59a3 (patch)
tree5829532adf2249c19f045548c3462a452fd512b8 /gcc/passes.c
parent632b09212386db8c68978befb8dc0d2745988b7c (diff)
downloadgcc-b0c77505ddbc1ebdecb71042e824fa4e36ba59a3.zip
gcc-b0c77505ddbc1ebdecb71042e824fa4e36ba59a3.tar.gz
gcc-b0c77505ddbc1ebdecb71042e824fa4e36ba59a3.tar.bz2
Remove first_pass_instance from pass_vrp
2015-11-16 Tom de Vries <tom@codesourcery.com> * gdbhooks.py (class PassNames): Handle extra arg NEXT_PASS argument. * gen-pass-instances.awk (handle_line): Same. * pass_manager.h (class pass_manager): Define and undefine NEXT_PASS_WITH_ARG. * passes.c (opt_pass::set_pass_param): New function. (pass_manager::pass_manager): Define and undefine NEXT_PASS_WITH_ARG. * passes.def: Add extra arg to NEXT_PASS (pass_vrp). * tree-pass.h (gimple_opt::set_pass_param): Declare. * tree-vrp.c (vrp_finalize, execute_vrp): Add and handle warn_array_bounds_p parameter. (pass_vrp::pass_vrp): Initialize warn_array_bounds_p. (pass_vrp::set_pass_param): New function. (pass_vrp::execute): Add warn_array_bounds_p arg to execute_vrp call. (pass_vrp::warn_array_bounds_p): New private member. From-SVN: r230415
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index dd8d00a..e634c5c 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -81,6 +81,13 @@ opt_pass::clone ()
internal_error ("pass %s does not support cloning", name);
}
+void
+opt_pass::set_pass_param (unsigned int, bool)
+{
+ internal_error ("pass %s needs a set_pass_param implementation to handle the"
+ " extra argument in NEXT_PASS", name);
+}
+
bool
opt_pass::gate (function *)
{
@@ -1572,6 +1579,12 @@ pass_manager::pass_manager (context *ctxt)
p = next_pass_1 (p, PASS ## _ ## NUM, PASS ## _1); \
} while (0)
+#define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) \
+ do { \
+ NEXT_PASS (PASS, NUM); \
+ PASS ## _ ## NUM->set_pass_param (0, ARG); \
+ } while (0)
+
#define TERMINATE_PASS_LIST() \
*p = NULL;
@@ -1581,6 +1594,7 @@ pass_manager::pass_manager (context *ctxt)
#undef PUSH_INSERT_PASSES_WITHIN
#undef POP_INSERT_PASSES
#undef NEXT_PASS
+#undef NEXT_PASS_WITH_ARG
#undef TERMINATE_PASS_LIST
/* Register the passes with the tree dump code. */