This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/6] Remove 'variantno'.


As local variable 'variantno' becomens a constant -1, some code can be
removed.

gdb:

2012-11-01  Yao Qi  <yao@codesourcery.com>

	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]