46#define TYPE_RECORD(EnumName, EnumVal, Name) \
47 Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
48#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
49#define MEMBER_RECORD(EnumName, EnumVal, Name)
50#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
62 CurrentTypeIndex =
Index;
68Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
70 Name =
"<field list>";
81 auto Indices =
Args.getIndices();
85 if (Indices[
I] < CurrentTypeIndex)
88 Name.append(
"<unknown 0x" + utohexstr(Indices[
I].getIndex()) +
">");
96Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
98 auto Indices = Strings.getIndices();
104 Name.append(
"\" \"");
106 Name.push_back(
'\"');
143 Name =
formatv(
"{0} {1}", Ret, Params).sstr<256>();
147Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
152 Name =
formatv(
"{0} {1}::{2}", Ret, Class, Params).sstr<256>();
168 if (
Ptr.isPointerToMember()) {
177 if (
Ptr.getMode() == PointerMode::LValueReference)
179 else if (
Ptr.getMode() == PointerMode::RValueReference)
181 else if (
Ptr.getMode() == PointerMode::Pointer)
187 Name.append(
" const");
188 if (
Ptr.isVolatile())
189 Name.append(
" volatile");
190 if (
Ptr.isUnaligned())
191 Name.append(
" __unaligned");
192 if (
Ptr.isRestrict())
193 Name.append(
" __restrict");
201 if (Mods &
uint16_t(ModifierOptions::Const))
202 Name.append(
"const ");
203 if (Mods &
uint16_t(ModifierOptions::Volatile))
204 Name.append(
"volatile ");
205 if (Mods &
uint16_t(ModifierOptions::Unaligned))
206 Name.append(
"__unaligned ");
211Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
217Error TypeNameComputer::visitKnownRecord(
222Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
231Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
244Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
249Error TypeNameComputer::visitKnownRecord(
CVType &CVR,
256 TypeNameComputer Computer(Types);
260 return "<unknown UDT>";
262 return std::string(Computer.name());
266 switch (
Sym.kind()) {
268 case SymbolKind::S_GPROC32:
269 case SymbolKind::S_LPROC32:
270 case SymbolKind::S_GPROC32_ID:
271 case SymbolKind::S_LPROC32_ID:
272 case SymbolKind::S_LPROC32_DPC:
273 case SymbolKind::S_LPROC32_DPC_ID:
276 case SymbolKind::S_THUNK32:
279 case SymbolKind::S_SECTION:
282 case SymbolKind::S_COFFGROUP:
285 case SymbolKind::S_PUB32:
286 case SymbolKind::S_FILESTATIC:
287 case SymbolKind::S_REGREL32:
288 case SymbolKind::S_GDATA32:
289 case SymbolKind::S_LDATA32:
290 case SymbolKind::S_LMANDATA:
291 case SymbolKind::S_GMANDATA:
292 case SymbolKind::S_LTHREAD32:
293 case SymbolKind::S_GTHREAD32:
294 case SymbolKind::S_PROCREF:
295 case SymbolKind::S_LPROCREF:
298 case SymbolKind::S_REGISTER:
299 case SymbolKind::S_LOCAL:
302 case SymbolKind::S_BLOCK32:
305 case SymbolKind::S_LABEL32:
308 case SymbolKind::S_OBJNAME:
309 case SymbolKind::S_EXPORT:
310 case SymbolKind::S_UDT:
313 case SymbolKind::S_BPREL32:
316 case SymbolKind::S_UNAMESPACE:
324 if (
Sym.kind() == SymbolKind::S_CONSTANT) {
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
static int getSymbolNameOffset(CVSymbol Sym)
This file defines the SmallString class.
Provides read only access to a subclass of BinaryStream.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
StringRef getName() const
TypeIndex getReturnType() const
TypeIndex getArgumentList() const
TypeIndex getClassType() const
TypeIndex getReturnType() const
TypeIndex getArgumentList() const
Error visitSymbolEnd(CVSymbol &Record) override
Error visitSymbolBegin(CVSymbol &Record) override
StringRef getName() const
virtual Error visitTypeEnd(CVType &Record)
virtual Error visitTypeBegin(CVType &Record)
Paired begin/end actions for all types.
StringRef getName() const
uint32_t getEntryCount() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
std::string computeTypeName(TypeCollection &Types, TypeIndex Index)
StringRef getSymbolName(CVSymbol Sym)
Error visitTypeRecord(CVType &Record, TypeIndex Index, TypeVisitorCallbacks &Callbacks, VisitorDataSource Source=VDS_BytesPresent)
StringRef toStringRef(const std::optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
NodeAddr< FuncNode * > Func
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(const char *Fmt, Ts &&...Vals) -> formatv_object< decltype(std::make_tuple(support::detail::build_format_adapter(std::forward< Ts >(Vals))...))>
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
void consumeError(Error Err)
Consume a Error without doing anything.