From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7824) id 07E913858C55; Fri, 7 Oct 2022 18:34:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07E913858C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665167661; bh=dMZiLc5gZR3QGS7c367XtraVN1Qdu8n0sRHisqRCwqU=; h=From:To:Subject:Date:From; b=UbxYPn+EZ3683X0LJvAmyBoa6PdjScjM/akplIrWbQ4l7m0RbNVnJ9jhjQ1WsUWNR rC1RKoTfQKyEK9V3Kyz9b97U30EbLyywvmmIYPC/ovxntg0EzP7201JOwYLIsen3AR CScceuueheMh6ShkGpIT+Ut5zyvSA0mXSM3XiYiU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: David Faust To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/dfaust/heads/btf-type-tag-new-rebase)] dwarf: Add dw_get_die_parent function X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/users/dfaust/heads/btf-type-tag-new-rebase X-Git-Oldrev: eb491ea5c10955c667ceeda76dede393c93a377b X-Git-Newrev: 9152a143db240e76491a5bc1c432fe74b6396350 Message-Id: <20221007183421.07E913858C55@sourceware.org> Date: Fri, 7 Oct 2022 18:34:21 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9152a143db240e76491a5bc1c432fe74b6396350 commit 9152a143db240e76491a5bc1c432fe74b6396350 Author: David Faust Date: Wed Mar 2 14:58:15 2022 -0800 dwarf: Add dw_get_die_parent function gcc/ * dwarf2out.cc (dw_get_die_parent): New function. * dwarf2out.h (dw_get_die_parent): Declare it here. Diff: --- gcc/dwarf2out.cc | 8 ++++++++ gcc/dwarf2out.h | 1 + 2 files changed, 9 insertions(+) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index e81044b8c48..9429e04cb06 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -5235,6 +5235,14 @@ dw_get_die_sib (dw_die_ref die) return die->die_sib; } +/* Return a reference to the parent of a given DIE. */ + +dw_die_ref +dw_get_die_parent (dw_die_ref die) +{ + return die->die_parent; +} + /* Add an address constant attribute value to a DIE. When using dwarf_split_debug_info, address attributes in dies destined for the final executable should be direct references--setting the parameter diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 656ef94afde..e6962fb4848 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -455,6 +455,7 @@ extern dw_die_ref lookup_type_die (tree); extern dw_die_ref dw_get_die_child (dw_die_ref); extern dw_die_ref dw_get_die_sib (dw_die_ref); +extern dw_die_ref dw_get_die_parent (dw_die_ref); extern enum dwarf_tag dw_get_die_tag (dw_die_ref); /* Data about a single source file. */