public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: David Faust <dfaust@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3762] bpf: cleanup missed refactor Date: Mon, 7 Nov 2022 22:42:01 +0000 (GMT) [thread overview] Message-ID: <20221107224201.380113858C78@sourceware.org> (raw) https://gcc.gnu.org/g:93ab7d03dfbdd096c1d3c83e92d794bf4eed18df commit r13-3762-g93ab7d03dfbdd096c1d3c83e92d794bf4eed18df Author: David Faust <david.faust@oracle.com> Date: Mon Nov 7 10:30:52 2022 -0800 bpf: cleanup missed refactor Commit 068baae1864 "bpf: add preserve_field_info builtin" factored out some repeated code to a new function maybe_make_core_relo (), but missed using it in one place. Clean that up. gcc/ * config/bpf/bpf.cc (handle_attr_preserve): Use maybe_make_core_relo(). Diff: --- gcc/config/bpf/bpf.cc | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc index ea8ca64d1d6..fd4003c2bfc 100644 --- a/gcc/config/bpf/bpf.cc +++ b/gcc/config/bpf/bpf.cc @@ -1731,7 +1731,6 @@ handle_attr_preserve (function *fn) { basic_block bb; rtx_insn *insn; - rtx_code_label *label; FOR_EACH_BB_FN (bb, fn) { FOR_BB_INSNS (bb, insn) @@ -1762,28 +1761,7 @@ handle_attr_preserve (function *fn) } if (is_attr_preserve_access (expr)) - { - auto_vec<unsigned int, 16> accessors; - tree container = bpf_core_compute (expr, &accessors); - if (accessors.length () < 1) - continue; - accessors.reverse (); - - container = TREE_TYPE (container); - const char * section_name; - if (DECL_SECTION_NAME (fn->decl)) - section_name = DECL_SECTION_NAME (fn->decl); - else - section_name = ".text"; - - label = gen_label_rtx (); - LABEL_PRESERVE_P (label) = 1; - emit_label (label); - - /* Add the CO-RE relocation information to the BTF container. */ - bpf_core_reloc_add (container, section_name, &accessors, label, - BPF_RELO_FIELD_BYTE_OFFSET); - } + maybe_make_core_relo (expr, BPF_RELO_FIELD_BYTE_OFFSET); } } rtx_insn *seq = get_insns ();
reply other threads:[~2022-11-07 22:42 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221107224201.380113858C78@sourceware.org \ --to=dfaust@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).