Skip to content

Commit 1bc3c96

Browse files
committed
Correct the comment of the function llsize_of_real
Consult the issue #20460
1 parent ea6f65c commit 1bc3c96

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_trans/trans/machine.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ pub fn llsize_of_alloc(cx: &CrateContext, ty: Type) -> llsize {
4343

4444
// Returns, as near as we can figure, the "real" size of a type. As in, the
4545
// bits in this number of bytes actually carry data related to the datum
46-
// with the type. Not junk, padding, accidentally-damaged words, or
47-
// whatever. Rounds up to the nearest byte though, so if you have a 1-bit
46+
// with the type. Not junk, accidentally-damaged words, or whatever.
47+
// Note that padding of the type will be included for structs, but not for the
48+
// other types (i.e. SIMD types).
49+
// Rounds up to the nearest byte though, so if you have a 1-bit
4850
// value, we return 1 here, not 0. Most of rustc works in bytes. Be warned
4951
// that LLVM *does* distinguish between e.g. a 1-bit value and an 8-bit value
5052
// at the codegen level! In general you should prefer `llbitsize_of_real`

0 commit comments

Comments
 (0)