Go to the documentation of this file.
45 #define CV_TYPE(enum, val) {#enum, enum},
46 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
51 #define TYPE_RECORD(ename, value, name) \
54 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
66 template <
typename T,
typename TFlag>
70 return std::string(
"");
74 for (
const auto &
Flag : Flags) {
78 SetFlags.push_back(
Flag);
84 std::string FlagLabel;
86 for (
const auto &
Flag : SetFlags) {
92 FlagLabel += (
Flag.Name.str() +
" (0x" + utohexstr(
Flag.Value) +
")");
95 if (!FlagLabel.empty()) {
96 std::string LabelWithBraces(
" ( ");
97 LabelWithBraces += FlagLabel +
" )";
98 return LabelWithBraces;
103 template <
typename T,
typename TEnum>
109 for (
const auto &EnumItem : EnumValues) {
110 if (EnumItem.Value ==
Value) {
111 Name = EnumItem.Name;
124 std::string AccessSpecifier = std::string(
126 std::string MemberAttrs(AccessSpecifier);
140 struct MapOneMethodRecord {
141 explicit MapOneMethodRecord(
bool IsFromOverloadList)
142 : IsFromOverloadList(IsFromOverloadList) {}
145 std::string
Attrs = getMemberAttributes(
148 if (IsFromOverloadList) {
158 if (!IsFromOverloadList)
165 bool IsFromOverloadList;
181 StringRef &UniqueName,
bool HasUniqueName) {
188 size_t BytesNeeded =
Name.size() + UniqueName.
size() + 2;
189 if (BytesNeeded > BytesLeft) {
196 std::string UniqueB =
Twine(
"??@" + Hash +
"@").
str();
197 assert(UniqueB.size() == 36);
201 const size_t MaxTakeN = 4096;
202 size_t TakeN =
std::min(MaxTakeN, BytesLeft - UniqueB.size() - 2) - 32;
204 std::string NameB = (
Name.take_front(TakeN) + Hash).str();
234 assert(!MemberKind &&
"Already in a member mapping!");
240 if (CVR.
kind() != TypeLeafKind::LF_FIELDLIST &&
241 CVR.
kind() != TypeLeafKind::LF_METHODLIST)
247 auto RecordKind = CVR.
kind();
249 std::string RecordKindName = std::string(
252 error(IO.
mapEnum(RecordKind,
"Record kind: " + RecordKindName));
260 utohexstr(
Index.getIndex()) +
")");
266 assert(!MemberKind &&
"Still in a member mapping!");
276 assert(!MemberKind &&
"Already in a member mapping!");
302 assert(MemberKind &&
"Not in a member mapping!");
315 std::string ModifierNames =
325 std::string CallingConvName = std::string(getEnumName(
327 std::string FuncOptionNames =
341 std::string CallingConvName = std::string(getEnumName(
343 std::string FuncOptionNames =
362 return IO.mapInteger(N,
"Argument");
373 return IO.mapInteger(N,
"Strings");
385 std::string PtrType =
386 std::string(getEnumName(IO,
unsigned(
Record.getPointerKind()),
388 Attr +=
"[ Type: " + PtrType;
390 std::string PtrMode = std::string(getEnumName(
392 Attr +=
", Mode: " + PtrMode;
394 auto PtrSizeOf =
Record.getSize();
395 Attr +=
", SizeOf: " + itostr(PtrSizeOf);
402 Attr +=
", isVolatile";
404 Attr +=
", isUnaligned";
406 Attr +=
", isRestricted";
407 if (
Record.isLValueReferenceThisPtr())
408 Attr +=
", isThisPtr&";
409 if (
Record.isRValueReferenceThisPtr())
410 Attr +=
", isThisPtr&&";
417 if (
Record.isPointerToMember()) {
419 Record.MemberInfo.emplace();
423 std::string PtrMemberGetRepresentation = std::string(getEnumName(
426 "Representation: " + PtrMemberGetRepresentation));
442 assert((CVR.
kind() == TypeLeafKind::LF_STRUCTURE) ||
443 (CVR.
kind() == TypeLeafKind::LF_CLASS) ||
444 (CVR.
kind() == TypeLeafKind::LF_INTERFACE));
446 std::string PropertiesNames =
462 std::string PropertiesNames =
476 std::string PropertiesNames =
533 NamesLen +=
Name.size() + 1;
539 return IO.mapStringZ(S,
"MethodName");
594 return IO.mapInteger(N,
"Argument");
630 std::string ModeName = std::string(
638 std::string
Attrs = getMemberAttributes(
649 std::string
Attrs = getMemberAttributes(
662 std::string
Attrs = getMemberAttributes(
683 const bool IsFromOverloadList = (
TypeKind == LF_METHODLIST);
684 MapOneMethodRecord Mapper(IsFromOverloadList);
685 return Mapper(IO,
Record);
701 std::string
Attrs = getMemberAttributes(
713 std::string
Attrs = getMemberAttributes(
MemberAccess
Source-level access specifier. (CV_access_e)
StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
ArrayRef< EnumEntry< uint16_t > > getMemberKindNames()
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
static void stringifyResult(MD5Result &Result, SmallVectorImpl< char > &Str)
Translates the bytes in Res to a hex string that is deposited into Str.
static constexpr uint32_t ContinuationLength
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Error mapByteVectorTail(ArrayRef< uint8_t > &Bytes, const Twine &Comment="")
static ErrorSuccess success()
Create a success value.
Error mapStringZ(StringRef &Value, const Twine &Comment="")
ArrayRef< EnumEntry< uint16_t > > getTypeModifierNames()
Error mapEnum(T &Value, const Twine &Comment="")
Error visitTypeEnd(CVType &Record) override
static Error visitKnownRecord(CVSymbol &Record, SymbolVisitorCallbacks &Callbacks)
Error beginRecord(Optional< uint32_t > MaxLength)
Error visitMemberRecordStream(ArrayRef< uint8_t > FieldList, TypeVisitorCallbacks &Callbacks)
ArrayRef< EnumEntry< uint16_t > > getMethodOptionNames()
Error visitMemberEnd(CVMemberRecord &Record) override
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records together.
ArrayRef< EnumEntry< uint8_t > > getFunctionOptionEnum()
void emitRawComment(const Twine &T)
For method overload sets. LF_METHOD.
SlotIndex - An opaque wrapper around machine indexes.
Error mapVectorN(T &Items, const ElementMapper &Mapper, const Twine &Comment="")
ArrayRef< EnumEntry< uint8_t > > getPtrKindNames()
ArrayRef< EnumEntry< uint16_t > > getLabelTypeEnum()
bool isIntroducingVirtual() const
Error visitTypeBegin(CVType &Record) override
Paired begin/end actions for all types.
std::string str() const
Return the twine contents as a std::string.
Error visitMemberBegin(CVMemberRecord &Record) override
ArrayRef< EnumEntry< uint8_t > > getPtrModeNames()
StringRef PrecompFilePath
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static StringRef getLeafTypeName(TypeLeafKind LT)
ArrayRef< EnumEntry< uint16_t > > getPtrMemberRepNames()
ArrayRef< EnumEntry< uint8_t > > getMemberAccessNames()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
MethodKind getMethodKind() const
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
StringRef - Represent a constant reference to a string, i.e.
MemberAccess getAccess() const
Error mapInteger(TypeIndex &TypeInd, const Twine &Comment="")
uint32_t maxFieldLength() const
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
constexpr size_t size() const
size - Get the string size.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Error mapEncodedInteger(int64_t &Value, const Twine &Comment="")
static const EnumEntry< TypeLeafKind > LeafTypeNames[]
static void computeHashString(StringRef Name, SmallString< 32 > &StringifiedHash)
Lightweight error class with error context and mandatory checking.
void sort(IteratorTy Start, IteratorTy End)
static Error visitKnownMember(CVMemberRecord &Record, TypeVisitorCallbacks &Callbacks)
static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name, StringRef &UniqueName, bool HasUniqueName)
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
size_t size() const
size - Get the array size.
MethodOptions getOptions() const
ArrayRef< EnumEntry< uint8_t > > getCallingConventions()
Error mapGuid(GUID &Guid, const Twine &Comment="")
ArrayRef< EnumEntry< uint16_t > > getClassOptionNames()
Error mapVectorTail(T &Items, const ElementMapper &Mapper, const Twine &Comment="")
LLVM Value Representation.
MethodOptions
Equivalent to CV_fldattr_t bitfield.