summaryrefslogtreecommitdiff
path: root/gcc/tree-emutls.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-emutls.c')
-rw-r--r--gcc/tree-emutls.c52
1 files changed, 35 insertions, 17 deletions
diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c
index 6329fdd5015..ed8edc3569c 100644
--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -811,22 +811,40 @@ gate_emutls (void)
return !targetm.have_tls;
}
-struct simple_ipa_opt_pass pass_ipa_lower_emutls =
+namespace {
+
+const pass_data pass_data_ipa_lower_emutls =
{
- {
- SIMPLE_IPA_PASS,
- "emutls", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- gate_emutls, /* gate */
- ipa_lower_emutls, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_IPA_OPT, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- }
+ SIMPLE_IPA_PASS, /* type */
+ "emutls", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_IPA_OPT, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
};
+
+class pass_ipa_lower_emutls : public simple_ipa_opt_pass
+{
+public:
+ pass_ipa_lower_emutls(gcc::context *ctxt)
+ : simple_ipa_opt_pass(pass_data_ipa_lower_emutls, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_emutls (); }
+ unsigned int execute () { return ipa_lower_emutls (); }
+
+}; // class pass_ipa_lower_emutls
+
+} // anon namespace
+
+simple_ipa_opt_pass *
+make_pass_ipa_lower_emutls (gcc::context *ctxt)
+{
+ return new pass_ipa_lower_emutls (ctxt);
+}