From 991baa30c0b8db65f41c9f5ca62fe83fe8cea2ab Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Thu, 18 Dec 2008 20:06:28 -0800 Subject: arrays R=r OCL=21564 CL=21564 --- src/cmd/gc/subr.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/cmd/gc/subr.c') diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 5638df4b7..c1fbb5ae9 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -440,6 +440,7 @@ aindex(Node *b, Type *t) r = typ(TARRAY); r->type = t; r->bound = bound; + dowidth(r); return r; } @@ -1421,7 +1422,7 @@ isptrto(Type *t, int et) } int -isptrarray(Type *t) +isptrsarray(Type *t) { if(isptrto(t, TARRAY)) if(t->type->bound >= 0) @@ -1438,6 +1439,22 @@ isptrdarray(Type *t) return 0; } +int +issarray(Type *t) +{ + if(t != T && t->etype == TARRAY && t->bound >= 0) + return 1; + return 0; +} + +int +isdarray(Type *t) +{ + if(t != T && t->etype == TARRAY && t->bound < 0) + return 1; + return 0; +} + int isselect(Node *n) { -- cgit v1.2.3