Commit 568368a
authored
[Support] Make readNext default to unaligned (#88808)
Without this patch, you would typically use readNext as:
readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr)
which is quite mouthful. Since most serialization/deserialization
operations are unaligned accesses, this patch makes the alignment
template parameter default to unaligned, allowing us to say:
readNext<uint32_t, llvm::endianness::little>(Ptr)
I'm including a few examples of migration in this patch. I'll do the
rest in a separate patch.
Note that writeNext already has the same trick for the alignment
template parameter.1 parent 5f68072 commit 568368a
2 files changed
+5
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
| 371 | + | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
377 | | - | |
378 | | - | |
| 376 | + | |
379 | 377 | | |
380 | 378 | | |
381 | 379 | | |
| |||
473 | 471 | | |
474 | 472 | | |
475 | 473 | | |
476 | | - | |
477 | | - | |
| 474 | + | |
478 | 475 | | |
479 | 476 | | |
480 | 477 | | |
| |||
0 commit comments