Skip to content

Commit 9e10851

Browse files
committed
Add modulus for size and alignment
1 parent aefce6e commit 9e10851

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/LLVM/Units.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public struct Size {
139139
let value = self.rawValue + mask
140140
return Size(value & ~mask)
141141
}
142+
143+
public static func % (lhs: Size, rhs: Alignment) -> Size {
144+
return Size(lhs.rawValue % UInt64(rhs.rawValue))
145+
}
142146
}
143147

144148
extension Size: UnsignedInteger {

0 commit comments

Comments
 (0)