aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2023-05-22 20:15:36 +0100
committerIain Sandoe <iain@sandoe.co.uk>2023-05-22 22:43:19 +0100
commitb9fb093e7ccaee68be659d7d9711652c57e37aca (patch)
treedcd58a780e0581267bb532fac83d335cbf676ba5 /libobjc
parent306412a78f56ef3d462d9e5b0cde806b28965c87 (diff)
downloadgcc-b9fb093e7ccaee68be659d7d9711652c57e37aca.zip
gcc-b9fb093e7ccaee68be659d7d9711652c57e37aca.tar.gz
gcc-b9fb093e7ccaee68be659d7d9711652c57e37aca.tar.bz2
libobjc: Add local macros to support encode generation [P109913].
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>
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/encoding.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index 9bd261c..f1bbd6b 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