aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-03-22 10:51:21 -0700
committerIan Lance Taylor <iant@golang.org>2022-05-06 16:18:25 -0700
commitfa2d5fc0497b702f37ef18a85535826e910a7307 (patch)
treead114593ac42bd19f91651aaf4f81fe3bcefe97a /gcc/go/gofrontend/expressions.cc
parent42991a911685a419794c47eba640d35ca60c2d99 (diff)
downloadgcc-fa2d5fc0497b702f37ef18a85535826e910a7307.zip
gcc-fa2d5fc0497b702f37ef18a85535826e910a7307.tar.gz
gcc-fa2d5fc0497b702f37ef18a85535826e910a7307.tar.bz2
compiler: remove Array_index_expression::is_lvalue_
As of CL 77510 it is never true. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/394695
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r--gcc/go/gofrontend/expressions.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index dce48e0..734ecb9 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -7671,8 +7671,7 @@ Expression::comparison(Translate_context* context, Type* result_type,
&& left_type->array_type()->length() == NULL)
{
Array_type* at = left_type->array_type();
- bool is_lvalue = false;
- left = at->get_value_pointer(context->gogo(), left, is_lvalue);
+ left = at->get_value_pointer(context->gogo(), left);
}
else if (left_type->interface_type() != NULL)
{
@@ -9276,7 +9275,7 @@ Builtin_call_expression::flatten_append(Gogo* gogo, Named_object* function,
Type* unsafe_ptr_type = Type::make_pointer_type(Type::make_void_type());
Expression* a1 = Expression::make_type_descriptor(element_type, loc);
Expression* a2 = Expression::make_temporary_reference(s1tmp, loc);
- a2 = slice_type->array_type()->get_value_pointer(gogo, a2, false);
+ a2 = slice_type->array_type()->get_value_pointer(gogo, a2);
a2 = Expression::make_cast(unsafe_ptr_type, a2, loc);
Expression* a3 = Expression::make_temporary_reference(l1tmp, loc);
Expression* a4 = Expression::make_temporary_reference(c1tmp, loc);
@@ -13848,9 +13847,8 @@ Array_index_expression::do_get_backend(Translate_context* context)
}
else
{
- Expression* valptr =
- array_type->get_value_pointer(gogo, this->array_,
- this->is_lvalue_);
+ Expression* valptr = array_type->get_value_pointer(gogo,
+ this->array_);
Bexpression* ptr = valptr->get_backend(context);
ptr = gogo->backend()->pointer_offset_expression(ptr, start, loc);
@@ -13891,8 +13889,7 @@ Array_index_expression::do_get_backend(Translate_context* context)
Bexpression* offset = gogo->backend()->conditional_expression(bfn, int_btype,
cond, zero,
start, loc);
- Expression* valptr = array_type->get_value_pointer(gogo, this->array_,
- this->is_lvalue_);
+ Expression* valptr = array_type->get_value_pointer(gogo, this->array_);
Bexpression* val = valptr->get_backend(context);
val = gogo->backend()->pointer_offset_expression(val, offset, loc);