]> gcc.gnu.org Git - gcc.git/commit
RAII auto_mpfr and autp_mpz
authorRichard Biener <rguenther@suse.de>
Mon, 6 Mar 2023 10:06:38 +0000 (11:06 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 18 Apr 2023 13:39:48 +0000 (15:39 +0200)
commit278f8f567b5470e87e2e6482ee385d61c7f45a5d
treea32b2d5b79e0d7272e927e650db3d1d56f6490f5
parent8b271f6069da6eee4afdbfcac72888a4551191f9
RAII auto_mpfr and autp_mpz

The following adds two RAII classes, one for mpz_t and one for mpfr_t
making object lifetime management easier.  Both formerly require
explicit initialization with {mpz,mpfr}_init and release with
{mpz,mpfr}_clear.

I've converted two example places (where lifetime is trivial).

* system.h (class auto_mpz): New,
* realmpfr.h (class auto_mpfr): Likewise.
* fold-const-call.cc (do_mpfr_arg1): Use auto_mpfr.
(do_mpfr_arg2): Likewise.
* tree-ssa-loop-niter.cc (bound_difference): Use auto_mpz;
gcc/fold-const-call.cc
gcc/realmpfr.h
gcc/system.h
gcc/tree-ssa-loop-niter.cc
This page took 0.065679 seconds and 5 git commands to generate.