From 70f6ac6afc99213436eb96ff17858d3b6ff7e30b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 9 Jan 2009 15:21:41 -0800 Subject: clean up automatic indirect, delete some dead code. R=ken OCL=22454 CL=22457 --- src/cmd/gc/subr.c | 51 +++++---------------------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-) (limited to 'src/cmd/gc/subr.c') diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 9152bfb1a..428e70551 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -301,7 +301,7 @@ algtype(Type *t) if(isptr[simtype[t->etype]]) a = APTR; // pointer else - if(t->etype == TARRAY && t->bound < 0) + if(isslice(t)) a = ASLICE; else if(t->etype == TSTRUCT) @@ -667,7 +667,6 @@ opnames[] = [OGT] = "GT", [OIF] = "IF", [OINDEX] = "INDEX", - [OINDEXPTR] = "INDEXPTR", [OIND] = "IND", [OKEY] = "KEY", [OLABEL] = "LABEL", @@ -831,7 +830,6 @@ etnames[] = [TDDD] = "DDD", [TFUNC] = "FUNC", [TARRAY] = "ARRAY", -// [TDARRAY] = "DARRAY", [TSTRUCT] = "STRUCT", [TCHAN] = "CHAN", [TMAP] = "MAP", @@ -1436,37 +1434,15 @@ istype(Type *t, int et) } int -isptrsarray(Type *t) +isfixedarray(Type *t) { - if(isptrto(t, TARRAY)) - if(t->type->bound >= 0) - return 1; - return 0; + return t != T && t->etype == TARRAY && t->bound >= 0; } int -isptrdarray(Type *t) +isslice(Type *t) { - if(isptrto(t, TARRAY)) - if(t->type->bound < 0) - return 1; - 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; + return t != T && t->etype == TARRAY && t->bound < 0; } int @@ -1683,23 +1659,6 @@ bad: return S; } -int -bytearraysz(Type *t) -{ - if(t == T) - return -2; - if(isptr[t->etype]) { - t = t->type; - if(t == T) - return -2; - } - if(t->etype != TARRAY) - return -2; - if(!eqtype(t->type, types[TUINT8], 0)) - return -2; - return t->bound; // -1 is dyn, >=0 is fixed -} - int eqtype(Type *t1, Type *t2, int d) { -- cgit v1.2.3