- if (MTy == Type::Int8Ty) {
- if (Size == 8)
- NewPtrTy = PointerType::get(Type::Int64Ty);
- else if (Size == 4)
- NewPtrTy = PointerType::get(Type::Int32Ty);
- else if (Size == 2)
- NewPtrTy = PointerType::get(Type::Int16Ty);
- else if (Size == 1)
- NewPtrTy = PointerType::get(Type::Int8Ty);
- } else if (MTy == Type::Int16Ty) {
- if (Size == 4)
- NewPtrTy = PointerType::get(Type::Int64Ty);
- else if (Size == 2)
- NewPtrTy = PointerType::get(Type::Int32Ty);
- else if (Size == 1)
- NewPtrTy = PointerType::get(Type::Int16Ty);
- } else if (MTy == Type::Int32Ty) {
- if (Size == 2)
- NewPtrTy = PointerType::get(Type::Int64Ty);
- else if (Size == 1)
- NewPtrTy = PointerType::get(Type::Int32Ty);
- } else if (MTy == Type::Int64Ty) {
- if (Size == 1)
- NewPtrTy = PointerType::get(Type::Int64Ty);
- }
+ // Destination pointer type is always i8 *
+ if (Size == 8)
+ NewPtrTy = PointerType::get(Type::Int64Ty);
+ else if (Size == 4)
+ NewPtrTy = PointerType::get(Type::Int32Ty);
+ else if (Size == 2)
+ NewPtrTy = PointerType::get(Type::Int16Ty);
+ else if (Size == 1)
+ NewPtrTy = PointerType::get(Type::Int8Ty);