[clang] [CIR][NFC] Fix CIR build after CharUnits change (PR #161580)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 13:34:06 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Andy Kaylor (andykaylor)

<details>
<summary>Changes</summary>

My previous attempt to fix this missed one case.

---
Full diff: https://github.com/llvm/llvm-project/pull/161580.diff


1 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
index bf812c8a1793b..2baeb43c48b2e 100644
--- a/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp
@@ -824,7 +824,7 @@ void CIRRecordLowering::lowerUnion() {
     appendPaddingBytes(layoutSize - getSize(storageType));
 
   // Set packed if we need it.
-  if (layoutSize % getAlignment(storageType))
+  if (!layoutSize.isMultipleOf(getAlignment(storageType)))
     packed = true;
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/161580


More information about the cfe-commits mailing list