# HG changeset patch # User Eldar Insafutdinov # Date 1283295452 -3600 # Node ID 3482c73a991b6ba861442734bfa3d14e7322621c # Parent 3f02152c5e68a4181fa05e709c4cdcfa35a30490 More cleanup for arrays diff -r 3f02152c5e68 -r 3482c73a991b dmd/Array.d --- a/dmd/Array.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/Array.d Tue Aug 31 23:57:32 2010 +0100 @@ -210,8 +210,6 @@ return _data; } - - @property T *ptr() { return _data; diff -r 3f02152c5e68 -r 3482c73a991b dmd/ArrayTypes.d --- a/dmd/ArrayTypes.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/ArrayTypes.d Tue Aug 31 23:57:32 2010 +0100 @@ -2,6 +2,8 @@ import dmd.Array; +alias Vector!Object Objects; + class TemplateParameters : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } class Statements : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } @@ -10,11 +12,6 @@ class ClassDeclarations : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } -//class Dsymbols : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } - -alias Vector!Object Objects; -//class Objects : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } - class Arguments : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } class Identifiers : Array { final typeof(this) copy() { auto a = new typeof(this); copyTo(a); return a; } } diff -r 3f02152c5e68 -r 3482c73a991b dmd/DotVarExp.d --- a/dmd/DotVarExp.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/DotVarExp.d Tue Aug 31 23:57:32 2010 +0100 @@ -68,12 +68,11 @@ * with: * tuple(e1.a, e1.b, e1.c) */ - Expressions exps = new Expressions; + auto exps = new Expressions; exps.reserve(tup.objects.dim); - for (size_t i = 0; i < tup.objects.dim; i++) + foreach (o; tup.objects) { - Object o = cast(Object)tup.objects.data[i]; if (auto e = cast(Expression)o) { if (e.op != TOK.TOKdsymbol) diff -r 3f02152c5e68 -r 3482c73a991b dmd/IndexExp.d --- a/dmd/IndexExp.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/IndexExp.d Tue Aug 31 23:57:32 2010 +0100 @@ -164,7 +164,7 @@ if (index < length) { if (e1.op == TOKtuple) - e = cast(Expression)te.exps.data[cast(size_t)index]; + e = te.exps[cast(size_t)index]; else e = new TypeExp(e1.loc, Argument.getNth(tup.arguments, cast(size_t)index).type); } diff -r 3f02152c5e68 -r 3482c73a991b dmd/InlineScanState.d --- a/dmd/InlineScanState.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/InlineScanState.d Tue Aug 31 23:57:32 2010 +0100 @@ -30,7 +30,7 @@ { for (size_t i = 0; i < td.objects.dim; i++) { - DsymbolExp se = cast(DsymbolExp)td.objects.data[i]; + auto se = cast(DsymbolExp)td.objects[i]; assert(se.op == TOKdsymbol); scanVar(se.s, iss); } diff -r 3f02152c5e68 -r 3482c73a991b dmd/IsExp.d --- a/dmd/IsExp.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/IsExp.d Tue Aug 31 23:57:32 2010 +0100 @@ -253,7 +253,7 @@ } else { - tded = cast(Type)dedtypes.data[0]; + tded = cast(Type)dedtypes[0]; if (!tded) tded = targ; diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateAliasParameter.d --- a/dmd/TemplateAliasParameter.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateAliasParameter.d Tue Aug 31 23:57:32 2010 +0100 @@ -171,14 +171,14 @@ //printf("TemplateAliasParameter.matchArg()\n"); if (i < tiargs.dim) - oarg = cast(Object)tiargs.data[i]; + oarg = tiargs[i]; else { // Get default argument instead oarg = defaultArg(loc, sc); if (!oarg) { assert(i < dedtypes.dim); // It might have already been deduced - oarg = cast(Object)dedtypes.data[i]; + oarg = dedtypes[i]; if (!oarg) goto Lnomatch; } @@ -219,9 +219,9 @@ if (sa != specAlias) goto Lnomatch; } - else if (dedtypes.data[i]) + else if (dedtypes[i]) { // Must match already deduced symbol - Object s_ = cast(Object)dedtypes.data[i]; + Object s_ = dedtypes[i]; if (!sa || s_ != sa) goto Lnomatch; diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateDeclaration.d --- a/dmd/TemplateDeclaration.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateDeclaration.d Tue Aug 31 23:57:32 2010 +0100 @@ -87,7 +87,7 @@ { if (i) buf.writeByte(','); - Object o = cast(Object)args.data[i]; + Object o = args[i]; ObjectToCBuffer(buf, hgs, o); } } @@ -537,10 +537,10 @@ */ for (int i = 0; i < dedtypes_dim; i++) { - if (!dedtypes.data[i]) + if (!dedtypes[i]) { assert(i < ti.tiargs.dim); - dedtypes.data[i] = ti.tiargs.data[i]; + dedtypes[i] = ti.tiargs[i]; } } } @@ -766,12 +766,12 @@ else n = nargsi; - memcpy(dedargs.data, targsi.data, n * (*dedargs.data).sizeof); + memcpy(dedargs.ptr, targsi.ptr, n * (*dedargs.ptr).sizeof); for (size_t i = 0; i < n; i++) { assert(i < parameters.dim); - TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; + auto tp2 = cast(TemplateParameter)parameters.data[i]; MATCH m; Declaration sparam = null; @@ -1059,13 +1059,13 @@ */ for (size_t i = nargsi; i < dedargs.dim; i++) { - TemplateParameter tp2 = cast(TemplateParameter)parameters.data[i]; + auto tp2 = cast(TemplateParameter)parameters.data[i]; //printf("tp2[%d] = %s\n", i, tp2.ident.toChars()); /* For T:T*, the dedargs is the T*, dedtypes is the T * But for function templates, we really need them to match */ - Object oarg = cast(Object)dedargs.data[i]; - Object oded = cast(Object)dedtypes.data[i]; + Object oarg = dedargs[i]; + Object oded = dedtypes[i]; //printf("1dedargs[%d] = %p, dedtypes[%d] = %p\n", i, oarg, i, oded); //if (oarg) printf("oarg: %s\n", oarg.toChars()); //if (oded) printf("oded: %s\n", oded.toChars()); @@ -1233,7 +1233,7 @@ td_best = td; m_best = m; tdargs.setDim(dedargs.dim); - memcpy(tdargs.data, dedargs.data, tdargs.dim * (void*).sizeof); + memcpy(tdargs.ptr, dedargs.ptr, tdargs.dim * (void*).sizeof); continue; } if (!td_best) @@ -1274,7 +1274,7 @@ { if (i) bufa.writeByte(','); - Object oarg = cast(Object)args.data[i]; + Object oarg = args[i]; ObjectToCBuffer(bufa, &hgs, oarg); } } diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateInstance.d --- a/dmd/TemplateInstance.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateInstance.d Tue Aug 31 23:57:32 2010 +0100 @@ -144,7 +144,7 @@ for (size_t i = 0; i < v1.objects.dim; i++) { - if (!match(cast(Object)v1.objects.data[i], cast(Object)v2.objects.data[i], tempdecl, sc)) + if (!match(v1.objects[i], v2.objects[i], tempdecl, sc)) goto Lnomatch; } } @@ -356,8 +356,8 @@ } for (size_t j = 0; j < tdtypes.dim; j++) { - Object o1 = cast(Object)tdtypes.data[j]; - Object o2 = cast(Object)ti.tdtypes.data[j]; + Object o1 = tdtypes[j]; + Object o2 = ti.tdtypes[j]; if (!match(o1, o2, tempdecl, sc)) { goto L1; @@ -708,7 +708,7 @@ { if (i) buf.writeByte(','); - Object oarg = cast(Object)args.data[i]; + Object oarg = args[i]; ObjectToCBuffer(buf, hgs, oarg); } nest--; @@ -825,7 +825,7 @@ return; for (size_t j = 0; j < tiargs.dim; j++) { - Object o = cast(Object)tiargs.data[j]; + Object o = tiargs[j]; Type ta = isType(o); Expression ea = isExpression(o); Dsymbol sa = isDsymbol(o); @@ -1153,7 +1153,7 @@ td_best = td; m_best = m; tdtypes.setDim(dedtypes.dim); - memcpy(tdtypes.data, dedtypes.data, tdtypes.dim * (void*).sizeof); + memcpy(tdtypes.ptr, dedtypes.ptr, tdtypes.dim * (void*).sizeof); continue; } @@ -1214,7 +1214,7 @@ { TemplateParameter tp = cast(TemplateParameter)tempdecl.parameters.data[i]; //Object o = cast(Object)tiargs.data[i]; - Object o = cast(Object)tdtypes.data[i]; // initializer for tp + Object o = tdtypes[i]; // initializer for tp //printf("\ttdtypes[%d] = %p\n", i, o); tempdecl.declareParameter(sc, tp, o); @@ -1235,7 +1235,7 @@ */ for (size_t i = 0; i < args.dim; i++) { - Object o = cast(Object)args.data[i]; + Object o = args[i]; Expression ea = isExpression(o); Dsymbol sa = isDsymbol(o); Tuple va = isTuple(o); @@ -1325,7 +1325,7 @@ Objects args = tiargs; for (int i = 0; i < args.dim; i++) { - Object o = cast(Object)args.data[i]; + Object o = args[i]; Type ta = isType(o); Expression ea = isExpression(o); Dsymbol sa = isDsymbol(o); diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateMixin.d --- a/dmd/TemplateMixin.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateMixin.d Tue Aug 31 23:57:32 2010 +0100 @@ -212,12 +212,12 @@ if (tiargs.dim != tm.tiargs.dim) continue; - for (int i = 0; i < tiargs.dim; i++) - { Object o = cast(Object)tiargs.data[i]; + foreach (size_t i, Object o; tiargs) + { Type ta = isType(o); Expression ea = isExpression(o); Dsymbol sa = isDsymbol(o); - Object tmo = cast(Object)tm.tiargs.data[i]; + Object tmo = tm.tiargs[i]; if (ta) { Type tmta = isType(tmo); @@ -452,7 +452,7 @@ for (int i = 0; i < tiargs.dim; i++) { if (i) buf.writebyte(','); - Object oarg = cast(Object)tiargs.data[i]; + Object oarg = tiargs[i]; Type t = isType(oarg); Expression e = isExpression(oarg); Dsymbol s = isDsymbol(oarg); diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateTupleParameter.d --- a/dmd/TemplateTupleParameter.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateTupleParameter.d Tue Aug 31 23:57:32 2010 +0100 @@ -66,7 +66,7 @@ if (i) writef(", "); - Object o = cast(Object)v.objects.data[i]; + Object o = v.objects[i]; Dsymbol sa = isDsymbol(o); if (sa) @@ -122,8 +122,8 @@ */ assert(i + 1 == dedtypes.dim); // must be the last one Tuple ovar; - if (i + 1 == tiargs.dim && isTuple(cast(Object)tiargs.data[i])) - ovar = isTuple(cast(Object)tiargs.data[i]); + if (i + 1 == tiargs.dim && isTuple(tiargs[i])) + ovar = isTuple(tiargs[i]); else { ovar = new Tuple(); @@ -133,7 +133,7 @@ //printf("i = %d, tiargs.dim = %d\n", i, tiargs.dim); ovar.objects.setDim(tiargs.dim - i); for (size_t j = 0; j < ovar.objects.dim; j++) - ovar.objects.data[j] = tiargs.data[i + j]; + ovar.objects[j] = tiargs[i + j]; } } *psparam = new TupleDeclaration(loc, ident, ovar.objects); diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateTypeParameter.d --- a/dmd/TemplateTypeParameter.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateTypeParameter.d Tue Aug 31 23:57:32 2010 +0100 @@ -132,7 +132,7 @@ Type ta; if (i < tiargs.dim) - oarg = cast(Object)tiargs.data[i]; + oarg = tiargs[i]; else { // Get default argument instead @@ -141,7 +141,7 @@ { assert(i < dedtypes.dim); // It might have already been deduced - oarg = cast(Object)dedtypes.data[i]; + oarg = dedtypes[i]; if (!oarg) { goto Lnomatch; @@ -158,7 +158,7 @@ } //printf("ta is %s\n", ta.toChars()); - t = cast(Type)dedtypes.data[i]; + t = cast(Type)dedtypes[i]; if (specType) { @@ -172,7 +172,7 @@ if (m2 < m) m = m2; - t = cast(Type)dedtypes.data[i]; + t = cast(Type)dedtypes[i]; } else { diff -r 3f02152c5e68 -r 3482c73a991b dmd/TemplateValueParameter.d --- a/dmd/TemplateValueParameter.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TemplateValueParameter.d Tue Aug 31 23:57:32 2010 +0100 @@ -179,7 +179,7 @@ Object oarg; if (i < tiargs.dim) - oarg = cast(Object)tiargs.data[i]; + oarg = tiargs[i]; else { // Get default argument instead @@ -188,7 +188,7 @@ { assert(i < dedtypes.dim); // It might have already been deduced - oarg = cast(Object)dedtypes.data[i]; + oarg = dedtypes[i]; if (!oarg) goto Lnomatch; } @@ -227,9 +227,9 @@ if (!ei.equals(e)) goto Lnomatch; } - else if (dedtypes.data[i]) + else if (dedtypes[i]) { // Must match already deduced value - Expression e = cast(Expression)dedtypes.data[i]; + auto e = cast(Expression)dedtypes[i]; if (!ei || !ei.equals(e)) goto Lnomatch; diff -r 3f02152c5e68 -r 3482c73a991b dmd/TraitsExp.d --- a/dmd/TraitsExp.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TraitsExp.d Tue Aug 31 23:57:32 2010 +0100 @@ -97,7 +97,7 @@ { return ` for (size_t i = 0; i < dim; i++) - { Type t = getType(cast(Object)args.data[i]); + { Type t = getType(args[i]); if (!t) goto Lfalse; if (!(`~cond~`)) @@ -112,7 +112,7 @@ string ISDSYMBOL(string cond) { return `for (size_t i = 0; i < dim; i++) - { Dsymbol s = getDsymbol(cast(Object)args.data[i]); + { Dsymbol s = getDsymbol(args[i]); if (!s) goto Lfalse; if (!(`~cond~`)) @@ -177,8 +177,8 @@ { if (dim != 2) goto Ldimerror; - Object o_ = cast(Object)args.data[0]; - Expression e = isExpression(cast(Object)args.data[1]); + auto o_ = args[0]; + Expression e = isExpression(args[1]); if (!e) { error("expression expected as second argument of __traits %s", ident.toChars()); goto Lfalse; @@ -188,7 +188,7 @@ { error("string expected as second argument of __traits %s instead of %s", ident.toChars(), e.toChars()); goto Lfalse; } - StringExp se = cast(StringExp)e; + auto se = cast(StringExp)e; se = se.toUTF8(sc); if (se.sz != 1) { error("string must be chars"); @@ -267,7 +267,7 @@ { if (dim != 1) goto Ldimerror; - Object o_ = cast(Object)args.data[0]; + Object o_ = args[0]; Dsymbol s = getDsymbol(o_); ClassDeclaration cd; if (!s || (cd = s.isClassDeclaration()) is null) @@ -281,7 +281,7 @@ { if (dim != 1) goto Ldimerror; - Object o_ = cast(Object)args.data[0]; + Object o_ = args[0]; Dsymbol s = getDsymbol(o_); ScopeDsymbol sd; if (!s) @@ -339,7 +339,7 @@ goto Lfalse; for (size_t i = 0; i < dim; i++) - { Object o_ = cast(Object)args.data[i]; + { Object o_ = args[i]; Expression e; uint errors = global.errors; @@ -375,8 +375,8 @@ if (dim != 2) goto Ldimerror; TemplateInstance.semanticTiargs(loc, sc, args, 0); - Object o1 = cast(Object)args.data[0]; - Object o2 = cast(Object)args.data[1]; + Object o1 = args[0]; + Object o2 = args[1]; Dsymbol s1 = getDsymbol(o1); Dsymbol s2 = getDsymbol(o2); @@ -447,7 +447,7 @@ for (int i = 0; i < args.dim; i++) { buf.writeByte(','); - Object oarg = cast(Object)args.data[i]; + Object oarg = args[i]; ObjectToCBuffer(buf, hgs, oarg); } } diff -r 3f02152c5e68 -r 3482c73a991b dmd/TupleDeclaration.d --- a/dmd/TupleDeclaration.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TupleDeclaration.d Tue Aug 31 23:57:32 2010 +0100 @@ -55,7 +55,7 @@ */ for (size_t i = 0; i < objects.dim; i++) { - Object o = cast(Object)objects.data[i]; + Object o = objects[i]; if (cast(Type)o is null) { @@ -71,7 +71,7 @@ OutBuffer buf = new OutBuffer(); bool hasdeco = 1; for (size_t i = 0; i < objects.dim; i++) - { Type t = cast(Type)objects.data[i]; + { Type t = cast(Type)objects[i]; //printf("type = %s\n", t->toChars()); static if (false) @@ -79,9 +79,9 @@ buf.printf("_%s_%d", ident.toChars(), i); char *name = cast(char *)buf.extractData(); Identifier id = new Identifier(name, TOKidentifier); - Argument arg = new Argument(STCin, t, id, null); + auto arg = new Argument(STCin, t, id, null); } else { - Argument arg = new Argument(STCundefined, t, null, null); + auto arg = new Argument(STCundefined, t, null, null); } args.data[i] = cast(void *)arg; if (!t.deco) @@ -101,7 +101,7 @@ //printf("TupleDeclaration::needThis(%s)\n", toChars()); for (size_t i = 0; i < objects.dim; i++) { - Object o = cast(Object)objects.data[i]; + Object o = objects[i]; if (auto e = cast(Expression)o) { if (e.op == TOKdsymbol) diff -r 3f02152c5e68 -r 3482c73a991b dmd/TupleExp.d --- a/dmd/TupleExp.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TupleExp.d Tue Aug 31 23:57:32 2010 +0100 @@ -88,9 +88,8 @@ type = null; exps.reserve(tup.objects.dim); - for (size_t i = 0; i < tup.objects.dim; i++) + foreach (o; tup.objects) { - Object o = cast(Object)tup.objects.data[i]; if (auto e = cast(Expression)o) { e = e.syntaxCopy(); diff -r 3f02152c5e68 -r 3482c73a991b dmd/Type.d --- a/dmd/Type.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/Type.d Tue Aug 31 23:57:32 2010 +0100 @@ -1910,7 +1910,7 @@ if (!tp.isTemplateTypeParameter()) goto Lnomatch; Type tt = this; - Type at = cast(Type)dedtypes.data[i]; + Type at = cast(Type)dedtypes[i]; // 5*5 == 25 cases static pure int X(int U, int T) { return ((U << 3) | T); } diff -r 3f02152c5e68 -r 3482c73a991b dmd/TypeFunction.d --- a/dmd/TypeFunction.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TypeFunction.d Tue Aug 31 23:57:32 2010 +0100 @@ -512,7 +512,7 @@ goto Nomatch; // not enough arguments } - arg = cast(Expression)args.data[u]; + arg = cast(Expression)args[u]; assert(arg); // writef("arg: %s, type: %s\n", arg.toChars(), arg.type.toChars()); @@ -565,7 +565,7 @@ TypeArray ta = cast(TypeArray)tb; for (; u < nargs; u++) { - arg = cast(Expression)args.data[u]; + arg = cast(Expression)args[u]; assert(arg); static if (true) { /* If lazy array of delegates, diff -r 3f02152c5e68 -r 3482c73a991b dmd/TypeInstance.d --- a/dmd/TypeInstance.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TypeInstance.d Tue Aug 31 23:57:32 2010 +0100 @@ -207,9 +207,9 @@ goto Lnomatch; if (ta.specAlias && sa != ta.specAlias) goto Lnomatch; - if (dedtypes.data[i]) + if (dedtypes[i]) { // Must match already deduced symbol - Object s = cast(Object)dedtypes.data[i]; + Object s = dedtypes[i]; if (s != sa) goto Lnomatch; @@ -227,17 +227,17 @@ //printf("\ttest: tempinst->tiargs[%d]\n", i); Object o1; if (i < tempinst.tiargs.dim) - o1 = cast(Object)tempinst.tiargs.data[i]; + o1 = tempinst.tiargs[i]; else if (i < tempinst.tdtypes.dim && i < tp.tempinst.tiargs.dim) // Pick up default arg - o1 = cast(Object)tempinst.tdtypes.data[i]; + o1 = tempinst.tdtypes[i]; else break; if (i >= tp.tempinst.tiargs.dim) goto Lnomatch; - Object o2 = cast(Object)tp.tempinst.tiargs.data[i]; + Object o2 = tp.tempinst.tiargs[i]; Type t1 = isType(o1); Type t2 = isType(o2); @@ -329,7 +329,7 @@ TemplateValueParameter tv = tp_.isTemplateValueParameter(); if (!tv) goto Lnomatch; - Expression e = cast(Expression)dedtypes.data[j]; + Expression e = cast(Expression)dedtypes[j]; if (e) { if (!e1.equals(e)) @@ -353,7 +353,7 @@ TemplateAliasParameter ta = tp_.isTemplateAliasParameter(); if (!ta) goto Lnomatch; - Dsymbol s = cast(Dsymbol)dedtypes.data[j]; + auto s = cast(Dsymbol)dedtypes[j]; if (s) { if (!s1.equals(s)) diff -r 3f02152c5e68 -r 3482c73a991b dmd/TypeSArray.d --- a/dmd/TypeSArray.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TypeSArray.d Tue Aug 31 23:57:32 2010 +0100 @@ -129,7 +129,7 @@ ///} ///t = cast(Type)o; - t = cast(Type)sd.objects.data[cast(size_t)d]; + t = cast(Type)sd.objects[cast(size_t)d]; if (t is null) { error(loc, "%s is not a type", toChars()); return Type.terror; @@ -257,7 +257,7 @@ error(loc, "tuple index %ju exceeds %u", d, td.objects.dim); goto Ldefault; } - Object o = cast(Object)td.objects.data[cast(size_t)d]; + Object o = td.objects[cast(size_t)d]; if ((*ps = isDsymbol(o)) !is null) /// ! { return; @@ -511,7 +511,7 @@ TemplateValueParameter tvp = tp2.isTemplateValueParameter(); if (!tvp) goto Lnomatch; - Expression e = cast(Expression)dedtypes.data[i]; + Expression e = cast(Expression)dedtypes[i]; if (e) { if (!dim.equals(e)) @@ -551,9 +551,9 @@ if (!tvp || !tvp.valType.isintegral()) goto Lnomatch; - if (dedtypes.data[i]) + if (dedtypes[i]) { - if (!dim.equals(cast(Object)dedtypes.data[i])) + if (!dim.equals(dedtypes[i])) goto Lnomatch; } else diff -r 3f02152c5e68 -r 3482c73a991b dmd/TypeSlice.d --- a/dmd/TypeSlice.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TypeSlice.d Tue Aug 31 23:57:32 2010 +0100 @@ -135,14 +135,14 @@ /* Create a new TupleDeclaration which * is a slice [i1..i2] out of the old one. */ - Objects objects = new Objects; + auto objects = new Objects; objects.setDim(cast(uint)(i2 - i1)); for (size_t i = 0; i < objects.dim; i++) { - objects.data[i] = td.objects.data[cast(size_t)i1 + i]; + objects[i] = td.objects[cast(size_t)i1 + i]; } - TupleDeclaration tds = new TupleDeclaration(loc, td.ident, objects); + auto tds = new TupleDeclaration(loc, td.ident, objects); *ps = tds; } else diff -r 3f02152c5e68 -r 3482c73a991b dmd/TypeTuple.d --- a/dmd/TypeTuple.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/TypeTuple.d Tue Aug 31 23:57:32 2010 +0100 @@ -55,15 +55,15 @@ this(Expressions exps) { super(TY.Ttuple); - Arguments arguments = new Arguments; + auto arguments = new Arguments; if (exps) { arguments.setDim(exps.dim); for (size_t i = 0; i < exps.dim; i++) - { Expression e = cast(Expression)exps.data[i]; + { auto e = exps[i]; if (e.type.ty == Ttuple) e.error("cannot form tuple of tuples"); - Argument arg = new Argument(STCundefined, e.type, null, null); + auto arg = new Argument(STCundefined, e.type, null, null); arguments.data[i] = cast(void *)arg; } } diff -r 3f02152c5e68 -r 3482c73a991b dmd/VarDeclaration.d --- a/dmd/VarDeclaration.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/VarDeclaration.d Tue Aug 31 23:57:32 2010 +0100 @@ -276,7 +276,7 @@ Expression einit = ie; if (ie && ie.op == TOK.TOKtuple) - { einit = cast(Expression)(cast(TupleExp)ie).exps.data[i]; + { einit = (cast(TupleExp)ie).exps[i]; } Initializer ti = init; if (einit) diff -r 3f02152c5e68 -r 3482c73a991b dmd/backend/iasm.d --- a/dmd/backend/iasm.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/backend/iasm.d Tue Aug 31 23:57:32 2010 +0100 @@ -3434,7 +3434,7 @@ error(asmstate.loc, "tuple index %u exceeds %u", index, tup.objects.dim); else { - Object o = cast(Object)tup.objects.data[index]; + Object o = tup.objects[index]; if (auto d = cast(Dsymbol)o) { o1.s = d; diff -r 3f02152c5e68 -r 3482c73a991b dmd/codegen/Util.d --- a/dmd/codegen/Util.d Wed Sep 01 00:14:27 2010 +0200 +++ b/dmd/codegen/Util.d Tue Aug 31 23:57:32 2010 +0100 @@ -728,13 +728,13 @@ { for (size_t i = 0; i < td.objects.dim; i++) { - auto o = cast(Object)td.objects.data[i]; + auto o = td.objects[i]; ///if (o.dyncast() == DYNCAST_EXPRESSION) - if (Expression eo = cast(Expression)o) + if (auto eo = cast(Expression)o) { if (eo.op == TOK.TOKdsymbol) { - DsymbolExp se = cast(DsymbolExp)eo; + auto se = cast(DsymbolExp)eo; e = el_combine(e, Dsymbol_toElem(se.s, irs)); } }