Enforce type consistency for most DValues

At the cost of some more bitcasts.
This commit is contained in:
Martin 2016-07-17 06:20:33 +02:00
parent 88b19d3d51
commit d6dcc7a4db
7 changed files with 78 additions and 99 deletions

View file

@ -261,8 +261,8 @@ DValue *binBitwise(Loc &loc, Type *type, Expression *lhs, Expression *rhs,
bool loadLhsAfterRhs) {
auto rvals = evalSides(lhs, rhs, loadLhsAfterRhs);
LLValue *l = DtoRVal(rvals.lhs);
LLValue *r = DtoRVal(DtoCast(loc, rvals.rhs, lhs->type));
LLValue *l = DtoRVal(DtoCast(loc, rvals.lhs, type));
LLValue *r = DtoRVal(DtoCast(loc, rvals.rhs, type));
LLValue *res = llvm::BinaryOperator::Create(binOp, l, r, "", gIR->scopebb());
return new DImValue(type, res);