LLVM 17.0.0git
|
Classes | |
struct | Writer |
Adapter to write values to a stream in a particular byte order. More... | |
Typedefs | |
template<typename value_type > | |
using | make_unsigned_t = std::make_unsigned_t< value_type > |
Functions | |
constexpr endianness | system_endianness () |
template<typename value_type > | |
value_type | byte_swap (value_type value, endianness endian) |
template<typename value_type , endianness endian> | |
value_type | byte_swap (value_type value) |
Swap the bytes of value to match the given endianness. | |
template<typename value_type , std::size_t alignment> | |
value_type | read (const void *memory, endianness endian) |
Read a value of a particular endianness from memory. | |
template<typename value_type , endianness endian, std::size_t alignment> | |
value_type | read (const void *memory) |
template<typename value_type , std::size_t alignment, typename CharT > | |
value_type | readNext (const CharT *&memory, endianness endian) |
Read a value of a particular endianness from a buffer, and increment the buffer past that value. | |
template<typename value_type , endianness endian, std::size_t alignment, typename CharT > | |
value_type | readNext (const CharT *&memory) |
template<typename value_type , std::size_t alignment> | |
void | write (void *memory, value_type value, endianness endian) |
Write a value to memory with a particular endianness. | |
template<typename value_type , endianness endian, std::size_t alignment> | |
void | write (void *memory, value_type value) |
template<typename value_type , endianness endian, std::size_t alignment> | |
value_type | readAtBitAlignment (const void *memory, uint64_t startBit) |
Read a value of a particular endianness from memory, for a location that starts at the given bit offset within the first byte. | |
template<typename value_type , endianness endian, std::size_t alignment> | |
void | writeAtBitAlignment (void *memory, value_type value, uint64_t startBit) |
Write a value to memory with a particular endianness, for a location that starts at the given bit offset within the first byte. | |
template<typename T > | |
T | read (const void *P, endianness E) |
template<typename T , endianness E> | |
T | read (const void *P) |
uint16_t | read16 (const void *P, endianness E) |
uint32_t | read32 (const void *P, endianness E) |
uint64_t | read64 (const void *P, endianness E) |
template<endianness E> | |
uint16_t | read16 (const void *P) |
template<endianness E> | |
uint32_t | read32 (const void *P) |
template<endianness E> | |
uint64_t | read64 (const void *P) |
uint16_t | read16le (const void *P) |
uint32_t | read32le (const void *P) |
uint64_t | read64le (const void *P) |
uint16_t | read16be (const void *P) |
uint32_t | read32be (const void *P) |
uint64_t | read64be (const void *P) |
template<typename T > | |
void | write (void *P, T V, endianness E) |
template<typename T , endianness E> | |
void | write (void *P, T V) |
void | write16 (void *P, uint16_t V, endianness E) |
void | write32 (void *P, uint32_t V, endianness E) |
void | write64 (void *P, uint64_t V, endianness E) |
template<endianness E> | |
void | write16 (void *P, uint16_t V) |
template<endianness E> | |
void | write32 (void *P, uint32_t V) |
template<endianness E> | |
void | write64 (void *P, uint64_t V) |
void | write16le (void *P, uint16_t V) |
void | write32le (void *P, uint32_t V) |
void | write64le (void *P, uint64_t V) |
void | write16be (void *P, uint16_t V) |
void | write32be (void *P, uint32_t V) |
void | write64be (void *P, uint64_t V) |
template<typename value_type > | |
void | write (raw_ostream &os, value_type value, endianness endian) |
template<> | |
void | write< float > (raw_ostream &os, float value, endianness endian) |
template<> | |
void | write< double > (raw_ostream &os, double value, endianness endian) |
template<typename value_type > | |
void | write (raw_ostream &os, ArrayRef< value_type > vals, endianness endian) |
template<typename value_type > | |
void | write (SmallVectorImpl< char > &Out, value_type V, endianness E) |
using llvm::support::endian::make_unsigned_t = typedef std::make_unsigned_t<value_type> |
|
inline |
Swap the bytes of value to match the given endianness.
Definition at line 57 of file Endian.h.
References byte_swap(), and value.
|
inline |
Definition at line 49 of file Endian.h.
References llvm::support::native, llvm::sys::swapByteOrder(), system_endianness(), and value.
Referenced by llvm::HashBuilderImpl< HasherT, Endianness >::adjustForEndiannessAndAdd(), byte_swap(), llvm::MCStreamer::emitIntValue(), llvm::gsym::FileWriter::fixup32(), llvm::M68k::swapWord(), llvm::gsym::FileWriter::writeU16(), llvm::gsym::FileWriter::writeU32(), and llvm::gsym::FileWriter::writeU64().
|
inline |
|
inline |
Read a value of a particular endianness from memory.
Definition at line 63 of file Endian.h.
References LLVM_ASSUME_ALIGNED.
Referenced by llvm::sys::fs::copy_file_internal(), and llvm::sys::fs::md5_contents().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 383 of file Endian.h.
References P.
Referenced by M68kDisassembler::getInstruction().
Definition at line 380 of file Endian.h.
References P.
Referenced by llvm::add16(), discoverTypeIndices(), llvm::object::Archive::ec_symbols(), getEncodedIntegerLength(), llvm::object::Archive::Symbol::getMember(), handleFieldList(), handleMethodOverloadList(), and handleOneMethod().
|
inline |
|
inline |
Definition at line 363 of file Endian.h.
Referenced by llvm::jitlink::aarch32::readAddendData().
Definition at line 384 of file Endian.h.
References P.
Referenced by llvm::object::doesXCOFFTracebackTableBegin(), llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::getNumberOfSymbols(), llvm::object::Archive::symbol_begin(), llvm::SHA1::update(), and llvm::SHA256::update().
Definition at line 381 of file Endian.h.
References P.
Referenced by analyzeHeader(), discoverTypeIndices(), llvm::object::Archive::ec_symbols(), llvm::X86_MC::findX86_64PltEntries(), llvm::X86_MC::findX86PltEntries(), llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::Symbol::getNext(), llvm::object::Archive::getNumberOfECSymbols(), llvm::object::Archive::getNumberOfSymbols(), handlePointer(), llvm::identify_magic(), or32le(), llvm::or32le(), llvm::RuntimeDyldCOFFAArch64::processRelocationRef(), readUint32(), llvm::jitlink::relaxCall(), llvm::RuntimeDyldCOFFAArch64::resolveRelocation(), llvm::SkipBitcodeWrapperHeader(), llvm::object::Archive::symbol_begin(), write32AArch64Addr(), llvm::write32AArch64Addr(), llvm::write32AArch64Imm(), llvm::write32AArch64Ldr(), and llvm::xxHash64().
|
inline |
|
inline |
Definition at line 366 of file Endian.h.
Referenced by llvm::CodeGenCoverage::parse().
Definition at line 385 of file Endian.h.
References P.
Referenced by appendGlobalSymbolTableInfo(), llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::getNumberOfSymbols(), and llvm::object::Archive::symbol_begin().
Definition at line 382 of file Endian.h.
References P.
Referenced by llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::getNumberOfSymbols(), llvm::RuntimeDyldCOFFAArch64::processRelocationRef(), llvm::object::Archive::symbol_begin(), and llvm::xxHash64().
|
inline |
Read a value of a particular endianness from memory, for a location that starts at the given bit offset within the first byte.
Definition at line 117 of file Endian.h.
References assert(), and LLVM_ASSUME_ALIGNED.
|
inline |
|
inline |
|
constexpr |
Definition at line 44 of file Endian.h.
References llvm::support::big, llvm::sys::IsBigEndianHost, and llvm::support::little.
Referenced by llvm::HashBuilderImpl< HasherT, Endianness >::add(), byte_swap(), llvm::gsym::FunctionInfo::cacheEncoding(), and llvm::gsym::FunctionInfo::encode().
|
inline |
Definition at line 46 of file EndianStream.h.
References write().
|
inline |
Definition at line 29 of file EndianStream.h.
References value, and llvm::raw_ostream::write().
|
inline |
Definition at line 53 of file EndianStream.h.
References llvm::SmallVectorImpl< T >::append(), and E.
|
inline |
|
inline |
Write a value to memory with a particular endianness.
Definition at line 97 of file Endian.h.
References LLVM_ASSUME_ALIGNED, and value.
Referenced by llvm::MSP430MCCodeEmitter::encodeInstruction(), print(), printLE(), llvm::support::endian::Writer::write(), write(), write< double >(), write< float >(), llvm::ARMAsmBackend::writeNopData(), and llvm::MachObjectWriter::writeObject().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 415 of file Endian.h.
References P.
Referenced by llvm::add16(), and llvm::jitlink::finalizeBlockRelax().
|
inline |
|
inline |
|
inline |
Definition at line 419 of file Endian.h.
References P.
Referenced by llvm::StringTableBuilder::write().
|
inline |
Definition at line 416 of file Endian.h.
References P, and write32le().
Referenced by llvm::computeLTOCacheKey(), llvm::objcopy::coff::createGnuDebugLinkSectionContents(), llvm::MD5::final(), llvm::jitlink::finalizeBlockRelax(), getSourceLineHash(), or32le(), llvm::or32le(), llvm::RuntimeDyldCOFFAArch64::resolveRelocation(), llvm::objcopy::wasm::Writer::write(), llvm::StringTableBuilder::write(), write32AArch64Addr(), llvm::write32AArch64Addr(), llvm::write32AArch64Imm(), write32le(), writeInt32ToBuffer(), llvm::object::writeStringTable(), and writeUint32().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 417 of file Endian.h.
References P.
Referenced by llvm::computeLTOCacheKey(), emitStrTab(), emitVersion(), llvm::BlockCoverageInference::getInstrumentedBlocksHash(), llvm::RuntimeDyldCOFFAArch64::resolveRelocation(), and writeUint64().
|
inline |
Definition at line 40 of file EndianStream.h.
|
inline |
Definition at line 35 of file EndianStream.h.
|
inline |
Write a value to memory with a particular endianness, for a location that starts at the given bit offset within the first byte.
Definition at line 151 of file Endian.h.
References assert(), LLVM_ASSUME_ALIGNED, and value.