36#include <system_error>
40#define DEBUG_TYPE "llvm-profdata"
48 cl::desc(
"Write vtable type profile in ext-binary sample profile writer"));
52 cl::desc(
"Format version to write for extensible binary profiles"));
56 cl::desc(
"Write ProfileSymbolList (Cold Symbols) as "
57 "64-bit MD5 hashes in Eytzinger layout"));
61 cl::desc(
"Write Eytzinger 3-span layout for NameTable and parallel "
70struct SeekableWriter {
74 : OS(OS), Endian(Endian) {}
76 template <
typename ValueType>
void pwrite(
ValueType Val,
size_t Offset) {
77 std::string StringBuf;
78 raw_string_ostream SStream(StringBuf);
79 Writer(SStream, Endian).write(Val);
80 OS.pwrite(StringBuf.data(), StringBuf.size(),
Offset);
98 size_t NumToRemove =
ProfileMap.size() - NewSize;
102 assert(NumToRemove <= SortedFunctions.size());
106 SortedFunctions.resize(SortedFunctions.size() - NumToRemove);
112 if (OutputSizeLimit == 0)
113 return write(ProfileMap);
115 size_t OriginalFunctionCount = ProfileMap.size();
117 std::unique_ptr<raw_ostream> OriginalOutputStream;
120 size_t IterationCount = 0;
125 StringBuffer.
clear();
127 if (std::error_code EC =
write(ProfileMap))
130 TotalSize = StringBuffer.
size();
138 if (TotalSize <= OutputSizeLimit)
141 Strategy->
Erase(TotalSize);
143 }
while (ProfileMap.size() != 0);
145 if (ProfileMap.size() == 0)
150 LLVM_DEBUG(
dbgs() <<
"Profile originally has " << OriginalFunctionCount
151 <<
" functions, reduced to " << ProfileMap.size() <<
" in "
152 << IterationCount <<
" iterations\n");
154 (void)OriginalFunctionCount;
155 (void)IterationCount;
161 std::vector<NameFunctionSamples> V;
163 for (
const auto &
I : V) {
189 assert(Entry.Type ==
Type &&
"Unexpected section type");
196std::error_code SampleProfileWriterExtBinaryBase::compressAndOutput() {
199 std::string &UncompressedStrings =
201 if (UncompressedStrings.size() == 0)
211 UncompressedStrings.clear();
222 assert(Entry.Type ==
Type &&
"Unexpected section type");
225 if (std::error_code EC = compressAndOutput())
228 SecHdrTable.push_back({
Type, Entry.Flags, SectionStart - FileStart,
241 if (std::error_code EC = writeHeader(ProfileMap))
244 std::string LocalBuf;
245 LocalBufStream = std::make_unique<raw_string_ostream>(LocalBuf);
249 if (std::error_code EC = writeSecHdrTable())
257 if (Context.hasContext())
265 const auto &Ret = CSNameTable.find(Context);
266 if (Ret == CSNameTable.end())
295 assert((NumNested + NumFlat > 0 || FuncOffsetTable.empty()) &&
296 "SecNameTable must be written before SecFuncOffsetTable to establish "
297 "Eytzinger indices!");
299 size_t SpanSize = IsNested ? NumNested : NumFlat;
300 size_t BaseIdx = IsNested ? 0 : NumNested;
302 std::vector<support::ulittle32_t> FuncOffsets(
306 for (
const auto &[Context, RelativeOffset] : FuncOffsetTable) {
307 if (RelativeOffset >= UINT32_MAX)
315 size_t GlobalIdx = It->second;
316 if (GlobalIdx < BaseIdx || (GlobalIdx - BaseIdx) >= SpanSize)
319 size_t LocalIdx = GlobalIdx - BaseIdx;
321 FuncOffsets[LocalIdx] == UINT32_MAX &&
322 "Function offset slot already populated; duplicate GUID or collision!");
323 FuncOffsets[LocalIdx] =
static_cast<uint32_t>(RelativeOffset);
327 "Unpopulated slot in Eytzinger function offset array!");
329 OutputStream->write(
reinterpret_cast<const char *
>(FuncOffsets.data()),
332 FuncOffsetTable.clear();
354 std::map<SampleContext, uint64_t> OrderedFuncOffsetTable(
355 FuncOffsetTable.begin(), FuncOffsetTable.end());
356 for (
const auto &Entry : OrderedFuncOffsetTable) {
357 if (std::error_code EC = WriteItem(Entry.first, Entry.second))
362 for (
const auto &Entry : FuncOffsetTable) {
363 if (std::error_code EC = WriteItem(Entry.first, Entry.second))
368 FuncOffsetTable.clear();
388 NumCallsites += J.second.size();
391 for (
const auto &FS : J.second) {
409 for (
const auto &Entry : Profiles) {
416template <
class KeyT,
class ValT>
423 [](
const auto *L,
const auto *R) {
return L->first < R->first; });
443 Writer.
write(Entry->first.getHashCode());
449 for (
const auto &
I : ProfileMap) {
497class EytzingerNameTable {
502 EytzingerNameTable(std::vector<support::ulittle64_t> NestedKeys,
503 std::vector<support::ulittle64_t> FlatKeys,
504 std::vector<support::ulittle64_t> InlineeKeys)
505 : Spans{TableT::create(
std::
move(NestedKeys)),
506 TableT::create(
std::
move(FlatKeys)),
507 TableT::create(
std::
move(InlineeKeys))} {}
512 for (
const auto &
Table : Spans) {
513 if (std::optional<size_t> LocalIdx =
Table.findIndex(GUID))
514 return BaseIdx + *LocalIdx;
515 BaseIdx +=
Table.size();
520 void write(raw_ostream &OS)
const {
521 for (
const auto &
Table : Spans)
523 for (
const auto &
Table : Spans)
524 OS.
write(
reinterpret_cast<const char *
>(
Table.data()),
529 return Spans[
static_cast<size_t>(S)].
size();
539 std::vector<support::ulittle64_t> NestedKeys, FlatKeys, InlineeKeys;
542 for (
const auto &
I : ProfileMap) {
544 uint64_t GUID = Ctx.getFunction().getHashCode();
545 if (TopLevelGUIDs.
insert(GUID).second) {
550 NestedKeys.emplace_back(GUID);
552 FlatKeys.emplace_back(GUID);
559 uint64_t GUID = Entry.first.getHashCode();
561 InlineeKeys.emplace_back(GUID);
564 EytzingerNameTable Tables(std::move(NestedKeys), std::move(FlatKeys),
565 std::move(InlineeKeys));
569 Idx = Tables.findGlobalIdx(FId.getHashCode());
583 auto Frames = Entry->first.getContextFrames();
585 for (
auto &Callsite : Frames) {
605 assert((!ProfSymList || !ProfSymList->isMD5()) &&
606 "Writing string-based ProfileSymbolListSection from MD5 table "
607 "not yet implemented");
608 if (ProfSymList && ProfSymList->size() > 0)
609 if (std::error_code EC = ProfSymList->write(*
OutputStream))
617 if (!ProfSymList || ProfSymList->size() == 0)
619 assert(!ProfSymList->isMD5() &&
620 "Writing MD5 ProfileSymbolListSection from existing MD5 "
621 "table not yet implemented");
624 std::vector<uint64_t> Keys = ProfSymList->collectGUIDs();
629 OS.
write(
reinterpret_cast<const char *
>(
Table.data()),
683 bool IsNested = !IsFlat;
707 std::unique_ptr<raw_ostream> &OS)
712std::error_code SampleProfileWriterExtBinary::writeDefaultLayout(
738 for (
const auto &
I : ProfileMap) {
739 if (
I.second.hasCallsiteSamples())
740 NestedProfileMap.insert({
I.first,
I.second});
742 FlatProfileMap.insert({
I.first,
I.second});
746std::error_code SampleProfileWriterExtBinary::writeCtxSplitLayout(
748 SampleProfileMap NestedProfileMap, FlatProfileMap;
777std::error_code SampleProfileWriterExtBinary::writeSections(
781 EC = writeDefaultLayout(ProfileMap);
783 EC = writeCtxSplitLayout(ProfileMap);
810 for (
const auto &
I : SortedSamples.
get()) {
818 OS <<
" " << J.first <<
":" << J.second;
823 Map && !Map->empty()) {
828 for (
const auto [TypeName,
Count] : *Map) {
829 OS << TypeName <<
":" <<
Count <<
" ";
839 for (
const auto *Element : SortedCallsiteSamples.
get()) {
847 if (std::error_code EC =
writeSample(CalleeSamples))
852 Map && !Map->empty()) {
857 for (
const auto [TypeId,
Count] : *Map) {
858 OS << TypeId <<
":" <<
Count <<
" ";
887 assert(!Context.hasContext() &&
"cs profile is not supported");
893 const auto &Ret = NTable.find(FName);
894 if (Ret == NTable.end())
902 NTable.insert(std::make_pair(FName, 0));
906 addName(Context.getFunction());
919 for (
const auto &FS : J.second) {
928 for (
const auto &VTableAccessCountMap :
939 if (Context.hasContext()) {
940 for (
auto &Callsite : Context.getContextFrames())
942 CSNameTable.insert(std::make_pair(Context, 0));
982 for (
const auto &
I : ProfileMap) {
1000void SampleProfileWriterExtBinaryBase::allocSecHdrTable() {
1006 Writer.write(
static_cast<uint64_t>(-1));
1007 Writer.write(
static_cast<uint64_t>(-1));
1008 Writer.write(
static_cast<uint64_t>(-1));
1009 Writer.write(
static_cast<uint64_t>(-1));
1013std::error_code SampleProfileWriterExtBinaryBase::writeSecHdrTable() {
1015 "SecHdrTable entries doesn't match SectionHdrLayout");
1017 for (
uint32_t TableIdx = 0; TableIdx < SecHdrTable.size(); TableIdx++) {
1018 IndexMap[SecHdrTable[TableIdx].LayoutIndex] = TableIdx;
1030 support::endian::SeekableWriter Writer(
1035 assert(IndexMap[LayoutIdx] < SecHdrTable.size() &&
1036 "Incorrect LayoutIdx in SecHdrTable");
1037 auto Entry = SecHdrTable[IndexMap[LayoutIdx]];
1038 Writer.pwrite(
static_cast<uint64_t
>(
Entry.Type),
1039 SecHdrTableOffset + 4 * LayoutIdx *
sizeof(uint64_t));
1040 Writer.pwrite(
static_cast<uint64_t
>(
Entry.Flags),
1041 SecHdrTableOffset + (4 * LayoutIdx + 1) *
sizeof(uint64_t));
1042 Writer.pwrite(
static_cast<uint64_t
>(
Entry.Offset),
1043 SecHdrTableOffset + (4 * LayoutIdx + 2) *
sizeof(uint64_t));
1044 Writer.pwrite(
static_cast<uint64_t
>(
Entry.Size),
1045 SecHdrTableOffset + (4 * LayoutIdx + 3) *
sizeof(uint64_t));
1051std::error_code SampleProfileWriterExtBinaryBase::writeHeader(
1054 FileStart = OS.
tell();
1064 "writeCallsiteVTableProf should not be called if WriteVTableProf is "
1086 for (
auto Entry : Entries) {
1112 NumCallsites += J.second.size();
1115 for (
const auto &FS : J.second) {
1116 J.first.serialize(OS);
1117 if (std::error_code EC =
writeBody(FS.second))
1146 std::unique_ptr<raw_ostream> OS;
1168 std::unique_ptr<SampleProfileWriter> Writer;
1196 return std::move(Writer);
1201 Summary = Builder.computeSummaryForProfiles(ProfileMap);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Provides ErrorOr<T> smart pointer.
This file defines the EytzingerTableSpan class, a non-owning view of a buffer formatted as a complete...
static uint64_t round(uint64_t Acc, uint64_t Input)
static constexpr StringLiteral Filename
static cl::opt< bool > WriteEytzingerNameTables("sample-profile-write-eytzinger-name-tables", cl::init(false), cl::Hidden, cl::desc("Write Eytzinger 3-span layout for NameTable and parallel " "FuncOffsetTable"))
static cl::opt< uint64_t > RequestedVersion("sample-profile-format-version", cl::init(DefaultVersion), cl::Hidden, cl::desc("Format version to write for extensible binary profiles"))
static void splitProfileMapToTwo(const SampleProfileMap &ProfileMap, SampleProfileMap &NestedProfileMap, SampleProfileMap &FlatProfileMap)
static SmallVector< std::pair< KeyT, ValT > *, 0 > stabilizeTable(MapVector< KeyT, ValT > &Table)
static cl::opt< bool > ExtBinaryWriteVTableTypeProf("extbinary-write-vtable-type-prof", cl::init(false), cl::Hidden, cl::desc("Write vtable type profile in ext-binary sample profile writer"))
static cl::opt< bool > WriteMD5ProfSymList("md5-prof-sym-list", cl::init(false), cl::Hidden, cl::desc("Write ProfileSymbolList (Cold Symbols) as " "64-bit MD5 hashes in Eytzinger layout"))
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
Implements a dense probed hash-table based set.
Represents either an error or a value T.
Owning container that stores elements in a complete binary search tree formatted in Eytzinger (breadt...
static EytzingerTable< T > create(std::vector< KeyT > Keys)
Construct an Eytzinger search tree from a vector of keys by sorting, deduplicating,...
This class implements a map that also provides access to all stored values in a deterministic order.
static LLVM_ABI const ArrayRef< uint32_t > DefaultCutoffs
A vector of useful cutoff values for detailed summary.
pointer data()
Return a pointer to the vector's buffer, even if empty().
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
std::pair< iterator, bool > insert(const ValueT &V)
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
A raw_ostream that writes to a file descriptor.
This class implements an extremely fast bulk output stream that can only output to a stream.
uint64_t tell() const
tell - Return the current offset with the file.
raw_ostream & write(unsigned char C)
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
An abstract base class for streams implementations that also support a pwrite operation.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
A raw_ostream that writes to an SmallVector or SmallString.
DefaultFunctionPruningStrategy(SampleProfileMap &ProfileMap, size_t OutputSizeLimit)
void Erase(size_t CurrentOutputSize) override
In this default implementation, functions with fewest samples are dropped first.
This class represents a function that is read from a sample profile.
When writing a profile with size limit, user may want to use a different strategy to reduce function ...
virtual void Erase(size_t CurrentOutputSize)=0
SampleProfileWriter::writeWithSizeLimit() calls this after every write iteration if the output size s...
FunctionPruningStrategy(SampleProfileMap &ProfileMap, size_t OutputSizeLimit)
ProfileMap A reference to the original profile map.
SampleProfileMap & ProfileMap
Representation of the samples collected for a function.
static LLVM_ABI std::atomic< bool > ProfileIsFS
If this profile uses flow sensitive discriminators.
static LLVM_ABI std::atomic< bool > ProfileIsPreInlined
static constexpr const char * UniqSuffix
uint64_t getHeadSamples() const
For top-level functions, return the total number of branch samples that have the function as the bran...
FunctionId getFunction() const
Return the function name.
uint64_t getFunctionHash() const
const CallsiteTypeMap & getCallsiteTypeCounts() const
Returns vtable access samples for the C++ types collected in this function.
const TypeCountMap * findCallsiteTypeSamplesAt(const LineLocation &Loc) const
Returns the TypeCountMap for inlined callsites at the given Loc.
static LLVM_ABI std::atomic< bool > ProfileIsProbeBased
SampleContext & getContext() const
uint64_t getTotalSamples() const
Return the total number of samples collected inside the function.
const CallsiteSampleMap & getCallsiteSamples() const
Return all the callsite samples collected in the body of the function.
static LLVM_ABI std::atomic< bool > ProfileIsCS
const BodySampleMap & getBodySamples() const
Return all the samples collected in the body of the function.
uint32_t getAllAttributes()
std::string toString() const
This class provides operator overloads to the map container using MD5 as the key type,...
virtual void addContext(const SampleContext &Context)
virtual std::error_code writeNameTable()
virtual std::error_code writeMagicIdent(SampleProfileFormat Format)
std::error_code writeSummary()
MapVector< FunctionId, uint32_t > NameTable
void addNames(const FunctionSamples &S)
std::error_code writeCallsiteVTableProf(const CallsiteTypeMap &CallsiteTypeMap, raw_ostream &OS)
Write CallsiteTypeMap to the output stream OS.
virtual std::error_code writeContextIdx(const SampleContext &Context)
std::error_code writeSample(const FunctionSamples &S) override
Write samples of a top-level function to a binary file.
std::error_code writeHeader(const SampleProfileMap &ProfileMap) override
Write a file header for the profile file.
virtual MapVector< FunctionId, uint32_t > & getNameTable()
std::error_code writeBody(const FunctionSamples &S)
std::error_code writeNameIdx(FunctionId FName)
void addName(FunctionId FName)
std::error_code writeNameTableSection(const SampleProfileMap &ProfileMap)
SmallVector< SecHdrTableEntry, 8 > SectionHdrLayout
std::error_code writeFuncOffsetTable(bool IsNested)
std::error_code writeFuncMetadata(const SampleProfileMap &Profiles)
void setToCompressSection(SecType Type)
virtual std::error_code writeCustomSection(SecType Type)=0
virtual std::error_code writeOneSection(SecType Type, uint32_t LayoutIdx, const SampleProfileMap &ProfileMap)
std::error_code writeCSNameTableSection()
std::error_code writeCSNameIdx(const SampleContext &Context)
virtual std::error_code writeSections(const SampleProfileMap &ProfileMap)=0
std::error_code writeNameTable() override
std::error_code writeMD5ProfileSymbolListSection()
std::error_code writeLegacyFuncOffsetTable()
std::error_code writeStringBasedProfileSymbolListSection()
void addSectionFlag(SecType Type, SecFlagType Flag)
std::error_code writeProfileSymbolListSection()
uint64_t markSectionStart(SecType Type, uint32_t LayoutIdx)
Return the current position and prepare to use it as the start position of a section given the sectio...
std::error_code writeEytzingerFuncOffsetTable(bool IsNested)
void addContext(const SampleContext &Context) override
std::error_code addNewSection(SecType Sec, uint32_t LayoutIdx, uint64_t SectionStart)
Add a new section into section header table given the section type Type, its position LayoutIdx in Se...
void setToCompressAllSections() override
std::error_code writeEytzingerNameTableSection(const SampleProfileMap &ProfileMap)
uint64_t SecLBRProfileStart
std::error_code write(const SampleProfileMap &ProfileMap) override
Write all the sample profiles in the given map of samples.
std::error_code writeContextIdx(const SampleContext &Context) override
std::error_code writeSample(const FunctionSamples &S) override
Write samples of a top-level function to a binary file.
SampleProfileWriterExtBinary(std::unique_ptr< raw_ostream > &OS)
Sample-based profile writer (text format).
std::error_code writeSample(const FunctionSamples &S) override
Write samples to a text file.
std::unique_ptr< ProfileSummary > Summary
Profile summary.
virtual std::error_code writeSample(const FunctionSamples &S)=0
Write sample profiles in S.
SampleProfileFormat Format
Profile format.
std::error_code writeWithSizeLimitInternal(SampleProfileMap &ProfileMap, size_t OutputSizeLimit, FunctionPruningStrategy *Strategy)
void computeSummary(const SampleProfileMap &ProfileMap)
Compute summary for this profile.
virtual std::error_code writeFuncProfiles(const SampleProfileMap &ProfileMap)
std::unique_ptr< raw_ostream > OutputStream
Output stream where to emit the profile to.
uint64_t FormatVersion
Format version to write.
size_t LineCount
For writeWithSizeLimit in text mode, each newline takes 1 additional byte on Windows when actually wr...
static ErrorOr< std::unique_ptr< SampleProfileWriter > > create(StringRef Filename, SampleProfileFormat Format)
Profile writer factory.
virtual std::error_code writeHeader(const SampleProfileMap &ProfileMap)=0
Write a file header for the profile file.
virtual std::error_code write(const SampleProfileMap &ProfileMap)
Write all the sample profiles in the given map of samples.
Representation of a single sample record.
LLVM_ABI std::error_code serialize(raw_ostream &OS, const MapVector< FunctionId, uint32_t > &NameTable) const
Serialize the sample record to the output stream using ULEB128 encoding.
const CallTargetMap & getCallTargets() const
SortedCallTargetSet getSortedCallTargets() const
uint64_t getSamples() const
Sort a LocationT->SampleT map by LocationT.
const SamplesWithLocList & get() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
initializer< Ty > init(const Ty &Val)
LLVM_ABI void compress(ArrayRef< uint8_t > Input, SmallVectorImpl< uint8_t > &CompressedBuffer, int Level=DefaultCompression)
LLVM_ABI bool isAvailable()
constexpr int BestSizeCompression
LLVM_ABI void sortFuncProfiles(const SampleProfileMap &ProfileMap, std::vector< NameFunctionSamples > &SortedProfiles)
static uint64_t SPMagic(SampleProfileFormat Format=SPF_Binary)
static bool formatVersionIsSupported(uint64_t Version)
static void addSecFlag(SecHdrTableEntry &Entry, SecFlagType Flag)
static bool hasSecFlag(const SecHdrTableEntry &Entry, SecFlagType Flag)
std::pair< hash_code, const FunctionSamples * > NameFunctionSamples
@ SecFlagIsPreInlined
SecFlagIsPreInlined means this profile contains ShouldBeInlined contexts thus this is CS preinliner c...
@ SecFlagHasVTableTypeProf
SecFlagHasVTableTypeProf means this profile contains vtable type profiles.
@ SecFlagFSDiscriminator
SecFlagFSDiscriminator means this profile uses flow-sensitive discriminators.
@ SecFlagFullContext
SecFlagContext means this is context-sensitive flat profile for CSSPGO.
std::map< FunctionId, FunctionSamples > FunctionSamplesMap
static constexpr uint64_t DefaultVersion
std::map< FunctionId, uint64_t > TypeCountMap
Key represents type of a C++ polymorphic class type by its vtable and value represents its counter.
constexpr char kVTableProfPrefix[]
LLVM_ABI std::error_code serializeTypeMap(const TypeCountMap &Map, const MapVector< FunctionId, uint32_t > &NameTable, raw_ostream &OS)
Write Map to the output stream.
std::map< LineLocation, TypeCountMap > CallsiteTypeMap
detail::packed_endian_specific_integral< uint64_t, llvm::endianness::little, unaligned > ulittle64_t
detail::packed_endian_specific_integral< uint32_t, llvm::endianness::little, unaligned > ulittle32_t
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
ArrayRef< CharT > arrayRefFromStringRef(StringRef Input)
Construct an array ref of bytes from a string ref.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
@ unsupported_writing_format
void sort(IteratorTy Start, IteratorTy End)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
auto make_first_range(ContainerTy &&c)
Given a container of pairs, return a range over the first elements.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
auto make_second_range(ContainerTy &&c)
Given a container of pairs, return a range over the second elements.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
iterator_range< pointer_iterator< WrappedIteratorT > > make_pointer_range(RangeT &&Range)
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
PointerUnion< const Value *, const PseudoSourceValue * > ValueType
StringRef toStringRef(bool B)
Construct a string ref from a boolean.
LLVM_ABI Error write(DWPWriter &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue, Dwarf64StrOffsetsPromotion StrOffsetsOptValue, raw_pwrite_stream *OS=nullptr)
Implement std::hash so that hash_code can be used in STL containers.
Represents the relative location of an instruction.
Adapter to write values to a stream in a particular byte order.
void write(ArrayRef< value_type > Val)