summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-uninit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-uninit.c')
-rw-r--r--gcc/tree-ssa-uninit.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c
index 9a726f115a9..6d2d768a243 100644
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -2046,22 +2046,41 @@ gate_warn_uninitialized (void)
return warn_uninitialized != 0;
}
-struct gimple_opt_pass pass_late_warn_uninitialized =
+namespace {
+
+const pass_data pass_data_late_warn_uninitialized =
{
- {
- GIMPLE_PASS,
- "uninit", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_warn_uninitialized, /* gate */
- execute_late_warn_uninitialized, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_NONE, /* tv_id */
- PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
- }
+ GIMPLE_PASS, /* type */
+ "uninit", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_late_warn_uninitialized : public gimple_opt_pass
+{
+public:
+ pass_late_warn_uninitialized(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_late_warn_uninitialized, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_late_warn_uninitialized (ctxt_); }
+ bool gate () { return gate_warn_uninitialized (); }
+ unsigned int execute () { return execute_late_warn_uninitialized (); }
+
+}; // class pass_late_warn_uninitialized
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_late_warn_uninitialized (gcc::context *ctxt)
+{
+ return new pass_late_warn_uninitialized (ctxt);
+}