-DEF_VEC_P (funct_state);
-DEF_VEC_ALLOC_P (funct_state, heap);
-static VEC (funct_state, heap) *funct_state_vec;
+static vec<funct_state> funct_state_vec;
+
+static bool gate_pure_const (void);
+
+namespace {
+
+const pass_data pass_data_ipa_pure_const =
+{
+ IPA_PASS, /* type */
+ "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_ipa_pure_const : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_pure_const(gcc::context *ctxt);
+
+ /* opt_pass methods: */
+ bool gate (function *) { return gate_pure_const (); }
+ unsigned int execute (function *fun);
+
+ void register_hooks (void);
+
+private:
+ bool init_p;
+
+ /* Holders of ipa cgraph hooks: */
+ struct cgraph_node_hook_list *function_insertion_hook_holder;
+ struct cgraph_2node_hook_list *node_duplication_hook_holder;
+ struct cgraph_node_hook_list *node_removal_hook_holder;
+
+}; // class pass_ipa_pure_const