20 struct MapOneMethodRecord {
21 explicit MapOneMethodRecord(
bool IsFromOverloadList)
22 : IsFromOverloadList(IsFromOverloadList) {}
26 if (IsFromOverloadList) {
36 if (!IsFromOverloadList)
43 bool IsFromOverloadList;
55 size_t BytesNeeded = Name.
size() + UniqueName.
size() + 2;
58 if (BytesNeeded > BytesLeft) {
59 size_t BytesToDrop = (BytesNeeded - BytesLeft);
60 size_t DropN = std::min(N.
size(), BytesToDrop / 2);
61 size_t DropU = std::min(U.
size(), BytesToDrop - DropN);
86 assert(!MemberKind.hasValue() &&
"Already in a member mapping!");
92 if (CVR.
Type != TypeLeafKind::LF_FIELDLIST &&
93 CVR.
Type != TypeLeafKind::LF_METHODLIST)
95 error(IO.beginRecord(MaxLen));
102 assert(!MemberKind.hasValue() &&
"Still in a member mapping!");
104 error(IO.endRecord());
112 assert(!MemberKind.hasValue() &&
"Already in a member mapping!");
120 ContinuationLength));
122 MemberKind = Record.
Kind;
128 assert(MemberKind.hasValue() &&
"Not in a member mapping!");
130 if (!IO.isWriting()) {
131 if (
auto EC = IO.skipPadding())
136 error(IO.endRecord());
208 error(IO.mapEncodedInteger(Record.
Size));
215 assert((CVR.
Type == TypeLeafKind::LF_STRUCTURE) ||
216 (CVR.
Type == TypeLeafKind::LF_CLASS) ||
217 (CVR.
Type == TypeLeafKind::LF_INTERFACE));
224 error(IO.mapEncodedInteger(Record.
Size));
235 error(IO.mapEncodedInteger(Record.
Size));
264 if (IO.isWriting()) {
267 error(IO.mapInteger(Size));
272 Byte |=
static_cast<uint8_t
>(Slots[
SlotIndex + 1]);
274 error(IO.mapInteger(Byte));
277 error(IO.mapInteger(Size));
278 for (uint16_t
I = 0;
I <
Size;
I += 2) {
280 error(IO.mapInteger(Byte));
281 Record.
Slots.push_back(static_cast<VFTableSlotKind>(Byte & 0xF));
283 Record.
Slots.push_back(static_cast<VFTableSlotKind>(Byte >> 4));
295 if (IO.isWriting()) {
297 NamesLen +=
Name.size() + 1;
299 error(IO.mapInteger(NamesLen));
300 error(IO.mapVectorTail(
308 error(IO.mapInteger(Record.
Id));
352 error(IO.mapVectorN<uint16_t>(
363 error(IO.mapVectorTail(Record.
Methods, MapOneMethodRecord(
true)));
370 error(IO.mapByteVectorTail(Record.
Data));
429 const bool IsFromOverloadList = (
TypeKind == LF_METHODLIST);
430 MapOneMethodRecord Mapper(IsFromOverloadList);
431 return Mapper(IO, Record);
436 uint16_t Padding = 0;
437 error(IO.mapInteger(Padding));
468 uint16_t Padding = 0;
469 error(IO.mapInteger(Padding));
477 uint16_t Padding = 0;
478 error(IO.mapInteger(Padding));
This class represents lattice values for constants.
Error mapInteger(TypeIndex &TypeInd)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Error visitMemberEnd(CVMemberRecord &Record) override
TypeIndex OverriddenVFTable
bool hasUniqueName() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Error visitTypeEnd(CVType &Record) override
uint32_t maxFieldLength() const
static Error visitKnownRecord(CVSymbol &Record, SymbolVisitorCallbacks &Callbacks)
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
TypeIndex ContinuationIndex
std::vector< TypeIndex > StringIndices
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
static Error visitKnownMember(CVMemberRecord &Record, TypeVisitorCallbacks &Callbacks)
size_t size() const
size - Get the array size.
Optional< MemberPointerInfo > MemberInfo
LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records together.
std::vector< TypeIndex > ArgIndices
For method overload sets. LF_METHOD.
std::vector< StringRef > MethodNames
ModifierOptions Modifiers
bool isPointerToMember() const
static constexpr uint32_t ContinuationLength
CallingConvention CallConv
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
int32_t ThisPointerAdjustment
static ErrorSuccess success()
Create a success value.
static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name, StringRef &UniqueName, bool HasUniqueName)
CallingConvention CallConv
std::vector< OneMethodRecord > Methods
Error mapStringZ(StringRef &Value)
StringRef PrecompFilePath
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::vector< VFTableSlotKind > Slots
ArrayRef< VFTableSlotKind > getSlots() const
Lightweight error class with error context and mandatory checking.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
StringRef - Represent a constant reference to a string, i.e.
SlotIndex - An opaque wrapper around machine indexes.
SmallVector< TypeIndex, MaxArgs > ArgIndices
Error visitMemberBegin(CVMemberRecord &Record) override
PointerToMemberRepresentation Representation
bool isIntroducingVirtual() const