* [pushed] libobjc: Add local macros to support encode generation [P109913].
@ 2023-05-22 21:47 Iain Sandoe
0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2023-05-22 21:47 UTC (permalink / raw)
To: gcc-patches
This fixes bootstrap on powerpc-darwin, and was tested there for
both GNU and NeXT Objective-C testsuite. Approved in the PR by Andrew,
pushed to trunk, thanks,
Iain
--- 8< ---
r14-976-g9907413a3a6aa3 alters code to use the preferred _P-style
macros rather than direct comparisons of (for example) tree codes.
In the context of libobjc this does not work, since we do not include
the relevant headers; the encoding implementation contains a local
emulation of the target type layouts.
The fix here provides relevant macros local to the use.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR libobjc/109913
libobjc/ChangeLog:
* encoding.c (RECORD_OR_UNION_TYPE_P, VECTOR_TYPE_P): New.
Co-authored-by: Andrew Pinski <apinski@marvell.com>
---
libobjc/encoding.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index 9bd261c52bd..f1bbd6bf6ee 100644
--- a/libobjc/encoding.c
+++ b/libobjc/encoding.c
@@ -67,6 +67,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define UNION_TYPE _C_UNION_B
#define QUAL_UNION_TYPE _C_UNION_B
#define ARRAY_TYPE _C_ARY_B
+#define RECORD_OR_UNION_TYPE_P(TYPE) \
+ ((TREE_CODE (TYPE) == RECORD_TYPE) \
+ || (TREE_CODE (TYPE) == UNION_TYPE) \
+ || (TREE_CODE (TYPE) == QUAL_UNION_TYPE))
+#define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
#define REAL_TYPE _C_DBL
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-22 21:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 21:47 [pushed] libobjc: Add local macros to support encode generation [P109913] Iain Sandoe
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).