================
@@ -274,9 +274,10 @@ Value *EmitFromInt(CodeGenFunction &CGF, llvm::Value *V,
Address CheckAtomicAlignment(CodeGenFunction &CGF, const CallExpr *E) {
ASTContext &Ctx = CGF.getContext();
Address Ptr = CGF.EmitPointerWithAlignment(E->getArg(0));
+ const llvm::DataLayout &DL = CGF.CGM.getDataLayout();
unsigned Bytes = Ptr.getElementType()->isPointerTy()
? Ctx.getTypeSizeInChars(Ctx.VoidPtrTy).getQuantity()
- : Ptr.getElementType()->getScalarSizeInBits() / 8;
+ : DL.getTypeSizeInBits(Ptr.getElementType()) / 8;
----------------
arsenm wrote:
```suggestion
: DL.getTypeStoreSize(Ptr.getElementType());
```
https://github.com/llvm/llvm-project/pull/141053
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits