From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10142 invoked by alias); 7 Sep 2008 15:49:25 -0000 Received: (qmail 10133 invoked by uid 22791); 7 Sep 2008 15:49:24 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 07 Sep 2008 15:48:50 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3AFBF2A9713; Sun, 7 Sep 2008 11:48:48 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VIp55sGVyqC4; Sun, 7 Sep 2008 11:48:48 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 097F02A9670; Sun, 7 Sep 2008 11:48:48 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B649BE7ACD; Sun, 7 Sep 2008 17:48:45 +0200 (CEST) Date: Sun, 07 Sep 2008 15:49:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc][13/37] Eliminate builtin_type_ macros: Update EVAL_SKIP dummy return type Message-ID: <20080907154845.GC12222@adacore.com> References: <20080905225611.GG15267@adacore.com> <200809071539.m87FdIGS030032@d12av02.megacenter.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200809071539.m87FdIGS030032@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.4.2.2i 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: 2008-09/txt/msg00129.txt.bz2 > > nosideret: > > return value_from_longest (builtin_type_long, (LONGEST) 1); > > > > If we have a value_dummy() function, we can replace all gotos with > > a "return value_dummy ()", and get rid of the label. I think it will > > be more readable. > > I tried to have evaluate_subexp return NULL for the EVAL_SKIP case, > but that caused frequently-used constructe like this to break: > > arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); > arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); > > if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS) > return arg1; Right, I think the expectation for evaluate_subexp was that it would never return NULL - either it errors out or returns a valid value. What I meant in my message above is that we could have a new procedure that returns a valid value of some kind, but whose content is unspecified - to be used in cases like EVAL_SKIP when we don't really care about. The function is there more as a shortcut for building that dummy value. Your suggestion of using allocate_value (builtin_void_type) might actually be even better than using builtin_type_int8 - we should never read the value contents anyway. > I guess with a bit of effort those could be fixed. Not worth it, IMO. -- Joel