public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5812] bpf: mark/remove unused arguments and remove an unused function
@ 2021-12-06 21:03 Jose E. Marchesi
  0 siblings, 0 replies; only message in thread
From: Jose E. Marchesi @ 2021-12-06 21:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:bd0a61befcb4046c77a9bf144e92bc3ae99fb9f8

commit r12-5812-gbd0a61befcb4046c77a9bf144e92bc3ae99fb9f8
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Mon Dec 6 21:57:53 2021 +0100

    bpf: mark/remove unused arguments and remove an unused function
    
    This patch does a little bit of cleanup by removing some unused
    arguments, or marking them as unused.  It also removes the function
    ctfc_debuginfo_early_finish_p and the corresponding hook macro
    definition, which are not used by GCC.
    
    gcc/
            * config/bpf/bpf.c (bpf_handle_preserve_access_index_attribute):
            Mark arguments `args' and flags' as unused.
            (bpf_core_newdecl): Remove unused local `newdecl'.
            (bpf_core_newdecl): Remove unused argument `loc'.
            (ctfc_debuginfo_early_finish_p): Remove unused function.
            (TARGET_CTFC_DEBUGINFO_EARLY_FINISH_P): Remove definition.
            (bpf_core_walk): Do not pass a location to bpf_core_newdecl.

Diff:
---
 gcc/config/bpf/bpf.c | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/gcc/config/bpf/bpf.c b/gcc/config/bpf/bpf.c
index 82bb698bd91..9d2c0bb6818 100644
--- a/gcc/config/bpf/bpf.c
+++ b/gcc/config/bpf/bpf.c
@@ -129,8 +129,8 @@ bpf_handle_fndecl_attribute (tree *node, tree name,
 
 static tree
 bpf_handle_preserve_access_index_attribute (tree *node, tree name,
-					    tree args,
-					    int flags,
+					    tree args ATTRIBUTE_UNUSED,
+					    int flags ATTRIBUTE_UNUSED,
 					    bool *no_add_attrs)
 {
   if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE)
@@ -258,20 +258,6 @@ bpf_option_override (void)
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE bpf_option_override
 
-/* Return FALSE iff -mcore has been specified.  */
-
-static bool
-ctfc_debuginfo_early_finish_p (void)
-{
-  if (TARGET_BPF_CORE)
-    return false;
-  else
-    return true;
-}
-
-#undef TARGET_CTFC_DEBUGINFO_EARLY_FINISH_P
-#define TARGET_CTFC_DEBUGINFO_EARLY_FINISH_P ctfc_debuginfo_early_finish_p
-
 /* Implement TARGET_ASM_INIT_SECTIONS.  */
 
 static void
@@ -1266,15 +1252,14 @@ bpf_core_get_index (const tree node)
   return -1;
 }
 
-/* Synthesize a new builtin function declaration at LOC with signature TYPE.
+/* Synthesize a new builtin function declaration with signature TYPE.
    Used by bpf_resolve_overloaded_builtin to resolve calls to
    __builtin_preserve_access_index.  */
 
 static tree
-bpf_core_newdecl (location_t loc, tree type)
+bpf_core_newdecl (tree type)
 {
   tree rettype = build_function_type_list (type, type, NULL);
-  tree newdecl = NULL_TREE;
   char name[80];
   int len = snprintf (name, sizeof (name), "%s", "__builtin_pai_");
 
@@ -1317,7 +1302,7 @@ bpf_core_walk (tree *tp, int *walk_subtrees, void *data)
 
   if (bpf_core_is_maybe_aggregate_access (*tp))
     {
-      tree newdecl = bpf_core_newdecl (loc, TREE_TYPE (*tp));
+      tree newdecl = bpf_core_newdecl (TREE_TYPE (*tp));
       tree newcall = build_call_expr_loc (loc, newdecl, 1, *tp);
       *tp = newcall;
       *walk_subtrees = 0;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-06 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 21:03 [gcc r12-5812] bpf: mark/remove unused arguments and remove an unused function Jose E. Marchesi

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).