This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 6/6] Migrate ipa-pure-const to function_summary.


On 07/09/2015 03:13 AM, mliska wrote:
gcc/ChangeLog:

2015-07-03  Martin Liska  <mliska@suse.cz>

	* ipa-pure-const.c (struct funct_state_d): New.
	(funct_state_d::default_p): Likewise.
	(has_function_state): Remove.
	(get_function_state): Likewise.
	(set_function_state): Likewise.
	(add_new_function): Rename and port to ::insert.
	(duplicate_node_data): Rename and port to ::duplicate.
	(funct_state_summary_t::duplicate): New function.
	(register_hooks): Remove hook registration.
	(pure_const_generate_summary): Use new data structure.
	(pure_const_write_summary): Likewise.
	(pure_const_read_summary): Likewise.
	(propagate_pure_const): Likewise.
	(propagate_nothrow): Likewise.
	(execute): Remove hook usage.
	(pass_ipa_pure_const::pass_ipa_pure_const): Likewise.
---
@@ -84,6 +85,18 @@ const char *pure_const_names[3] = {"const", "pure", "neither"};
     decl.  */
  struct funct_state_d
  {
+  funct_state_d (): pure_const_state (IPA_NEITHER),
+    state_previously_known (IPA_NEITHER), looping_previously_known (true),
+    looping (true), can_throw (true), can_free (true) {}
+
+  funct_state_d (const funct_state_d &s): pure_const_state (s.pure_const_state),
+    state_previously_known (s.state_previously_known),
+    looping_previously_known (s.looping_previously_known),
+    looping (s.looping), can_throw (s.can_throw), can_free (s.can_free) {}
+
+  /* Return true if the value is default.  */
+  bool default_p ();
+
    /* See above.  */
    enum pure_const_state_e pure_const_state;
    /* What user set here; we can be always sure about this.  */
Doesn't this need to be a "class" rather then a "struct"?


OK with that change.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]