Mercurial > projects > ddmd
comparison dmd/IdentityExp.d @ 137:09c858522d55
merge
author | Trass3r |
---|---|
date | Mon, 13 Sep 2010 23:29:00 +0200 |
parents | af1bebfd96a4 |
children | e3afd1303184 |
comparison
equal
deleted
inserted
replaced
136:9d194c848e3a | 137:09c858522d55 |
---|---|
51 assert(false); | 51 assert(false); |
52 } | 52 } |
53 | 53 |
54 override Expression optimize(int result) | 54 override Expression optimize(int result) |
55 { | 55 { |
56 Expression e; | |
57 | |
58 //printf("IdentityExp.optimize(result = %d) %s\n", result, toChars()); | 56 //printf("IdentityExp.optimize(result = %d) %s\n", result, toChars()); |
59 e1 = e1.optimize(WANT.WANTvalue | (result & WANT.WANTinterpret)); | 57 e1 = e1.optimize(WANT.WANTvalue | (result & WANT.WANTinterpret)); |
60 e2 = e2.optimize(WANT.WANTvalue | (result & WANT.WANTinterpret)); | 58 e2 = e2.optimize(WANT.WANTvalue | (result & WANT.WANTinterpret)); |
61 e = this; | 59 Expression e = this; |
62 | 60 |
63 if ((this.e1.isConst() && this.e2.isConst()) || (this.e1.op == TOK.TOKnull && this.e2.op == TOK.TOKnull)) | 61 if ((this.e1.isConst() && this.e2.isConst()) || (this.e1.op == TOK.TOKnull && this.e2.op == TOK.TOKnull)) |
64 { | 62 { |
65 e = Identity(op, type, this.e1, this.e2); | 63 e = Identity(op, type, this.e1, this.e2); |
66 if (e is EXP_CANT_INTERPRET) | 64 if (e is EXP_CANT_INTERPRET) |