Mercurial > projects > ldc
comparison dmd/expression.c @ 1630:44b145be2ef5
Merge dmd 1.056.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 06 Feb 2010 15:53:52 +0000 |
parents | b07d683ba4d0 |
children | 9bf06e02070b |
comparison
equal
deleted
inserted
replaced
1629:b07d683ba4d0 | 1630:44b145be2ef5 |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2009 by Digital Mars | 3 // Copyright (c) 1999-2010 by Digital Mars |
4 // All Rights Reserved | 4 // All Rights Reserved |
5 // written by Walter Bright | 5 // written by Walter Bright |
6 // http://www.digitalmars.com | 6 // http://www.digitalmars.com |
7 // License for redistribution is by either the Artistic License | 7 // License for redistribution is by either the Artistic License |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | 8 // in artistic.txt, or the GNU General Public License in gnu.txt. |
3708 { | 3708 { |
3709 error("outer function context of %s is needed to 'new' nested class %s", fdn->toPrettyChars(), cd->toPrettyChars()); | 3709 error("outer function context of %s is needed to 'new' nested class %s", fdn->toPrettyChars(), cd->toPrettyChars()); |
3710 break; | 3710 break; |
3711 } | 3711 } |
3712 } | 3712 } |
3713 | |
3714 } | 3713 } |
3715 } | 3714 } |
3716 else if (thisexp) | 3715 else if (thisexp) |
3717 error("e.new is only for allocating nested classes"); | 3716 error("e.new is only for allocating nested classes"); |
3718 | 3717 |
8775 e1->checkNoBool(); | 8774 e1->checkNoBool(); |
8776 type = e1->type; | 8775 type = e1->type; |
8777 typeCombine(sc); | 8776 typeCombine(sc); |
8778 e1->checkIntegral(); | 8777 e1->checkIntegral(); |
8779 e2 = e2->checkIntegral(); | 8778 e2 = e2->checkIntegral(); |
8780 //e2 = e2->castTo(sc, Type::tshiftcnt); | 8779 #if !IN_LLVM |
8781 e2 = e2->castTo(sc, e1->type); // LDC | 8780 e2 = e2->castTo(sc, Type::tshiftcnt); |
8781 #else | |
8782 e2 = e2->castTo(sc, e1->type); | |
8783 #endif | |
8782 return this; | 8784 return this; |
8783 } | 8785 } |
8784 | 8786 |
8785 /************************************************************/ | 8787 /************************************************************/ |
8786 | 8788 |
8804 e1->checkNoBool(); | 8806 e1->checkNoBool(); |
8805 type = e1->type; | 8807 type = e1->type; |
8806 typeCombine(sc); | 8808 typeCombine(sc); |
8807 e1->checkIntegral(); | 8809 e1->checkIntegral(); |
8808 e2 = e2->checkIntegral(); | 8810 e2 = e2->checkIntegral(); |
8809 //e2 = e2->castTo(sc, Type::tshiftcnt); | 8811 #if !IN_LLVM |
8810 e2 = e2->castTo(sc, e1->type); // LDC | 8812 e2 = e2->castTo(sc, Type::tshiftcnt); |
8813 #else | |
8814 e2 = e2->castTo(sc, e1->type); | |
8815 #endif | |
8811 return this; | 8816 return this; |
8812 } | 8817 } |
8813 | 8818 |
8814 /************************************************************/ | 8819 /************************************************************/ |
8815 | 8820 |
8833 e1->checkNoBool(); | 8838 e1->checkNoBool(); |
8834 type = e1->type; | 8839 type = e1->type; |
8835 typeCombine(sc); | 8840 typeCombine(sc); |
8836 e1->checkIntegral(); | 8841 e1->checkIntegral(); |
8837 e2 = e2->checkIntegral(); | 8842 e2 = e2->checkIntegral(); |
8838 //e2 = e2->castTo(sc, Type::tshiftcnt); | 8843 #if !IN_LLVM |
8839 e2 = e2->castTo(sc, e1->type); // LDC | 8844 e2 = e2->castTo(sc, Type::tshiftcnt); |
8845 #else | |
8846 e2 = e2->castTo(sc, e1->type); | |
8847 #endif | |
8840 return this; | 8848 return this; |
8841 } | 8849 } |
8842 | 8850 |
8843 /************************************************************/ | 8851 /************************************************************/ |
8844 | 8852 |
9321 if (e) | 9329 if (e) |
9322 return e; | 9330 return e; |
9323 e1 = e1->checkIntegral(); | 9331 e1 = e1->checkIntegral(); |
9324 e2 = e2->checkIntegral(); | 9332 e2 = e2->checkIntegral(); |
9325 e1 = e1->integralPromotions(sc); | 9333 e1 = e1->integralPromotions(sc); |
9326 //e2 = e2->castTo(sc, Type::tshiftcnt); | 9334 #if !IN_LLVM |
9327 e2 = e2->castTo(sc, e1->type); // LDC | 9335 e2 = e2->castTo(sc, Type::tshiftcnt); |
9336 #else | |
9337 e2 = e2->castTo(sc, e1->type); | |
9338 #endif | |
9328 type = e1->type; | 9339 type = e1->type; |
9329 } | 9340 } |
9330 return this; | 9341 return this; |
9331 } | 9342 } |
9332 | 9343 |
9346 if (e) | 9357 if (e) |
9347 return e; | 9358 return e; |
9348 e1 = e1->checkIntegral(); | 9359 e1 = e1->checkIntegral(); |
9349 e2 = e2->checkIntegral(); | 9360 e2 = e2->checkIntegral(); |
9350 e1 = e1->integralPromotions(sc); | 9361 e1 = e1->integralPromotions(sc); |
9351 //e2 = e2->castTo(sc, Type::tshiftcnt); | 9362 #if !IN_LLVM |
9352 e2 = e2->castTo(sc, e1->type); // LDC | 9363 e2 = e2->castTo(sc, Type::tshiftcnt); |
9364 #else | |
9365 e2 = e2->castTo(sc, e1->type); | |
9366 #endif | |
9353 type = e1->type; | 9367 type = e1->type; |
9354 } | 9368 } |
9355 return this; | 9369 return this; |
9356 } | 9370 } |
9357 | 9371 |
9371 if (e) | 9385 if (e) |
9372 return e; | 9386 return e; |
9373 e1 = e1->checkIntegral(); | 9387 e1 = e1->checkIntegral(); |
9374 e2 = e2->checkIntegral(); | 9388 e2 = e2->checkIntegral(); |
9375 e1 = e1->integralPromotions(sc); | 9389 e1 = e1->integralPromotions(sc); |
9376 //e2 = e2->castTo(sc, Type::tshiftcnt); | 9390 #if !IN_LLVM |
9377 e2 = e2->castTo(sc, e1->type); // LDC | 9391 e2 = e2->castTo(sc, Type::tshiftcnt); |
9392 #else | |
9393 e2 = e2->castTo(sc, e1->type); | |
9394 #endif | |
9378 type = e1->type; | 9395 type = e1->type; |
9379 } | 9396 } |
9380 return this; | 9397 return this; |
9381 } | 9398 } |
9382 | 9399 |