Skip to content

Commit bcd3575

Browse files
andykaylormahesh-attarde
authored andcommitted
[CIR][NFC] Fix CIR build (llvm#161577)
This fixes the CIR build after recent changes to CharUnits.
1 parent 7cc8408 commit bcd3575

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,20 +615,20 @@ void CIRRecordLowering::determinePacked(bool nvBaseType) {
615615
continue;
616616
// If any member falls at an offset that it not a multiple of its alignment,
617617
// then the entire record must be packed.
618-
if (member.offset % getAlignment(member.data))
618+
if (!member.offset.isMultipleOf(getAlignment(member.data)))
619619
packed = true;
620620
if (member.offset < nvSize)
621621
nvAlignment = std::max(nvAlignment, getAlignment(member.data));
622622
alignment = std::max(alignment, getAlignment(member.data));
623623
}
624624
// If the size of the record (the capstone's offset) is not a multiple of the
625625
// record's alignment, it must be packed.
626-
if (members.back().offset % alignment)
626+
if (!members.back().offset.isMultipleOf(alignment))
627627
packed = true;
628628
// If the non-virtual sub-object is not a multiple of the non-virtual
629629
// sub-object's alignment, it must be packed. We cannot have a packed
630630
// non-virtual sub-object and an unpacked complete object or vise versa.
631-
if (nvSize % nvAlignment)
631+
if (!nvSize.isMultipleOf(nvAlignment))
632632
packed = true;
633633
// Update the alignment of the sentinel.
634634
if (!packed)

0 commit comments

Comments
 (0)