From 862566613255b50db33aabc12397b21bb99433da Mon Sep 17 00:00:00 2001 From: kai Date: Sun, 31 Mar 2013 05:01:40 +0200 Subject: [PATCH] Wrap LDC specific code. --- dmd2/expression.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/dmd2/expression.c b/dmd2/expression.c index f89a44fb..9fd2eb1c 100644 --- a/dmd2/expression.c +++ b/dmd2/expression.c @@ -6414,10 +6414,10 @@ Expression *BinAssignExp::semantic(Scope *sc) } if (shift) { -#if IN_DMD - e2 = e2->castTo(sc, Type::tshiftcnt); -#elif IN_LLVM +#if IN_LLVM e2 = e2->castTo(sc, e1->type); +#else + e2 = e2->castTo(sc, Type::tshiftcnt); #endif } @@ -11801,8 +11801,11 @@ Expression *ShlExp::semantic(Scope *sc) e2->type->toBasetype()->ty == Tvector) return incompatibleTypes(); e1 = e1->integralPromotions(sc); - //e2 = e2->castTo(sc, Type::tshiftcnt); - e2 = e2->castTo(sc, e1->type); // LDC +#if IN_LLVM + e2 = e2->castTo(sc, e1->type); +#else + e2 = e2->castTo(sc, Type::tshiftcnt); +#endif type = e1->type; } return this; @@ -11829,8 +11832,11 @@ Expression *ShrExp::semantic(Scope *sc) e2->type->toBasetype()->ty == Tvector) return incompatibleTypes(); e1 = e1->integralPromotions(sc); - //e2 = e2->castTo(sc, Type::tshiftcnt); - e2 = e2->castTo(sc, e1->type); // LDC +#if IN_LLVM + e2 = e2->castTo(sc, e1->type); +#else + e2 = e2->castTo(sc, Type::tshiftcnt); +#endif type = e1->type; } return this; @@ -11857,8 +11863,11 @@ Expression *UshrExp::semantic(Scope *sc) e2->type->toBasetype()->ty == Tvector) return incompatibleTypes(); e1 = e1->integralPromotions(sc); - //e2 = e2->castTo(sc, Type::tshiftcnt); - e2 = e2->castTo(sc, e1->type); // LDC +#if IN_LLVM + e2 = e2->castTo(sc, e1->type); +#else + e2 = e2->castTo(sc, Type::tshiftcnt); +#endif type = e1->type; } return this;