LLVM: include/llvm/DebugInfo/PDB/Native/FormatUtil.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DEBUGINFO_PDB_NATIVE_FORMATUTIL_H
10#define LLVM_DEBUGINFO_PDB_NATIVE_FORMATUTIL_H
11
20
21#include
22
23namespace llvm {
24namespace pdb {
25
26#define PUSH_MASKED_FLAG(Enum, Mask, TheOpt, Value, Text) \
27 if (Enum::TheOpt == (Value & Mask)) \
28 Opts.push_back(Text);
29
30#define PUSH_FLAG(Enum, TheOpt, Value, Text) \
31 PUSH_MASKED_FLAG(Enum, Enum::TheOpt, TheOpt, Value, Text)
32
33#define RETURN_CASE(Enum, X, Ret) \
34 case Enum::X: \
35 return Ret;
36
40
42
51
55
58
60 bool Friendly = true);
63
64
66 if (N < 10ULL)
67 return 1;
68 if (N < 100ULL)
69 return 2;
70 if (N < 1000ULL)
71 return 3;
72 if (N < 10000ULL)
73 return 4;
74 if (N < 100000ULL)
75 return 5;
76 if (N < 1000000ULL)
77 return 6;
78 if (N < 10000000ULL)
79 return 7;
80 if (N < 100000000ULL)
81 return 8;
82 if (N < 1000000000ULL)
83 return 9;
84 if (N < 10000000000ULL)
85 return 10;
86 if (N < 100000000000ULL)
87 return 11;
88 if (N < 1000000000000ULL)
89 return 12;
90 if (N < 10000000000000ULL)
91 return 13;
92 if (N < 100000000000000ULL)
93 return 14;
94 if (N < 1000000000000000ULL)
95 return 15;
96 if (N < 10000000000000000ULL)
97 return 16;
98 if (N < 100000000000000000ULL)
99 return 17;
100 if (N < 1000000000000000000ULL)
101 return 18;
102 if (N < 10000000000000000000ULL)
103 return 19;
104 return 20;
105}
106
108template
110 : public FormatAdapter<support::detail::packed_endian_specific_integral<
111 T, llvm::endianness::little, support::unaligned>> {
114
117
121};
122}
123
124template
130}
131}
132#endif
This file contains library features backported from future STL versions.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
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.
@ C
The default llvm calling convention, compatible with C.
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
LLVM_ABI std::string formatSegmentOffset(uint16_t Segment, uint32_t Offset)
std::string formatUnknownEnum(T Value)
Definition FormatUtil.h:37
LLVM_ABI std::string typesetStringList(uint32_t IndentLevel, ArrayRef< StringRef > Strings)
CharacteristicStyle
Definition FormatUtil.h:43
@ Descriptive
Definition FormatUtil.h:45
@ HeaderDefinition
Definition FormatUtil.h:44
int NumDigits(uint64_t N)
Returns the number of digits in the given integer.
Definition FormatUtil.h:65
LLVM_ABI std::string formatSymbolKind(codeview::SymbolKind K)
LLVM_ABI std::string formatTypeLeafKind(codeview::TypeLeafKind K)
detail::EndianAdapter< T > fmtle(support::detail::packed_endian_specific_integral< T, llvm::endianness::little, support::unaligned > Value)
Definition FormatUtil.h:125
LLVM_ABI std::string formatChunkKind(codeview::DebugSubsectionKind Kind, bool Friendly=true)
LLVM_ABI std::string formatSectionCharacteristics(uint32_t IndentLevel, uint32_t C, uint32_t FlagsPerLine, StringRef Separator, CharacteristicStyle Style=CharacteristicStyle::HeaderDefinition)
LLVM_ABI std::string typesetItemList(ArrayRef< std::string > Opts, uint32_t IndentLevel, uint32_t GroupSize, StringRef Sep)
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
Definition FormatUtil.h:111
support::detail::packed_endian_specific_integral< T, llvm::endianness::little, support::unaligned > EndianType
Definition FormatUtil.h:112
EndianAdapter(EndianType &&Item)
Definition FormatUtil.h:115
void format(llvm::raw_ostream &Stream, StringRef Style) override
Definition FormatUtil.h:118