commit e93cc85f10242a94369266eea442dfe6f12c375d
parent 6bcfd004fd5073b54fbf7447f5df2fe00eeeea85
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 4 Nov 2022 16:34:06 +0100
cc1: Add wchartype to the architecture
This type is needed to parse L'x' character constants.
Diffstat:
6 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/src/cmd/cc/cc1/amd64-sysv.c b/src/cmd/cc/cc1/amd64-sysv.c
@@ -188,6 +188,14 @@ amd64_sysv(void)
.size = 24,
.align = 8,
},
+ .wchartype = {
+ .op = INT,
+ .letter = L_UINT32,
+ .prop = TDEFINED | TINTEGER | TARITH | TSIGNED,
+ .size = 4,
+ .align = 4,
+ .n.rank = RANK_INT,
+ },
};
sizettype = &arch.sizettype;
diff --git a/src/cmd/cc/cc1/arch.c b/src/cmd/cc/cc1/arch.c
@@ -13,7 +13,8 @@ Type *voidtype, *pvoidtype, *booltype,
*longtype, *ulongtype,
*ullongtype, *llongtype,
*floattype, *doubletype, *ldoubletype,
- *ellipsistype, *va_list_type, *va_type;
+ *ellipsistype, *va_list_type, *va_type,
+ *wchartype;
Symbol *one, *zero;
char *architecture = "amd64-sysv";
@@ -80,6 +81,7 @@ iarch(void)
ellipsistype = &arch->ellipsistype;
va_list_type = &arch->va_list_type;
va_type = &arch->va_type;
+ wchartype = &arch->wchartype;
zero = &zerodata;
one = &onedata;
diff --git a/src/cmd/cc/cc1/arm64-sysv.c b/src/cmd/cc/cc1/arm64-sysv.c
@@ -188,6 +188,14 @@ arm64_sysv(void)
.size = 24,
.align = 8,
},
+ .wchartype = {
+ .op = INT,
+ .letter = L_UINT32,
+ .prop = TDEFINED | TINTEGER | TARITH | TSIGNED,
+ .size = 4,
+ .align = 4,
+ .n.rank = RANK_INT,
+ },
};
sizettype = &arch.sizettype;
diff --git a/src/cmd/cc/cc1/cc1.h b/src/cmd/cc/cc1/cc1.h
@@ -388,6 +388,7 @@ struct arch {
Type ellipsistype;
Type va_type;
Type va_list_type;
+ Type wchartype;
int (*valid_va_list)(Type *tp);
};
@@ -551,4 +552,5 @@ extern Type *voidtype, *pvoidtype, *booltype,
*longtype, *ulongtype,
*ullongtype, *llongtype,
*floattype, *doubletype, *ldoubletype,
- *ellipsistype, *va_list_type, *va_type;
+ *ellipsistype, *va_list_type, *va_type,
+ *wchartype;
diff --git a/src/cmd/cc/cc1/i386-sysv.c b/src/cmd/cc/cc1/i386-sysv.c
@@ -195,6 +195,14 @@ i386_sysv(void)
.size = 4,
.align = 4,
},
+ .wchartype = {
+ .op = INT,
+ .letter = L_UINT32,
+ .prop = TDEFINED | TINTEGER | TARITH | TSIGNED,
+ .size = 4,
+ .align = 4,
+ .n.rank = RANK_INT,
+ },
};
arch.valid_va_list = local_valid_va_list;
diff --git a/src/cmd/cc/cc1/z80-scc.c b/src/cmd/cc/cc1/z80-scc.c
@@ -195,6 +195,14 @@ z80_scc(void)
.size = 2,
.align = 1,
},
+ .wchartype = {
+ .op = INT,
+ .letter = L_UINT16,
+ .prop = TDEFINED | TINTEGER | TARITH | TSIGNED,
+ .size = 2,
+ .align = 1,
+ .n.rank = RANK_INT,
+ },
};
arch.valid_va_list = local_valid_va_list;
arch.pvoidtype.type = &arch.voidtype;