Ext or trunc for integers types, not bitcast.

This commit is contained in:
Stefano Sanfilippo 2015-03-09 14:26:25 +01:00
parent 1f4fec77b3
commit 2d58363c50

View File

@ -186,7 +186,7 @@ llvm::Value* coerce(BitcodeEmitter::Private *d, llvm::Value *val, llvm::Type *to
if (isFP(fromType)) { if (isFP(fromType)) {
return d->builder.CreateFPToSI(val, toType); return d->builder.CreateFPToSI(val, toType);
} else if (isInt(fromType)) { } else if (isInt(fromType)) {
return d->builder.CreateSExtOrBitCast(val, toType); return d->builder.CreateSExtOrTrunc(val, toType);
} }
} }
else if (isFP(toType) && isInt(fromType)) { else if (isFP(toType) && isInt(fromType)) {