Go to the documentation of this file.
43 #define CV_TYPE(enum, val) {#enum, enum},
44 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
49 #define TYPE_RECORD(ename, value, name) \
52 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
64 template <
typename T,
typename TFlag>
68 return std::string(
"");
72 for (
const auto &
Flag : Flags) {
76 SetFlags.push_back(
Flag);
82 std::string FlagLabel;
84 for (
const auto &
Flag : SetFlags) {
90 FlagLabel += (
Flag.Name.str() +
" (0x" + utohexstr(
Flag.Value) +
")");
93 if (!FlagLabel.empty()) {
94 std::string LabelWithBraces(
" ( ");
95 LabelWithBraces += FlagLabel +
" )";
96 return LabelWithBraces;
101 template <
typename T,
typename TEnum>
107 for (
const auto &EnumItem : EnumValues) {
108 if (EnumItem.Value ==
Value) {
109 Name = EnumItem.Name;
122 std::string AccessSpecifier = std::string(
124 std::string MemberAttrs(AccessSpecifier);
138 struct MapOneMethodRecord {
139 explicit MapOneMethodRecord(
bool IsFromOverloadList)
140 : IsFromOverloadList(IsFromOverloadList) {}
143 std::string
Attrs = getMemberAttributes(
146 if (IsFromOverloadList) {
156 if (!IsFromOverloadList)
163 bool IsFromOverloadList;
179 StringRef &UniqueName,
bool HasUniqueName) {
186 size_t BytesNeeded =
Name.size() + UniqueName.
size() + 2;
187 if (BytesNeeded > BytesLeft) {
194 std::string UniqueB =
Twine(
"??@" + Hash +
"@").
str();
195 assert(UniqueB.size() == 36);
199 const size_t MaxTakeN = 4096;
200 size_t TakeN =
std::min(MaxTakeN, BytesLeft - UniqueB.size() - 2) - 32;
202 std::string NameB = (
Name.take_front(TakeN) + Hash).str();
238 if (CVR.
kind() != TypeLeafKind::LF_FIELDLIST &&
239 CVR.
kind() != TypeLeafKind::LF_METHODLIST)
245 auto RecordKind = CVR.
kind();
247 std::string RecordKindName = std::string(
250 error(IO.
mapEnum(RecordKind,
"Record kind: " + RecordKindName));
258 utohexstr(
Index.getIndex()) +
")");
313 std::string ModifierNames =
323 std::string CallingConvName = std::string(getEnumName(
325 std::string FuncOptionNames =
339 std::string CallingConvName = std::string(getEnumName(
341 std::string FuncOptionNames =
360 return IO.mapInteger(N,
"Argument");
371 return IO.mapInteger(N,
"Strings");
383 std::string PtrType =
384 std::string(getEnumName(IO,
unsigned(
Record.getPointerKind()),
386 Attr +=
"[ Type: " + PtrType;
388 std::string PtrMode = std::string(getEnumName(
390 Attr +=
", Mode: " + PtrMode;
392 auto PtrSizeOf =
Record.getSize();
393 Attr +=
", SizeOf: " + itostr(PtrSizeOf);
400 Attr +=
", isVolatile";
402 Attr +=
", isUnaligned";
404 Attr +=
", isRestricted";
405 if (
Record.isLValueReferenceThisPtr())
406 Attr +=
", isThisPtr&";
407 if (
Record.isRValueReferenceThisPtr())
408 Attr +=
", isThisPtr&&";
415 if (
Record.isPointerToMember()) {
417 Record.MemberInfo.emplace();
421 std::string PtrMemberGetRepresentation = std::string(getEnumName(
424 "Representation: " + PtrMemberGetRepresentation));
440 assert((CVR.
kind() == TypeLeafKind::LF_STRUCTURE) ||
441 (CVR.
kind() == TypeLeafKind::LF_CLASS) ||
442 (CVR.
kind() == TypeLeafKind::LF_INTERFACE));
444 std::string PropertiesNames =
460 std::string PropertiesNames =
474 std::string PropertiesNames =
531 NamesLen +=
Name.size() + 1;
537 return IO.mapStringZ(S,
"MethodName");
592 return IO.mapInteger(N,
"Argument");
628 std::string ModeName = std::string(
636 std::string
Attrs = getMemberAttributes(
647 std::string
Attrs = getMemberAttributes(
660 std::string
Attrs = getMemberAttributes(
681 const bool IsFromOverloadList = (
TypeKind == LF_METHODLIST);
682 MapOneMethodRecord Mapper(IsFromOverloadList);
683 return Mapper(IO,
Record);
699 std::string
Attrs = getMemberAttributes(
711 std::string
Attrs = getMemberAttributes(
MemberAccess
Source-level access specifier. (CV_access_e)
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)
constexpr bool hasValue() const
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.
LLVM_NODISCARD StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
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 LLVM_NODISCARD 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.