* ipa-modref-tree.c: Add namespace selftest.
(modref_tree_c_tests): Rename to ...
(ipa_modref_tree_c_tests): ... this.
* ipa-modref.c (pass_modref): Remove destructor.
(ipa_modref_c_finalize): New function.
* ipa-modref.h (ipa_modref_c_finalize): Declare.
* selftest-run-tests.c (selftest::run_tests): Call
ipa_modref_c_finalize.
* selftest.h (ipa_modref_tree_c_tests): Declare.
* toplev.c: Include ipa-modref-tree.h and ipa-modref.h
(toplev::finalize): Call ipa_modref_c_finalize.
#if CHECKING_P
+namespace selftest {
static void
test_insert_search_collapse ()
void
-modref_tree_c_tests ()
+ipa_modref_tree_c_tests ()
{
test_insert_search_collapse ();
test_merge ();
}
+} // namespace selftest
+
#endif
void
pass_modref (gcc::context *ctxt)
: gimple_opt_pass (pass_data_modref, ctxt) {}
- ~pass_modref ()
- {
- ggc_delete (summaries);
- summaries = NULL;
- }
-
/* opt_pass methods: */
opt_pass *clone ()
{
return 0;
}
+/* Summaries must stay alive until end of compilation. */
+
+void
+ipa_modref_c_finalize ()
+{
+ if (summaries)
+ ggc_delete (summaries);
+ summaries = NULL;
+}
+
#include "gt-ipa-modref.h"
};
modref_summary *get_modref_function_summary (cgraph_node *func);
+void ipa_modref_c_finalize ();
#endif
read_rtl_function_c_tests ();
digraph_cc_tests ();
tristate_cc_tests ();
+ ipa_modref_tree_c_tests ();
/* Higher-level tests, or for components that other selftests don't
rely on. */
extern void wide_int_cc_tests ();
extern void opt_proposer_c_tests ();
extern void dbgcnt_c_tests ();
+extern void ipa_modref_tree_c_tests ();
extern int num_passes;
#include "dump-context.h"
#include "print-tree.h"
#include "optinfo-emit-json.h"
+#include "ipa-modref-tree.h"
+#include "ipa-modref.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
/* Needs to be called before cgraph_c_finalize since it uses symtab. */
ipa_reference_c_finalize ();
ipa_fnsummary_c_finalize ();
+ ipa_modref_c_finalize ();
cgraph_c_finalize ();
cgraphunit_c_finalize ();