LLVM 22.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 | |
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 = unaligned> | |
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 = unaligned, 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 = unaligned, typename CharT> | |
value_type | readNext (const CharT *&memory) |
template<typename value_type, std::size_t alignment = unaligned> | |
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, std::size_t alignment = unaligned, typename CharT> | |
void | writeNext (CharT *&memory, value_type value, endianness endian) |
Write a value of a particular endianness, and increment the buffer past that value. | |
template<typename value_type, endianness endian, std::size_t alignment = unaligned, typename CharT> | |
void | writeNext (CharT *&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, 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, 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_array (raw_ostream &os, ArrayRef< value_type > values, endianness endian) |
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 = std::make_unsigned_t<value_type> |
|
inlinenodiscard |
Swap the bytes of value to match the given endianness.
Definition at line 52 of file Endian.h.
References byte_swap().
|
inlinenodiscard |
Definition at line 44 of file Endian.h.
References llvm::native, and llvm::sys::swapByteOrder().
Referenced by llvm::HashBuilder< hashbuilder_detail::HashCodeHasher, llvm::endianness::native >::adjustForEndiannessAndAdd(), byte_swap(), llvm::coverage::BinaryCoverageReader::create(), llvm::MCStreamer::emitIntValue(), llvm::gsym::FileWriter::fixup32(), llvm::coverage::accessors::getDataSize(), llvm::coverage::accessors::getFuncHash(), llvm::coverage::accessors::getFuncNameRef(), loadTestingFormat(), llvm::CGDataOStream::patch(), llvm::ProfOStream::patch(), read(), readAtBitAlignment(), rewriteOffsetToCurrentByte(), llvm::M68k::swapWord(), llvm::coverage::TestingFormatWriter::write(), write(), write(), write(), write_array(), writeAtBitAlignment(), llvm::gsym::FileWriter::writeU16(), llvm::gsym::FileWriter::writeU32(), and llvm::gsym::FileWriter::writeU64().
|
inlinenodiscard |
|
inlinenodiscard |
Read a value of a particular endianness from memory.
Definition at line 58 of file Endian.h.
References byte_swap(), LLVM_ASSUME_ALIGNED, and llvm::support::detail::PickAlignment< T, alignment >::value.
Referenced by consume(), llvm::sys::fs::copy_file_internal(), llvm::memprof::MemProfSummary::deserialize(), eat12Bytes(), eat16Bytes(), eatBytes(), llvm::SimpleBitstreamCursor::fillCurWord(), llvm::object::Record::get(), llvm::IndexedInstrProfReader::getFunctionBitmap(), llvm::object::DirectX::RootSignature::getParameter(), llvm::IndexedCodeGenDataReader::hasFormat(), llvm::IndexedInstrProfReader::hasFormat(), llvm::MD5::MD5Result::high(), instructionsMatch(), llvm::MD5::MD5Result::low(), llvm::sys::fs::md5_contents(), llvm::support::detail::packed_endian_specific_integral< ValueType, Endian, Alignment, ALIGN >::ref::operator value_type(), llvm::memprof::CallerCalleePairExtractor::operator()(), llvm::memprof::LinearCallStackIdConverter::operator()(), llvm::object::DirectX::RootSignature::parse(), parseImmediate(), parseStrTabSize(), parseVersion(), llvm::msgpack::Reader::read(), llvm::object::DirectX::DescriptorTableView::read(), read(), read16(), read16(), read32(), read32(), read64(), read64(), readAtBitAlignment(), readInstruction32(), llvm::BinaryStreamReader::readInteger(), llvm::sampleprof::SampleProfileReaderExtBinaryBase::readNameTableSec(), readNext(), and llvm::support::detail::packed_endian_specific_integral< T, E, support::unaligned >::value().
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 405 of file Endian.h.
References E(), P, and read().
Referenced by llvm::AMDGPUDisassembler::decodeKernelDescriptor(), llvm::dwarf_linker::parallel::SectionDescriptor::getIntVal(), read16be(), and read16le().
Definition at line 434 of file Endian.h.
Referenced by M68kDisassembler::getInstruction().
Definition at line 425 of file Endian.h.
Referenced by llvm::add16(), llvm::jitlink::loongarch::applyFixup(), discoverTypeIndices(), llvm::object::Archive::ec_symbols(), getEncodedIntegerLength(), llvm::object::Archive::Symbol::getMember(), handleFieldList(), handleMethodOverloadList(), and handleOneMethod().
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 408 of file Endian.h.
References E(), P, and read().
Referenced by llvm::jitlink::ppc64::applyFixup(), llvm::dwarf_linker::parallel::SectionDescriptor::getIntVal(), read32be(), read32le(), llvm::jitlink::aarch32::readAddendData(), llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::readEncoding(), llvm::jitlink::CompactUnwindTraits< CRTPImpl, PtrSize >::readPCRangeSize(), and verifyNoteSection().
Definition at line 437 of file Endian.h.
Referenced by llvm::jitlink::aarch32::applyFixupData(), 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 428 of file Endian.h.
Referenced by analyzeHeader(), llvm::jitlink::loongarch::applyFixup(), llvm::jitlink::aarch32::applyFixupData(), discoverTypeIndices(), llvm::object::Archive::ec_symbols(), llvm::AMDGPUAsmPrinter::emitInstruction(), 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(), llvm::or32le(), or32le(), llvm::RuntimeDyldCOFFAArch64::processRelocationRef(), readUint32(), llvm::jitlink::relaxCall(), llvm::RuntimeDyldCOFFAArch64::resolveRelocation(), llvm::SkipBitcodeWrapperHeader(), llvm::object::Archive::symbol_begin(), llvm::write32AArch64Addr(), write32AArch64Addr(), llvm::write32AArch64Imm(), llvm::write32AArch64Ldr(), XXH3_len_1to3_128b(), XXH3_len_1to3_64b(), XXH3_len_4to8_128b(), XXH3_len_4to8_64b(), and llvm::xxHash64().
|
inlinenodiscard |
|
inlinenodiscard |
Definition at line 411 of file Endian.h.
References E(), P, and read().
Referenced by llvm::dwarf_linker::parallel::SectionDescriptor::getIntVal(), llvm::CodeGenCoverage::parse(), read64be(), read64le(), and llvm::jitlink::ppc64::readPrefixedInstruction().
Definition at line 440 of file Endian.h.
Referenced by appendGlobalSymbolTableInfo(), llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::getNumberOfSymbols(), and llvm::object::Archive::symbol_begin().
Definition at line 431 of file Endian.h.
Referenced by llvm::jitlink::loongarch::applyFixup(), llvm::object::Archive::Symbol::getMember(), llvm::object::Archive::getNumberOfSymbols(), llvm::getPointerAuthStableSipHash(), llvm::RuntimeDyldCOFFAArch64::processRelocationRef(), llvm::sampleprof::SampleProfileReaderBinary::readSampleContextFromTable(), llvm::object::Archive::symbol_begin(), XXH128_mix32B(), XXH3_accumulate_512_scalar(), XXH3_len_0to16_128b(), XXH3_len_0to16_64b(), XXH3_len_4to8_128b(), XXH3_len_4to8_64b(), XXH3_len_9to16_128b(), XXH3_len_9to16_64b(), XXH3_mix16B(), XXH3_mix2Accs(), XXH3_scrambleAcc_scalar(), and llvm::xxHash64().
|
inlinenodiscard |
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 126 of file Endian.h.
References assert(), byte_swap(), LLVM_ASSUME_ALIGNED, read(), and llvm::support::detail::PickAlignment< T, alignment >::value.
Referenced by llvm::BitstreamWriter::BackpatchByte().
|
inlinenodiscard |
Definition at line 86 of file Endian.h.
References readNext().
|
inlinenodiscard |
Read a value of a particular endianness from a buffer, and increment the buffer past that value.
Definition at line 77 of file Endian.h.
References read().
Referenced by llvm::IndexedMemProfReader::deserialize(), llvm::memprof::DataAccessProfData::deserialize(), llvm::memprof::Frame::deserialize(), llvm::memprof::MemProfSummary::deserialize(), llvm::OutlinedHashTreeRecord::deserialize(), llvm::StableFunctionMapRecord::deserializeEntry(), llvm::memprof::deserializeV2(), llvm::memprof::deserializeV3(), llvm::memprof::deserializeV4(), llvm::OnDiskChainedHashTable< Info >::find_hashed(), llvm::memprof::CallerCalleePairExtractor::operator()(), llvm::memprof::LinearCallStackIdConverter::operator()(), readBinaryIdsInternal(), llvm::InstrProfLookupTrait::ReadData(), llvm::memprof::CallStackLookupTrait::ReadData(), llvm::IndexedCGData::Header::readFromBuffer(), llvm::IndexedInstrProf::Header::readFromBuffer(), llvm::IndexedInstrProfReader::readHeader(), llvm::memprof::CallStackLookupTrait::ReadKey(), llvm::memprof::FrameLookupTrait::ReadKey(), llvm::memprof::RecordLookupTrait::ReadKey(), llvm::InstrProfLookupTrait::ReadKeyDataLength(), llvm::memprof::CallStackLookupTrait::ReadKeyDataLength(), llvm::memprof::FrameLookupTrait::ReadKeyDataLength(), llvm::memprof::RecordLookupTrait::ReadKeyDataLength(), llvm::memprof::readMemProfSchema(), readNext(), llvm::OnDiskChainedHashTable< Info >::readNumBucketsAndEntries(), and llvm::sampleprof::SampleProfileReaderBinary::readUnencodedNumber().
|
inline |
Definition at line 54 of file EndianStream.h.
References write().
|
inline |
Definition at line 37 of file EndianStream.h.
References byte_swap(), and llvm::raw_ostream::write().
|
inline |
Definition at line 61 of file EndianStream.h.
References llvm::SmallVectorImpl< T >::append(), byte_swap(), and E().
|
inline |
|
inline |
Write a value to memory with a particular endianness.
Definition at line 92 of file Endian.h.
References byte_swap(), LLVM_ASSUME_ALIGNED, and llvm::support::detail::PickAlignment< T, alignment >::value.
Referenced by llvm::dwarf_linker::parallel::SectionDescriptor::applyIntVal(), emitOperand(), llvm::MCDwarfFrameEmitter::encodeAdvanceLoc(), llvm::MCSFrameEmitter::encodeFuncOffset(), llvm::MipsMCCodeEmitter::encodeInstruction(), llvm::MSP430MCCodeEmitter::encodeInstruction(), llvm::PPCMCCodeEmitter::encodeInstruction(), llvm::HexagonMCCodeEmitter::encodeSingleInstruction(), llvm::MCContext::getELFSection(), operator<<(), llvm::support::detail::packed_endian_specific_integral< ValueType, Endian, Alignment, ALIGN >::ref::operator=(), llvm::support::detail::packed_endian_specific_integral< T, E, support::unaligned >::operator=(), print(), printLE(), llvm::LoongArchAsmBackend::relaxDwarfCFA(), llvm::RISCVAsmBackend::relaxDwarfCFA(), llvm::LoongArchAsmBackend::relaxDwarfLineAddr(), llvm::RISCVAsmBackend::relaxDwarfLineAddr(), llvm::mcdxbc::PSVRuntimeInfo::write(), llvm::mcdxbc::RootSignatureDesc::write(), write(), write(), llvm::support::endian::Writer::write(), llvm::support::endian::Writer::write(), write16(), write16(), write32(), write32(), write64(), write64(), write< double >(), write< float >(), writeAtBitAlignment(), writeData(), writeFragment(), llvm::RuntimeDyldImpl::writeInt16BE(), llvm::RuntimeDyldImpl::writeInt32BE(), llvm::RuntimeDyldImpl::writeInt64BE(), llvm::BinaryStreamWriter::writeInteger(), writeNext(), llvm::ARMAsmBackend::writeNopData(), llvm::MachObjectWriter::writeObject(), llvm::WinCOFFWriter::writeObject(), and writePlaceholder().
|
inline |
|
inline |
|
inline |
Definition at line 448 of file Endian.h.
References E(), P, and write().
Referenced by llvm::jitlink::ppc64::relocateHalf16(), write16be(), and write16le().
|
inline |
|
inline |
Definition at line 468 of file Endian.h.
Referenced by llvm::add16(), and llvm::jitlink::finalizeBlockRelax().
|
inline |
|
inline |
Definition at line 451 of file Endian.h.
References E(), P, and write().
Referenced by llvm::jitlink::ppc64::applyFixup(), llvm::objcopy::elf::ELFSectionWriter< ELFT >::visit(), write32be(), and write32le().
|
inline |
Definition at line 480 of file Endian.h.
Referenced by llvm::jitlink::aarch32::applyFixupData(), and llvm::StringTableBuilder::write().
|
inline |
Definition at line 471 of file Endian.h.
Referenced by llvm::jitlink::aarch32::applyFixupData(), llvm::computeLTOCacheKey(), llvm::objcopy::coff::createGnuDebugLinkSectionContents(), llvm::MD5::final(), llvm::jitlink::finalizeBlockRelax(), getSourceLineHash(), or32le(), llvm::objcopy::wasm::Writer::write(), llvm::StringTableBuilder::write(), write32AArch64Addr(), writeInt32ToBuffer(), llvm::object::writeStringTable(), and writeUint32().
|
inline |
|
inline |
Definition at line 454 of file Endian.h.
References E(), P, and write().
Referenced by llvm::jitlink::ppc64::applyFixup(), write64be(), write64le(), and llvm::jitlink::ppc64::writePrefixedInstruction().
|
inline |
|
inline |
Definition at line 474 of file Endian.h.
Referenced by llvm::computeLTOCacheKey(), llvm::remarks::YAMLMetaSerializer::emit(), emitVersion(), llvm::BlockCoverageInference::getInstrumentedBlocksHash(), llvm::sampleprof::SampleProfileReaderExtBinaryBase::readNameTableSec(), llvm::sampleprof::SampleProfileReaderBinary::readSampleContextFromTable(), llvm::RuntimeDyldCOFFAArch64::resolveRelocation(), and writeUint64().
|
inline |
Definition at line 48 of file EndianStream.h.
References llvm::bit_cast(), and write().
|
inline |
Definition at line 43 of file EndianStream.h.
References llvm::bit_cast(), and write().
|
inline |
Definition at line 28 of file EndianStream.h.
References byte_swap(), and llvm::raw_ostream::write().
Referenced by llvm::mcdxbc::PSVRuntimeInfo::write().
|
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 161 of file Endian.h.
References assert(), byte_swap(), LLVM_ASSUME_ALIGNED, llvm::support::detail::PickAlignment< T, alignment >::value, and write().
Referenced by llvm::BitstreamWriter::BackpatchByte().
|
inline |
Definition at line 116 of file Endian.h.
References writeNext().
|
inline |
Write a value of a particular endianness, and increment the buffer past that value.
Definition at line 109 of file Endian.h.
References write().
Referenced by writeNext().