aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-12-15 02:14:40 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-12-15 02:14:40 +0000
commitedda2869d074f103dcc035e82282e9ea07421222 (patch)
tree48e0c711f32ef964a0055ae9755ffc0fbfb02744
parentecfc21ff34ddc6f8aa517251fb51494c68ff741f (diff)
downloadgcc-edda2869d074f103dcc035e82282e9ea07421222.zip
gcc-edda2869d074f103dcc035e82282e9ea07421222.tar.gz
gcc-edda2869d074f103dcc035e82282e9ea07421222.tar.bz2
compiler: remove unneeded zero-length slice value init
Prune away a bit of unnecessary code from the helper routine Slice_construction_expression::create_array_val() that was adding an extra NULL value to empty slices (no longer needed). Reviewed-on: https://go-review.googlesource.com/34410 From-SVN: r243682
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc6
2 files changed, 1 insertions, 7 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 7f2ed5d..1303ad5 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-556a546ba3c7bb14bd1b9b8469ee3b7a914909f6
+5eb55901861f360c2c2ff70f14a8315694934c97
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 899fc9b..a9337bd 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -12926,12 +12926,6 @@ Slice_construction_expression::create_array_val()
go_assert(this->valtype_ != NULL);
Expression_list* vals = this->vals();
- if (this->vals() == NULL || this->vals()->empty())
- {
- // We need to create a unique value for the empty array literal.
- vals = new Expression_list;
- vals->push_back(NULL);
- }
return new Fixed_array_construction_expression(
this->valtype_, this->indexes(), vals, loc);
}