LLVM
17.0.0git
|
#include "llvm/ObjectYAML/DWARFEmitter.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/ObjectYAML/DWARFYAML.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
template<typename T > | |
static void | writeInteger (T Integer, raw_ostream &OS, bool IsLittleEndian) |
static Error | writeVariableSizedInteger (uint64_t Integer, size_t Size, raw_ostream &OS, bool IsLittleEndian) |
static void | ZeroFillBytes (raw_ostream &OS, size_t Size) |
static void | writeInitialLength (const dwarf::DwarfFormat Format, const uint64_t Length, raw_ostream &OS, bool IsLittleEndian) |
static void | writeDWARFOffset (uint64_t Offset, dwarf::DwarfFormat Format, raw_ostream &OS, bool IsLittleEndian) |
static Error | emitPubSection (raw_ostream &OS, const DWARFYAML::PubSection &Sect, bool IsLittleEndian, bool IsGNUPubSec=false) |
static Expected< uint64_t > | writeDIE (const DWARFYAML::Data &DI, uint64_t CUIndex, uint64_t AbbrevTableID, const dwarf::FormParams &Params, const DWARFYAML::Entry &Entry, raw_ostream &OS, bool IsLittleEndian) |
static void | emitFileEntry (raw_ostream &OS, const DWARFYAML::File &File) |
static void | writeExtendedOpcode (const DWARFYAML::LineTableOpcode &Op, uint8_t AddrSize, bool IsLittleEndian, raw_ostream &OS) |
static void | writeLineTableOpcode (const DWARFYAML::LineTableOpcode &Op, uint8_t OpcodeBase, uint8_t AddrSize, raw_ostream &OS, bool IsLittleEndian) |
static std::vector< uint8_t > | getStandardOpcodeLengths (uint16_t Version, std::optional< uint8_t > OpcodeBase) |
static Error | checkOperandCount (StringRef EncodingString, ArrayRef< yaml::Hex64 > Values, uint64_t ExpectedOperands) |
static Error | writeListEntryAddress (StringRef EncodingName, raw_ostream &OS, uint64_t Addr, uint8_t AddrSize, bool IsLittleEndian) |
static Expected< uint64_t > | writeDWARFExpression (raw_ostream &OS, const DWARFYAML::DWARFOperation &Operation, uint8_t AddrSize, bool IsLittleEndian) |
static Expected< uint64_t > | writeListEntry (raw_ostream &OS, const DWARFYAML::RnglistEntry &Entry, uint8_t AddrSize, bool IsLittleEndian) |
static Expected< uint64_t > | writeListEntry (raw_ostream &OS, const DWARFYAML::LoclistEntry &Entry, uint8_t AddrSize, bool IsLittleEndian) |
template<typename EntryType > | |
static Error | writeDWARFLists (raw_ostream &OS, ArrayRef< DWARFYAML::ListTable< EntryType >> Tables, bool IsLittleEndian, bool Is64BitAddrSize) |
static Error | emitDebugSectionImpl (const DWARFYAML::Data &DI, StringRef Sec, StringMap< std::unique_ptr< MemoryBuffer >> &OutputBuffers) |
The DWARF component of yaml2obj. Provided as library code for tests.
Definition in file DWARFEmitter.cpp.
|
static |
Definition at line 694 of file DWARFEmitter.cpp.
References llvm::createStringError(), llvm::invalid_argument, llvm::ArrayRef< T >::size(), llvm::StringRef::str(), and llvm::Error::success().
Referenced by writeDWARFExpression().
|
static |
Definition at line 1036 of file DWARFEmitter.cpp.
References llvm::Data, and llvm::DWARFYAML::getDWARFEmitterByName.
|
static |
Definition at line 475 of file DWARFEmitter.cpp.
References llvm::encodeULEB128(), and llvm::raw_ostream::write().
Referenced by llvm::DWARFYAML::emitDebugLine(), and writeExtendedOpcode().
|
static |
Definition at line 227 of file DWARFEmitter.cpp.
References llvm::DWARFYAML::PubSection::Format, llvm::DWARFYAML::PubSection::Length, llvm::DWARFYAML::PubSection::UnitOffset, llvm::DWARFYAML::PubSection::UnitSize, llvm::DWARFYAML::PubSection::Version, writeInitialLength(), and writeInteger().
Referenced by llvm::DWARFYAML::emitDebugGNUPubnames(), llvm::DWARFYAML::emitDebugGNUPubtypes(), llvm::DWARFYAML::emitDebugPubnames(), and llvm::DWARFYAML::emitDebugPubtypes().
|
static |
Definition at line 556 of file DWARFEmitter.cpp.
References llvm::IndexedInstrProf::Version.
Referenced by llvm::DWARFYAML::emitDebugLine().
|
static |
Definition at line 265 of file DWARFEmitter.cpp.
Referenced by llvm::DWARFYAML::emitDebugInfo().
|
static |
Definition at line 720 of file DWARFEmitter.cpp.
References checkOperandCount(), Operation, llvm::dwarf::OperationEncodingString(), llvm::raw_ostream::tell(), and writeInteger().
|
static |
Definition at line 911 of file DWARFEmitter.cpp.
References llvm::Length, List, llvm::raw_ostream::tell(), and UINT64_MAX.
|
static |
Definition at line 82 of file DWARFEmitter.cpp.
References llvm::cantFail(), llvm::dwarf::DWARF64, llvm::Offset, and writeVariableSizedInteger().
Referenced by llvm::DWARFYAML::emitDebugAranges(), llvm::DWARFYAML::emitDebugInfo(), llvm::DWARFYAML::emitDebugLine(), and llvm::DWARFYAML::emitDebugStrOffsets().
|
static |
Definition at line 483 of file DWARFEmitter.cpp.
References llvm::cantFail(), emitFileEntry(), llvm::encodeULEB128(), llvm::raw_ostream::write(), writeInteger(), and writeVariableSizedInteger().
Referenced by writeLineTableOpcode().
|
static |
Definition at line 71 of file DWARFEmitter.cpp.
References llvm::cantFail(), llvm::dwarf::DW_LENGTH_DWARF64, llvm::dwarf::DWARF64, llvm::Length, and writeVariableSizedInteger().
Referenced by llvm::DWARFYAML::emitDebugAddr(), llvm::DWARFYAML::emitDebugAranges(), llvm::DWARFYAML::emitDebugInfo(), llvm::DWARFYAML::emitDebugLine(), llvm::DWARFYAML::emitDebugStrOffsets(), and emitPubSection().
|
static |
Definition at line 43 of file DWARFEmitter.cpp.
References Integer, llvm::sys::IsLittleEndianHost, llvm::sys::swapByteOrder(), and llvm::raw_ostream::write().
Referenced by llvm::DWARFYAML::emitDebugAddr(), llvm::DWARFYAML::emitDebugAranges(), llvm::DWARFYAML::emitDebugInfo(), llvm::DWARFYAML::emitDebugLine(), llvm::DWARFYAML::emitDebugStrOffsets(), emitPubSection(), writeDWARFExpression(), writeExtendedOpcode(), writeLineTableOpcode(), and writeVariableSizedInteger().
|
static |
Definition at line 516 of file DWARFEmitter.cpp.
References llvm::encodeSLEB128(), llvm::encodeULEB128(), writeExtendedOpcode(), and writeInteger().
Referenced by llvm::DWARFYAML::emitDebugLine().
|
static |
Definition at line 813 of file DWARFEmitter.cpp.
|
static |
Definition at line 752 of file DWARFEmitter.cpp.
|
static |
Definition at line 707 of file DWARFEmitter.cpp.
|
static |
Definition at line 49 of file DWARFEmitter.cpp.
References llvm::createStringError(), Integer, llvm::not_supported, llvm::Error::success(), and writeInteger().
Referenced by writeDWARFOffset(), writeExtendedOpcode(), and writeInitialLength().
|
static |
Definition at line 66 of file DWARFEmitter.cpp.
References llvm::raw_ostream::write().
Referenced by llvm::DWARFYAML::emitDebugAranges(), and llvm::DWARFYAML::emitDebugRanges().