From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1519 invoked by alias); 1 Nov 2012 07:47:22 -0000 Received: (qmail 1467 invoked by uid 22791); 1 Nov 2012 07:47:21 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Nov 2012 07:47:15 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TTpUg-0003h5-PC from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 01 Nov 2012 00:47:14 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 1 Nov 2012 00:47:14 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Thu, 1 Nov 2012 00:47:12 -0700 From: Yao Qi To: Subject: [PATCH 3/6] Remove 'variantno'. Date: Thu, 01 Nov 2012 07:47:00 -0000 Message-ID: <1351756007-18242-4-git-send-email-yao@codesourcery.com> In-Reply-To: <1351756007-18242-1-git-send-email-yao@codesourcery.com> References: <1351756007-18242-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00007.txt.bz2 As local variable 'variantno' becomens a constant -1, some code can be removed. gdb: 2012-11-01 Yao Qi * eval.c (evaluate_struct_tuple): Remove local variable 'variantno' and related code. --- gdb/eval.c | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 681012b..3eb4896 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -290,7 +290,6 @@ evaluate_struct_tuple (struct value *struct_val, struct type *substruct_type = struct_type; struct type *field_type; int fieldno = -1; - int variantno = -1; int subfieldno = -1; while (--nargs >= 0) @@ -300,17 +299,6 @@ evaluate_struct_tuple (struct value *struct_val, bfd_byte *addr; { { - /* Unlabelled tuple element - go to next field. */ - if (variantno >= 0) - { - subfieldno++; - if (subfieldno >= TYPE_NFIELDS (substruct_type)) - { - variantno = -1; - substruct_type = struct_type; - } - } - if (variantno < 0) { fieldno++; /* Skip static fields. */ @@ -349,8 +337,6 @@ evaluate_struct_tuple (struct value *struct_val, bitsize = TYPE_FIELD_BITSIZE (substruct_type, subfieldno); bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno); - if (variantno >= 0) - bitpos += TYPE_FIELD_BITPOS (substruct_type, subfieldno); addr = value_contents_writeable (struct_val) + bitpos / 8; if (bitsize) modify_field (struct_type, addr, -- 1.7.7.6