Mercurial > projects > ddmd
comparison dmd/VarDeclaration.d @ 84:be2ab491772e
Expressions -> Vector!Expression
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 30 Aug 2010 16:12:19 +0100 |
parents | ad4792a1cfd6 |
children | 23280d154c5b |
comparison
equal
deleted
inserted
replaced
83:ee670dd808a8 | 84:be2ab491772e |
---|---|
1 module dmd.VarDeclaration; | 1 module dmd.VarDeclaration; |
2 | 2 |
3 import dmd.Array; | |
3 import dmd.Declaration; | 4 import dmd.Declaration; |
4 import dmd.SliceExp; | 5 import dmd.SliceExp; |
5 import dmd.ClassDeclaration; | 6 import dmd.ClassDeclaration; |
6 import dmd.DeleteExp; | 7 import dmd.DeleteExp; |
7 import dmd.SymOffExp; | 8 import dmd.SymOffExp; |
859 { | 860 { |
860 // Typeinfo.destroy(cast(void*)&v); | 861 // Typeinfo.destroy(cast(void*)&v); |
861 Expression ea = new SymOffExp(loc, this, 0, 0); | 862 Expression ea = new SymOffExp(loc, this, 0, 0); |
862 ea = new CastExp(loc, ea, Type.tvoid.pointerTo()); | 863 ea = new CastExp(loc, ea, Type.tvoid.pointerTo()); |
863 Expressions args = new Expressions(); | 864 Expressions args = new Expressions(); |
864 args.push(cast(void*)ea); | 865 args.push(ea); |
865 | 866 |
866 Expression et = type.getTypeInfo(sc); | 867 Expression et = type.getTypeInfo(sc); |
867 et = new DotIdExp(loc, et, Id.destroy); | 868 et = new DotIdExp(loc, et, Id.destroy); |
868 | 869 |
869 e = new CallExp(loc, et, args); | 870 e = new CallExp(loc, et, args); |
962 if (fdv && fdthis && fdv !is fdthis) | 963 if (fdv && fdthis && fdv !is fdthis) |
963 { | 964 { |
964 if (loc.filename) | 965 if (loc.filename) |
965 fdthis.getLevel(loc, fdv); | 966 fdthis.getLevel(loc, fdv); |
966 | 967 |
967 foreach(FuncDeclaration f; nestedrefs) | 968 foreach (f; nestedrefs) |
968 { | 969 { |
969 if (f == fdthis) | 970 if (f == fdthis) |
970 goto L1; | 971 goto L1; |
971 } | 972 } |
972 nestedrefs.push(fdthis); | 973 nestedrefs.push(fdthis); |
973 L1: ; | 974 L1: ; |
974 | 975 |
975 foreach(s; fdv.closureVars) | 976 foreach (s; fdv.closureVars) |
976 { | 977 { |
977 if (s == this) | 978 if (s == this) |
978 goto L2; | 979 goto L2; |
979 } | 980 } |
980 | 981 |
1246 } | 1247 } |
1247 | 1248 |
1248 // Eliminate need for dynamic_cast | 1249 // Eliminate need for dynamic_cast |
1249 override VarDeclaration isVarDeclaration() { return this; } | 1250 override VarDeclaration isVarDeclaration() { return this; } |
1250 } | 1251 } |
1252 | |
1253 alias Vector!VarDeclaration VarDeclarations; |