#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
+#include "target.h"
#include "rtl.h"
-#include "regs.h"
-#include "insn-config.h"
-#include "insn-attr.h"
-#include "recog.h"
#include "output.h"
-#include "alias.h"
#include "tree.h"
#include "stringpool.h"
#include "attribs.h"
-#include "varasm.h"
-#include "stor-layout.h"
-#include "calls.h"
#include "function.h"
-#include "explow.h"
#include "memmodel.h"
#include "emit-rtl.h"
-#include "reload.h"
-#include "tm_p.h"
-#include "target.h"
-#include "basic-block.h"
#include "expr.h"
-#include "optabs.h"
-#include "bitmap.h"
-#include "df.h"
-#include "c-family/c-common.h"
#include "diagnostic.h"
-#include "builtins.h"
-#include "predict.h"
#include "langhooks.h"
-#include "flags.h"
-
-#include "cfg.h"
+#include "basic-block.h"
#include "gimple.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "tree-pass.h"
-#include "tree-iterator.h"
-
-#include "context.h"
-#include "pass_manager.h"
-
-#include "gimplify.h"
-#include "gimplify-me.h"
-
#include "plugin.h"
#include "ctfc.h"
as a builtin. */
-struct cr_builtins
+struct GTY(()) cr_builtins
{
tree type;
tree expr;
tree default_value;
rtx rtx_default_value;
- enum btf_core_reloc_kind kind; /* Recovered from proper argument. */
+ enum btf_core_reloc_kind kind;
enum bpf_builtins orig_builtin_code;
tree orig_arg_expr;
};
+typedef struct cr_builtins *cr_builtins_ref;
#define CORE_BUILTINS_DATA_EMPTY \
{ NULL_TREE, NULL_TREE, NULL_TREE, NULL_RTX, BPF_RELO_INVALID, \
BPF_BUILTIN_UNUSED, NULL }
/* Vector definition and its access function. */
-vec<struct cr_builtins> builtins_data;
+static GTY(()) vec<cr_builtins_ref, va_gc> *builtins_data = NULL;
static inline int
allocate_builtin_data ()
{
- struct cr_builtins data = CORE_BUILTINS_DATA_EMPTY;
- int ret = builtins_data.length ();
- builtins_data.safe_push (data);
+ if (builtins_data == NULL)
+ vec_alloc (builtins_data, 1);
+
+ cr_builtins_ref data = ggc_cleared_alloc<struct cr_builtins> ();
+ int ret = builtins_data->length ();
+ vec_safe_push (builtins_data, data);
return ret;
}
static inline struct cr_builtins *
get_builtin_data (int index)
{
- return &builtins_data[index];
+ return (*builtins_data)[index];
}
typedef bool
struct cr_builtins *elem)
{
unsigned int i;
- for (i = 0; i < builtins_data.length (); i++)
- if ((callback != NULL && (callback) (elem, &builtins_data[i]))
- || (callback == NULL
- && (builtins_data[i].orig_arg_expr == elem->orig_arg_expr)))
- return (int) i;
+ if (builtins_data != NULL)
+ for (i = 0; i < builtins_data->length (); i++)
+ if ((callback != NULL && (callback) (elem, (*builtins_data)[i]))
+ || (callback == NULL
+ && ((*builtins_data)[i]->orig_arg_expr == elem->orig_arg_expr)))
+ return (int) i;
return -1;
}
}
}
}
+
+#include "gt-core-builtins.h"
static GTY (()) vec<bpf_core_section_ref, va_gc> *bpf_core_sections;
-struct bpf_core_extra {
+struct GTY(()) bpf_core_extra {
const char *accessor_str;
tree type;
};
-static hash_map<bpf_core_reloc_ref, struct bpf_core_extra *> bpf_comment_info;
+typedef struct bpf_core_extra *bpf_core_extra_ref;
+static GTY(()) hash_map<bpf_core_reloc_ref, bpf_core_extra_ref> *bpf_comment_info;
/* Create a new BPF CO-RE relocation record, and add it to the appropriate
CO-RE section. */
enum btf_core_reloc_kind kind)
{
bpf_core_reloc_ref bpfcr = ggc_cleared_alloc<bpf_core_reloc_t> ();
- struct bpf_core_extra *info = ggc_cleared_alloc<struct bpf_core_extra> ();
+ bpf_core_extra_ref info = ggc_cleared_alloc<struct bpf_core_extra> ();
ctf_container_ref ctfc = ctf_get_tu_ctfc ();
/* Buffer the access string in the auxiliary strtab. */
info->accessor_str = accessor;
info->type = type;
- bpf_comment_info.put (bpfcr, info);
+ bpf_comment_info->put (bpfcr, info);
/* Add the CO-RE reloc to the appropriate section. */
bpf_core_section_ref sec;
static void
output_asm_btfext_core_reloc (bpf_core_reloc_ref bpfcr)
{
- struct bpf_core_extra **info = bpf_comment_info.get (bpfcr);
+ bpf_core_extra_ref *info = bpf_comment_info->get (bpfcr);
gcc_assert (info != NULL);
bpfcr->bpfcr_astr_off += ctfc_get_strtab_len (ctf_get_tu_ctfc (),
btf_ext_label_num++);
vec_alloc (bpf_core_sections, 1);
+ bpf_comment_info = hash_map<bpf_core_reloc_ref, bpf_core_extra_ref>::create_ggc ();
}
/* Output the entire .BTF.ext section. */