summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-12-18 20:06:28 -0800
committerKen Thompson <ken@golang.org>2008-12-18 20:06:28 -0800
commit991baa30c0b8db65f41c9f5ca62fe83fe8cea2ab (patch)
treeaf8fd515f015109ff244c5550e6890cb5abfe0da /src/cmd/gc/subr.c
parent5533ac65097837514737f6c37579a0fcb6425584 (diff)
downloadgolang-991baa30c0b8db65f41c9f5ca62fe83fe8cea2ab.tar.gz
arrays
R=r OCL=21564 CL=21564
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r--src/cmd/gc/subr.c19
1 files changed, 18 insertions, 1 deletions
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)
@@ -1439,6 +1440,22 @@ isptrdarray(Type *t)
}
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)
{
Sym *s;