From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 42A993858002; Mon, 13 Feb 2023 22:27:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42A993858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676327249; bh=mc0Njd9UesI12QsJOL3MU2UhPX3sJpmLABbgw1zSlJA=; h=From:To:Subject:Date:From; b=cvJ6L6rDTkIKmycgpPsw0J2zyJUjXbovkWVd/73flhWEIiHjqrkZbYVb61kF9qml5 M4r6oWm3B/lKo2JBgGVgqvCYe/Y+VgMJSCNaqA9NcTEEBdAbRpO1LtTEj/B9zWckHC RVV2zgNcJa0IZPhO6WxFKl399zYlUrh4A77G8Xcw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Move ~value body out-of-line X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 382d927ffc1224d7fdac532cf826b1322eba91ee X-Git-Newrev: e714001c7896d90413e2eee13acb56bdd9639abe Message-Id: <20230213222729.42A993858002@sourceware.org> Date: Mon, 13 Feb 2023 22:27:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De714001c7896= d90413e2eee13acb56bdd9639abe commit e714001c7896d90413e2eee13acb56bdd9639abe Author: Tom Tromey Date: Tue Jan 31 07:41:09 2023 -0700 Move ~value body out-of-line =20 struct value is going to move to value.h, but to avoid having excessive code there, first move the destructor body out-of-line. =20 Approved-By: Simon Marchi Diff: --- gdb/value.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gdb/value.c b/gdb/value.c index 7606fa2666f..be981b1d3a0 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -191,18 +191,7 @@ struct value { } =20 - ~value () - { - if (VALUE_LVAL (this) =3D=3D lval_computed) - { - const struct lval_funcs *funcs =3D m_location.computed.funcs; - - if (funcs->free_closure) - funcs->free_closure (this); - } - else if (VALUE_LVAL (this) =3D=3D lval_xcallable) - delete m_location.xm_worker; - } + ~value (); =20 DISABLE_COPY_AND_ASSIGN (value); =20 @@ -383,6 +372,19 @@ struct value ULONGEST m_limited_length =3D 0; }; =20 +value::~value () +{ + if (VALUE_LVAL (this) =3D=3D lval_computed) + { + const struct lval_funcs *funcs =3D m_location.computed.funcs; + + if (funcs->free_closure) + funcs->free_closure (this); + } + else if (VALUE_LVAL (this) =3D=3D lval_xcallable) + delete m_location.xm_worker; +} + /* See value.h. */ =20 struct gdbarch *