/// bitcast to pointer type.
llvm::Constant *
ConstantLValueEmitter::tryEmitAbsolute(llvm::Type *destTy) {
- auto offset = getOffset();
-
// If we're producing a pointer, this is easy.
auto destPtrTy = cast<llvm::PointerType>(destTy);
if (Value.isNullPointer()) {
// to a pointer.
// FIXME: signedness depends on the original integer type.
auto intptrTy = CGM.getDataLayout().getIntPtrType(destPtrTy);
- llvm::Constant *C = offset;
+ llvm::Constant *C;
C = llvm::ConstantExpr::getIntegerCast(getOffset(), intptrTy,
/*isSigned*/ false);
C = llvm::ConstantExpr::getIntToPtr(C, destPtrTy);