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

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

        * ipa-reference.c (ipa_ref_opt_summary_t): New class.
        (get_reference_optimization_summary): Use it.
        (set_reference_optimization_summary): Likewise.
        (ipa_init): Remove hook holders usage.
        (ipa_reference_c_finalize): Likewise.
        (ipa_ref_opt_summary_t::duplicate): New function.
        (ipa_ref_opt_summary_t::remove): Likewise.
        (propagate): Allocate the summary if does not exist.
        (ipa_reference_read_optimization_summary): Likewise.
        (struct ipa_reference_vars_info_d): Add new method.
        (struct ipa_reference_optimization_summary_d): Likewise.
        (get_reference_vars_info): Use new underlying container.
        (set_reference_vars_info): Remove.
        (init_function_info): Set up the container.

@@ -89,6 +84,13 @@ struct ipa_reference_global_vars_info_d

  struct ipa_reference_optimization_summary_d
  {
+  /* Return true if the data structure is empty.  */
+  inline bool
+  empty_p ()
+  {
+    return statics_not_read == NULL && statics_not_written == NULL;
+  }
+
Presumably this is still POD, even with the inline function, so "struct" is still correct, right?



@@ -99,6 +101,14 @@ typedef struct ipa_reference_optimization_summary_d 
*ipa_reference_optimization_

  struct ipa_reference_vars_info_d
  {
+  /* Return true if the data structure is empty.  */
+  inline bool
+  empty_p ()
+  {
+    return local.statics_read == NULL && local.statics_written == NULL
+      && global.statics_read == NULL && global.statics_written == NULL;
+  }
+
Similarly.

So please confirm those are still POD types. If they are, then the patch is OK as-is. If they're not PODs, then change them to classes and that patch is pre-approved.

jeff

Reply via email to