compiler: remove unneeded zero-length slice value init
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 15 Dec 2016 02:14:40 +0000 (02:14 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 15 Dec 2016 02:14:40 +0000 (02:14 +0000)
    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

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc

index 7f2ed5d6a3f444f02ddf8453b13c1a6949c38e7f..1303ad5412a8c5e7fd0e9768b105b4231a12b32c 100644 (file)
@@ -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.
index 899fc9b4053e799ace2da38bd6515c79fbe463b7..a9337bda6b1c6fad53e566040d3a93ef2b91776b 100644 (file)
@@ -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);
 }