9#ifndef LLVM_DEBUGINFO_DWARF_DWARFFORMVALUE_H
10#define LLVM_DEBUGINFO_DWARF_DWARFFORMVALUE_H
22class DWARFDataExtractor;
44 ValueType(int64_t V) : sval(V) {}
53 const uint8_t *data =
nullptr;
61 const DWARFUnit *U =
nullptr;
62 const DWARFContext *C =
nullptr;
119 std::optional<ArrayRef<uint8_t>>
getAsBlock()
const;
133 std::optional<std::string>
175inline std::optional<const char *>
196 auto S = V->getAsCString();
212inline const char *
toString(
const std::optional<DWARFFormValue> &V,
224inline std::optional<uint64_t>
227 return V->getAsUnsignedConstant();
247inline std::optional<uint64_t>
250 return V->getAsReference();
270inline std::optional<int64_t>
toSigned(
const std::optional<DWARFFormValue> &V) {
272 return V->getAsSignedConstant();
282inline int64_t
toSigned(
const std::optional<DWARFFormValue> &V,
292inline std::optional<uint64_t>
295 return V->getAsAddress();
299inline std::optional<object::SectionedAddress>
302 return V->getAsSectionedAddress();
322inline std::optional<uint64_t>
325 return V->getAsSectionOffset();
345inline std::optional<ArrayRef<uint8_t>>
346toBlock(
const std::optional<DWARFFormValue> &V) {
348 return V->getAsBlock();
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains constants used for implementing Dwarf debug support.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
std::optional< uint64_t > toAddress(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an address.
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
std::optional< object::SectionedAddress > toSectionedAddress(const std::optional< DWARFFormValue > &V)
std::optional< int64_t > toSigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an signed constant.
std::optional< uint64_t > toReference(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an reference.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
bool doesFormBelongToClass(dwarf::Form Form, DWARFFormValue::FormClass FC, uint16_t DwarfVersion)
Check whether specified Form belongs to the FC class.
std::optional< uint64_t > toSectionOffset(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an section offset.
StringRef toStringRef(const std::optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
std::optional< ArrayRef< uint8_t > > toBlock(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract block data.
std::optional< uint64_t > toUnsigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
This is an optimization pass for GlobalISel generic memory operations.
@ Default
The result values are uniform if and only if all operands are uniform.
void consumeError(Error Err)
Consume a Error without doing anything.
Container for dump options that control which debug information will be dumped.