These functions already exist llvm/Support/Endian.h as llvm::endian::{read,write}<{u,}int{8,16,32,64}_t, endianness, alignment>. If you would like the short names, typedef these. http://reviews.llvm.org/D7927 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/