r240228 - ASTReader: Copy input file offset data to avoid unaligned accesses

Justin Bogner mail at justinbogner.com
Sun Jun 21 13:37:09 PDT 2015


David Majnemer <david.majnemer at gmail.com> writes:
> On Sat, Jun 20, 2015 at 5:01 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
>
>     Can we fix the users of this pointer instead of eagerly making a copy of
>     the data?
>    
> What if we made it a pointer to a `unaligned_int64_t` ?

Directly fixing the users is a bit awkward, since they generally just do
array accesses, but using unaligned_int64_t is a nice way to shift the
burden to the users instead of doing the work up front. I've reverted
this change and done it that way in r240247.

Rafael EspĂ­ndola <rafael.espindola at gmail.com> writes:
> Or make sure it is aligned when writing?

This is probably possible by adding some padding when we emit this in
ASTWriter::WriteInputFiles, but I don't really see anything in the
BitStream stuff that makes any guarantees about alignment of blobs, so
I'm not sure how workable that is.




More information about the cfe-commits mailing list