+namespace {
+
+const pass_data pass_data_local_pure_const =
+{
+ GIMPLE_PASS, /* type */
+ "local-pure-const", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ TV_IPA_PURE_CONST, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+};
+
+class pass_local_pure_const : public gimple_opt_pass
+{
+public:
+ pass_local_pure_const (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_local_pure_const, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_local_pure_const (m_ctxt); }
+ virtual bool gate (function *) { return gate_pure_const (); }
+ virtual unsigned int execute (function *);
+
+}; // class pass_local_pure_const
+
+unsigned int
+pass_local_pure_const::execute (function *fun)