From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id D94BF3894C37; Mon, 30 Jan 2023 17:01:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D94BF3894C37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675098071; bh=8RsALkDgaRje72TDmBzA9mV/VRDnOiOEm0tHwJMmGGI=; h=From:To:Subject:Date:From; b=XNYg49Qx4QAKBV4o45l/q9U6hqigUHxeJ8oAIJTHS7Ti5q3qVOpmjcG7LmqYKP5Ai lJdRHIjsWrHpNZCb9O/XXH/u8WfcK5kIAFyaWr4Yicqv+HBJvtWYd4Nmwh/fNueu8s mPZv4xFC/T4KgL0Eq9jcmlZYQbLyLMq4b8TJgFb0= 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] Clean up lnp_state_machine constructor X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 70ca3a6bc9538d98a602325f4e84d18d0be491d1 X-Git-Newrev: 9d00e8d76a7d7fd4a2029e9a47607e73d5aa9536 Message-Id: <20230130170111.D94BF3894C37@sourceware.org> Date: Mon, 30 Jan 2023 17:01:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9d00e8d76a7d= 7fd4a2029e9a47607e73d5aa9536 commit 9d00e8d76a7d7fd4a2029e9a47607e73d5aa9536 Author: Tom Tromey Date: Sat Jan 28 08:30:57 2023 -0700 Clean up lnp_state_machine constructor =20 This changes the lnp_state_machine constructor to initialize members directly; and changes lnp_state_machine itself to initialize members inline when possible. =20 Reviewed-By: Lancelot Six Diff: --- gdb/dwarf2/read.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 9d8952a4eb8..3a1728e9ff9 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -20074,7 +20074,7 @@ private: =20 CORE_ADDR m_address; linetable_entry_flags m_flags; - unsigned int m_discriminator; + unsigned int m_discriminator =3D 0; =20 /* Additional bits of state we need to track. */ =20 @@ -20094,7 +20094,7 @@ private: bool m_stmt_at_address =3D false; =20 /* When true, record the lines we decode. */ - bool m_currently_recording_lines =3D false; + bool m_currently_recording_lines =3D true; =20 /* The last line number that was recorded, used to coalesce consecutive entries for the same line. This can happen, for @@ -20347,25 +20347,18 @@ lnp_state_machine::record_line (bool end_sequence) =20 lnp_state_machine::lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch, line_header *lh) + : m_cu (cu), + m_gdbarch (arch), + m_line_header (lh), + /* Call `gdbarch_adjust_dwarf2_line' on the initial 0 address as + if there was a line entry for it so that the backend has a + chance to adjust it and also record it in case it needs it. + This is currently used by MIPS code, + cf. `mips_adjust_dwarf2_line'. */ + m_address (gdbarch_adjust_dwarf2_line (arch, 0, 0)), + m_flags (lh->default_is_stmt ? LEF_IS_STMT : (linetable_entry_flags) 0= ), + m_last_address (m_address) { - m_cu =3D cu; - m_gdbarch =3D arch; - m_line_header =3D lh; - - m_currently_recording_lines =3D true; - - /* Call `gdbarch_adjust_dwarf2_line' on the initial 0 address as if there - was a line entry for it so that the backend has a chance to adjust it - and also record it in case it needs it. This is currently used by MI= PS - code, cf. `mips_adjust_dwarf2_line'. */ - m_address =3D gdbarch_adjust_dwarf2_line (arch, 0, 0); - m_flags =3D 0; - if (lh->default_is_stmt) - m_flags |=3D LEF_IS_STMT; - m_discriminator =3D 0; - - m_last_address =3D m_address; - m_stmt_at_address =3D false; } =20 void