This is an archive of the discontinued LLVM Phabricator instance.

Add {read,write}{16,32,64}{le,be} functions
ClosedPublic

Authored by ruiu on Feb 27 2015, 2:12 PM.

Details

Reviewers
Bigcheese
Summary

Add convenient functions for endianness-aware reads/writes to llvm::support::endian.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 20898.Feb 27 2015, 2:12 PM
ruiu retitled this revision from to Add {read,write}{16,32,64}{le,be} functions.
ruiu updated this object.
ruiu edited the test plan for this revision. (Show Details)
ruiu added a reviewer: Bigcheese.
ruiu added a subscriber: Unknown Object (MLST).
davide added a subscriber: davide.Mar 1 2015, 10:14 PM

Probably doesn't really belong to Endian, but it would be nice to have some write8()/read8(). It can be used, e.g. for R_X86_64_8 handling.

Bigcheese accepted this revision.Mar 2 2015, 10:02 AM
Bigcheese edited edge metadata.

lgtm. We should also make sure to remove the 50 other versions of this we have spread throughout llvm.

This revision is now accepted and ready to land.Mar 2 2015, 10:02 AM
ruiu added a comment.Mar 8 2015, 11:48 PM

I deliberately excluded write8/read8 because single byte read has no
endianness issue. I understand that that feels good for completeness, but
they are for nonexistent issues. We could just cast to uint8_t and do the
stuff.

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r231002.