Add new/delete to struct occurence
authorJonathan Wakely <jwakely@redhat.com>
Fri, 22 May 2020 06:22:50 +0000 (07:22 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 5 Jun 2020 07:16:41 +0000 (09:16 +0200)
commit6ea6c4978111d146db8d33c80d9da93d7bd2bc8d
treea548cf85aba746bcf124a908512a8ff704e4fe00
parent80d6f89e78fc3b772701988cc73aa8e8006283be
Add new/delete to struct occurence

This adds an example how to use new/delete operators to pool
allocated objects.

2020-06-04  Jonathan Wakely  <jwakely@redhat.com>

* alloc-pool.h (object_allocator::remove_raw): New.
* tree-ssa-math-opts.c (struct occurrence): Use NSMDI.
(occurrence::occurrence): Add.
(occurrence::~occurrence): Likewise.
(occurrence::new): Likewise.
(occurrence::delete): Likewise.
(occ_new): Remove.
(insert_bb): Use new occurence (...) instead of occ_new.
(register_division_in): Likewise.
(free_bb): Use delete occ instead of manually removing
from the pool.
gcc/alloc-pool.h
gcc/tree-ssa-math-opts.c