summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2022-11-07 10:30:52 -0800
committerDavid Faust <david.faust@oracle.com>2022-11-07 14:37:22 -0800
commit93ab7d03dfbdd096c1d3c83e92d794bf4eed18df (patch)
tree2810db1f77fc1c2f8a85939cbbdb70235c9a7aaa
parenta239a63f868e29e9276088e7c0fb00804c2903ba (diff)
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().
-rw-r--r--gcc/config/bpf/bpf.cc24
1 files changed, 1 insertions, 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 ();