ref: b32614e4bdf8f34fbdf12084a67bb9c3fcf75e77
parent: 58a13c39b7f3e6ab0bf950908e98b9f0dfb7c951
author: S. Gilles <sgilles@umd.edu>
date: Wed Mar 25 21:42:47 EDT 2020
Add isaggregate for later use with abi conformity.
--- a/6/asm.h
+++ b/6/asm.h
@@ -316,6 +316,7 @@
size_t size(Node *n);
ssize_t tyoffset(Type *ty, Node *memb);
ssize_t offset(Node *aggr, Node *memb);
+int isaggregate(Type *t);
int stacknode(Node *n);
int floatnode(Node *n);
void breakhere();
--- a/6/typeinfo.c
+++ b/6/typeinfo.c
@@ -408,3 +408,10 @@
return tyoffset(exprtype(aggr), memb);
}
+int
+isaggregate(Type *t)
+{
+ t = tybase(t);
+ return (t->type == Tystruct || t->type == Tyarray || t->type == Tytuple ||
+ (t->type == Tyunion && !isenum(t)));
+}