Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 4/7] builtin: add support for arch-specific builtins
Date: Wed, 10 Jun 2020 22:27:32 +0200	[thread overview]
Message-ID: <20200610202735.84968-5-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200610202735.84968-1-luc.vanoostenryck@gmail.com>

Now that a table is used for the declaration of builtin functions
it's easy to support arch-specific builtins.

The main objective is to not 'pollute' the main table with
arch-specfic entries for uncommon architectures.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 builtin.c | 4 ++++
 target.h  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/builtin.c b/builtin.c
index bb9ec65b2d20..dcf8200ec002 100644
--- a/builtin.c
+++ b/builtin.c
@@ -391,6 +391,9 @@ static void declare_one_builtin(const struct builtin_fn *entry)
 
 static void declare_builtins(const struct builtin_fn tbl[])
 {
+	if (!tbl)
+		return;
+
 	while (tbl->name)
 		declare_one_builtin(tbl++);
 }
@@ -587,5 +590,6 @@ void init_builtins(int stream)
 {
 
 	declare_builtins(builtins_common);
+	declare_builtins(arch_target->builtins);
 	init_linearized_builtins(stream);
 }
diff --git a/target.h b/target.h
index a89e21b63563..1202c0be1ac9 100644
--- a/target.h
+++ b/target.h
@@ -54,6 +54,8 @@ extern int bits_in_enum;
 extern int enum_alignment;
 
 
+struct builtin_fn;
+
 struct target {
 	enum machine	mach;
 	enum bitness	bitness;
@@ -71,6 +73,8 @@ struct target {
 	const struct target *target_32bit;
 	const struct target *target_64bit;
 
+	const struct builtin_fn *builtins;
+
 	void (*init)(const struct target *self);
 	void (*predefine)(const struct target *self);
 };
-- 
2.27.0

  parent reply	other threads:[~2020-06-10 20:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 20:27 [PATCH 0/7] move arch-specific builtins to their own table Luc Van Oostenryck
2020-06-10 20:27 ` [PATCH 1/7] builtin: can be initialized later Luc Van Oostenryck
2020-06-12  0:50   ` Ramsay Jones
2020-06-10 20:27 ` [PATCH 2/7] builtin: use a table for the builtins Luc Van Oostenryck
2020-06-12  0:56   ` Ramsay Jones
2020-06-12 16:48     ` Luc Van Oostenryck
2020-06-10 20:27 ` [PATCH 3/7] builtin: unify the 2 tables of builtins Luc Van Oostenryck
2020-06-12  1:01   ` Ramsay Jones
2020-06-10 20:27 ` Luc Van Oostenryck [this message]
2020-06-10 20:27 ` [PATCH 5/7] arch: add specificities for Nios2 Luc Van Oostenryck
2020-06-12  1:04   ` Ramsay Jones
2020-06-12 17:04     ` Luc Van Oostenryck
2020-06-10 20:27 ` [PATCH 6/7] arch: add specificities for Blackfin Luc Van Oostenryck
2020-06-10 20:27 ` [PATCH 7/7] arch: add specificities for Alpha Luc Van Oostenryck

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=20200610202735.84968-5-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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: link
Be 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