================
@@ -6378,10 +6378,8 @@ static GEPOffsetAndOverflow EmitGEPOffsetInBytes(Value
*BasePtr, Value *GEPVal,
if (isa<llvm::Constant>(GEPVal)) {
// Compute the offset by casting both pointers to integers and subtracting:
// GEPVal = BasePtr + ptr(Offset) <--> Offset = int(GEPVal) - int(BasePtr)
- Value *BasePtr_int =
- Builder.CreatePtrToInt(BasePtr, DL.getIntPtrType(BasePtr->getType()));
- Value *GEPVal_int =
- Builder.CreatePtrToInt(GEPVal, DL.getIntPtrType(GEPVal->getType()));
+ Value *BasePtr_int = Builder.CreatePtrToAddr(BasePtr);
+ Value *GEPVal_int = Builder.CreatePtrToAddr(GEPVal);
----------------
efriedma-quic wrote:
Sure, that's fine.
https://github.com/llvm/llvm-project/pull/223446
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits