Skip to content

Commit 78eb2c2

Browse files
[clang] Preserve argument type in round pointer to alignment
1 parent 16711b4 commit 78eb2c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/ABIInfoImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ llvm::Value *CodeGen::emitRoundPointerUpToAlignment(CodeGenFunction &CGF,
157157
llvm::Value *RoundUp = CGF.Builder.CreateConstInBoundsGEP1_32(
158158
CGF.Builder.getInt8Ty(), Ptr, Align.getQuantity() - 1);
159159
return CGF.Builder.CreateIntrinsic(
160-
llvm::Intrinsic::ptrmask, {CGF.AllocaInt8PtrTy, CGF.IntPtrTy},
160+
llvm::Intrinsic::ptrmask, {Ptr->getType(), CGF.IntPtrTy},
161161
{RoundUp, llvm::ConstantInt::get(CGF.IntPtrTy, -Align.getQuantity())},
162162
nullptr, Ptr->getName() + ".aligned");
163163
}

0 commit comments

Comments
 (0)