summaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/parse.cc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-24 01:49:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-24 01:49:23 +0000
commite67508fac97f413fed4b515cac2cbf6d524a2dac (patch)
treefefc70c1ab55551854cd9b757e03f44f69d717ac /gcc/go/gofrontend/parse.cc
parent583ef1805cbe53a05fd61dde3bbfd2c4fe7726b5 (diff)
downloadgcc-e67508fac97f413fed4b515cac2cbf6d524a2dac.tar.gz
compiler: Simplify making integer expressions.
Instead of always needing an mpz_t, add helper functions to create an integer functions from signed or unsigned long values. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216610 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r--gcc/go/gofrontend/parse.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index c4bcf058d8e..dfb3380c90b 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -2510,8 +2510,8 @@ Parse::operand(bool may_be_sink, bool* is_parenthesized)
return ret;
case Token::TOKEN_INTEGER:
- ret = Expression::make_integer(token->integer_value(), NULL,
- token->location());
+ ret = Expression::make_integer_z(token->integer_value(), NULL,
+ token->location());
this->advance_token();
return ret;
@@ -3129,12 +3129,7 @@ Parse::index(Expression* expr)
if (!this->peek_token()->is_op(OPERATOR_COLON))
start = this->expression(PRECEDENCE_NORMAL, false, true, NULL, NULL);
else
- {
- mpz_t zero;
- mpz_init_set_ui(zero, 0);
- start = Expression::make_integer(&zero, NULL, location);
- mpz_clear(zero);
- }
+ start = Expression::make_integer_ul(0, NULL, location);
Expression* end = NULL;
if (this->peek_token()->is_op(OPERATOR_COLON))