Commit 6a389ed5 by David Malcolm Committed by David Malcolm

Zero-initialize pass_manager

gcc/

	* passes.c (pass_manager::operator new): New.

From-SVN: r201506
parent f7695dbf
2013-08-05 David Malcolm <dmalcolm@redhat.com> 2013-08-05 David Malcolm <dmalcolm@redhat.com>
* passes.c (pass_manager::operator new): New.
2013-08-05 David Malcolm <dmalcolm@redhat.com>
Handwritten part of conversion of passes to C++ classes. Handwritten part of conversion of passes to C++ classes.
* Makefile.in (PASS_MANAGER_H): Add dep on pass-instances.def. * Makefile.in (PASS_MANAGER_H): Add dep on pass-instances.def.
......
...@@ -47,6 +47,8 @@ class context; ...@@ -47,6 +47,8 @@ class context;
class pass_manager class pass_manager
{ {
public: public:
void *operator new (size_t sz);
pass_manager(context *ctxt); pass_manager(context *ctxt);
void register_pass (struct register_pass_info *pass_info); void register_pass (struct register_pass_info *pass_info);
......
...@@ -1339,6 +1339,13 @@ pass_manager::register_pass (struct register_pass_info *pass_info) ...@@ -1339,6 +1339,13 @@ pass_manager::register_pass (struct register_pass_info *pass_info)
-> all_passes -> all_passes
*/ */
void *
pass_manager::operator new (size_t sz)
{
/* Ensure that all fields of the pass manager are zero-initialized. */
return xcalloc (1, sz);
}
pass_manager::pass_manager (context *ctxt) pass_manager::pass_manager (context *ctxt)
: all_passes(NULL), all_small_ipa_passes(NULL), all_lowering_passes(NULL), : all_passes(NULL), all_small_ipa_passes(NULL), all_lowering_passes(NULL),
all_regular_ipa_passes(NULL), all_lto_gen_passes(NULL), all_regular_ipa_passes(NULL), all_lto_gen_passes(NULL),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment