Commit 2f195832 by Ian Lance Taylor

compiler: cleanups permitted by GCC requirement of MPFR 3.1.0

For MPFR functions, change from GMP_RND* to MPFR_RND*.
Also change mp_exp_t to mpfr_expt_t.

Fixes PR go/92463

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/216417
parent 8f25c39c
197381c6364431a7a05e32df683874b7cadcc4b4 132e0e61d59aaa52f8fdb03a925300c1ced2a0f2
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -198,7 +198,7 @@ Token::Token(const Token& tok) ...@@ -198,7 +198,7 @@ Token::Token(const Token& tok)
break; break;
case TOKEN_FLOAT: case TOKEN_FLOAT:
case TOKEN_IMAGINARY: case TOKEN_IMAGINARY:
mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN); mpfr_init_set(this->u_.float_value, tok.u_.float_value, MPFR_RNDN);
break; break;
default: default:
go_unreachable(); go_unreachable();
...@@ -238,7 +238,7 @@ Token::operator=(const Token& tok) ...@@ -238,7 +238,7 @@ Token::operator=(const Token& tok)
break; break;
case TOKEN_FLOAT: case TOKEN_FLOAT:
case TOKEN_IMAGINARY: case TOKEN_IMAGINARY:
mpfr_init_set(this->u_.float_value, tok.u_.float_value, GMP_RNDN); mpfr_init_set(this->u_.float_value, tok.u_.float_value, MPFR_RNDN);
break; break;
default: default:
go_unreachable(); go_unreachable();
...@@ -278,11 +278,11 @@ Token::print(FILE* file) const ...@@ -278,11 +278,11 @@ Token::print(FILE* file) const
break; break;
case TOKEN_FLOAT: case TOKEN_FLOAT:
fprintf(file, "float "); fprintf(file, "float ");
mpfr_out_str(file, 10, 0, this->u_.float_value, GMP_RNDN); mpfr_out_str(file, 10, 0, this->u_.float_value, MPFR_RNDN);
break; break;
case TOKEN_IMAGINARY: case TOKEN_IMAGINARY:
fprintf(file, "imaginary "); fprintf(file, "imaginary ");
mpfr_out_str(file, 10, 0, this->u_.float_value, GMP_RNDN); mpfr_out_str(file, 10, 0, this->u_.float_value, MPFR_RNDN);
break; break;
case TOKEN_OPERATOR: case TOKEN_OPERATOR:
fprintf(file, "operator "); fprintf(file, "operator ");
...@@ -1213,7 +1213,7 @@ Lex::gather_number() ...@@ -1213,7 +1213,7 @@ Lex::gather_number()
else else
{ {
mpfr_t ival; mpfr_t ival;
mpfr_init_set_z(ival, val, GMP_RNDN); mpfr_init_set_z(ival, val, MPFR_RNDN);
mpz_clear(val); mpz_clear(val);
Token ret = Token::make_imaginary_token(ival, location); Token ret = Token::make_imaginary_token(ival, location);
mpfr_clear(ival); mpfr_clear(ival);
...@@ -1310,7 +1310,7 @@ Lex::gather_number() ...@@ -1310,7 +1310,7 @@ Lex::gather_number()
} }
mpfr_t val; mpfr_t val;
int r = mpfr_init_set_str(val, num.c_str(), base, GMP_RNDN); int r = mpfr_init_set_str(val, num.c_str(), base, MPFR_RNDN);
go_assert(r == 0); go_assert(r == 0);
bool is_imaginary = *p == 'i'; bool is_imaginary = *p == 'i';
......
...@@ -2651,7 +2651,7 @@ Parse::operand(bool may_be_sink, bool* is_parenthesized) ...@@ -2651,7 +2651,7 @@ Parse::operand(bool may_be_sink, bool* is_parenthesized)
case Token::TOKEN_IMAGINARY: case Token::TOKEN_IMAGINARY:
{ {
mpfr_t zero; mpfr_t zero;
mpfr_init_set_ui(zero, 0, GMP_RNDN); mpfr_init_set_ui(zero, 0, MPFR_RNDN);
mpc_t val; mpc_t val;
mpc_init2(val, mpc_precision); mpc_init2(val, mpc_precision);
mpc_set_fr_fr(val, zero, *token->imaginary_value(), MPC_RNDNN); mpc_set_fr_fr(val, zero, *token->imaginary_value(), MPC_RNDNN);
......
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