LLDB mainline
UdtRecordCompleter.cpp
Go to the documentation of this file.
2
4#include "PdbIndex.h"
5#include "PdbSymUid.h"
6#include "PdbUtil.h"
7
12#include "SymbolFileNativePDB.h"
13#include "lldb/Core/Address.h"
14#include "lldb/Symbol/Type.h"
17#include "lldb/lldb-forward.h"
18
19#include "llvm/ADT/STLExtras.h"
20#include "llvm/DebugInfo/CodeView/Formatters.h"
21#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
22#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
23#include "llvm/DebugInfo/CodeView/TypeIndex.h"
24#include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
25#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
26#include "llvm/DebugInfo/PDB/PDBTypes.h"
27#include <optional>
28
29using namespace llvm::codeview;
30using namespace llvm::pdb;
31using namespace lldb;
32using namespace lldb_private;
33using namespace lldb_private::npdb;
34
35using Error = llvm::Error;
36
38 PdbTypeSymId id, CompilerType &derived_ct, clang::TagDecl &tag_decl,
39 PdbAstBuilderClang &ast_builder, PdbIndex &index,
40 llvm::DenseMap<clang::Decl *, DeclStatus> &decl_to_status,
41 llvm::DenseMap<lldb::opaque_compiler_type_t,
42 llvm::SmallSet<std::pair<llvm::StringRef, CompilerType>, 8>>
43 &cxx_record_map)
44 : m_cv_tag_record(CVTagRecord::create(index.tpi().getType(id.index))),
45 m_id(id), m_derived_ct(derived_ct), m_tag_decl(tag_decl),
46 m_ast_builder(ast_builder), m_index(index),
47 m_decl_to_status(decl_to_status), m_cxx_record_map(cxx_record_map) {
48 switch (m_cv_tag_record.kind()) {
49 case CVTagRecord::Enum:
50 break;
51 case CVTagRecord::Union:
52 m_layout.bit_size = m_cv_tag_record.asUnion().getSize() * 8;
53 m_record.record.kind = Member::Union;
54 break;
55 case CVTagRecord::Class:
56 case CVTagRecord::Struct:
57 m_layout.bit_size = m_cv_tag_record.asClass().getSize() * 8;
58 m_record.record.kind = Member::Struct;
59 break;
60 }
61}
62
64 llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access,
65 std::optional<uint64_t> vtable_idx) {
66 PdbTypeSymId type_id(ti);
67 clang::QualType qt = m_ast_builder.GetOrCreateClangType(type_id);
68
69 CVType udt_cvt = m_index.tpi().getType(ti);
70
71 std::unique_ptr<clang::CXXBaseSpecifier> base_spec =
72 m_ast_builder.clang().CreateBaseClassSpecifier(
73 qt.getAsOpaquePtr(), TranslateMemberAccess(access),
74 vtable_idx.has_value(), udt_cvt.kind() == LF_CLASS);
75 if (!base_spec)
76 return {};
77
78 m_bases.push_back(
79 std::make_pair(vtable_idx.value_or(0), std::move(base_spec)));
80
81 return qt;
82}
83
84void UdtRecordCompleter::AddMethod(llvm::StringRef name, TypeIndex type_idx,
85 MethodOptions options,
86 MemberAttributes attrs) {
87 clang::QualType method_qt =
88 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(type_idx));
89 if (method_qt.isNull())
90 return;
91 CompilerType method_ct = m_ast_builder.ToCompilerType(method_qt);
93 lldb::opaque_compiler_type_t derived_opaque_ty =
94 m_derived_ct.GetOpaqueQualType();
95 auto iter = m_cxx_record_map.find(derived_opaque_ty);
96 if (iter != m_cxx_record_map.end()) {
97 if (iter->getSecond().contains({name, method_ct})) {
98 return;
99 }
100 }
101
102 bool is_artificial = (options & MethodOptions::CompilerGenerated) ==
103 MethodOptions::CompilerGenerated;
104 m_ast_builder.clang().AddMethodToCXXRecordType(
105 derived_opaque_ty, name.data(), /*asm_label=*/{}, method_ct,
106 attrs.isVirtual(), attrs.isStatic(), false, false, false, is_artificial);
107
108 m_cxx_record_map[derived_opaque_ty].insert({name, method_ct});
109}
110
111Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
112 BaseClassRecord &base) {
113 clang::QualType base_qt =
114 AddBaseClassForTypeIndex(base.Type, base.getAccess());
115
116 if (base_qt.isNull())
117 return llvm::Error::success();
118 auto *decl =
119 m_ast_builder.clang().GetAsCXXRecordDecl(base_qt.getAsOpaquePtr());
120 if (!decl) {
121 LLDB_LOG(GetLog(LLDBLog::Symbols), "base ({0}) of {1} is not a record",
122 base.Type, m_id.index);
123 return Error::success();
124 }
125
126 auto offset = clang::CharUnits::fromQuantity(base.getBaseOffset());
127 m_layout.base_offsets.insert(std::make_pair(decl, offset));
128
129 return llvm::Error::success();
130}
131
132Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
133 VirtualBaseClassRecord &base) {
134 // Don't create indirect virtual bases. These records indicate that at least
135 // one base class C of this class virtually inherits the specified class.
136 // We already added that virtual base when creating C. There, it's present as
137 // LF_VBCLASS.
138 if (cvr.Kind == LF_VBCLASS)
139 AddBaseClassForTypeIndex(base.BaseType, base.getAccess(), base.VTableIndex);
140
141 return Error::success();
142}
143
144Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
145 ListContinuationRecord &cont) {
146 return Error::success();
147}
148
149Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
150 VFPtrRecord &vfptr) {
151 return Error::success();
152}
153
154Error UdtRecordCompleter::visitKnownMember(
155 CVMemberRecord &cvr, StaticDataMemberRecord &static_data_member) {
156 clang::QualType member_type =
157 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(static_data_member.Type));
158 if (member_type.isNull())
159 return llvm::Error::success();
160
161 CompilerType member_ct = m_ast_builder.ToCompilerType(member_type);
162
164 m_derived_ct, static_data_member.Name, member_ct);
165
166 // Static constant members may be a const[expr] declaration.
167 // Query the symbol's value as the variable initializer if valid.
168 if (member_ct.IsConst() && member_ct.IsCompleteType()) {
169 // Reconstruct the full name for the static member. Use the names as given
170 // in the PDB. This ensures we match the compiler's style of names (e.g.
171 // "A<B<int> >::Foo" vs "A<B<int>>::Foo").
172 std::string qual_name =
173 (m_cv_tag_record.name() + "::" + static_data_member.Name).str();
174
175 auto results =
176 m_index.globals().findRecordsByName(qual_name, m_index.symrecords());
177
178 for (const auto &result : results) {
179 if (result.second.kind() == SymbolKind::S_CONSTANT) {
180 ConstantSym constant(SymbolRecordKind::ConstantSym);
181 cantFail(SymbolDeserializer::deserializeAs<ConstantSym>(result.second,
182 constant));
183
184 clang::QualType qual_type = decl->getType();
185 unsigned type_width = decl->getASTContext().getIntWidth(qual_type);
186
187 // Get the minimum bit width to encode this constant value.
188 // The bit width of the APSInt might be larger than the bits required to
189 // encode the value.
190 unsigned min_constant_width = 0;
191 if (qual_type->isUnsignedIntegerOrEnumerationType())
192 min_constant_width = constant.Value.getActiveBits();
193 else
194 min_constant_width = constant.Value.getSignificantBits();
195
196 if (qual_type->isIntegralOrEnumerationType()) {
197 if (type_width >= min_constant_width) {
199 decl, constant.Value.extOrTrunc(type_width));
200 } else {
202 "Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
203 "which resolves to a wider constant value ({4} bits). "
204 "Ignoring constant.",
205 m_derived_ct.GetTypeName(), static_data_member.Name,
206 member_ct.GetTypeName(), type_width, min_constant_width);
207 }
208 } else {
209 lldb::BasicType basic_type_enum = member_ct.GetBasicTypeEnumeration();
210 switch (basic_type_enum) {
214 if (type_width == min_constant_width) {
216 decl, basic_type_enum == lldb::eBasicTypeFloat
217 ? llvm::APFloat(constant.Value.bitsToFloat())
218 : llvm::APFloat(constant.Value.bitsToDouble()));
219 decl->setConstexpr(true);
220 } else {
221 LLDB_LOG(
223 "Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
224 "which resolves to a constant value of mismatched width "
225 "({4} bits). Ignoring constant.",
226 m_derived_ct.GetTypeName(), static_data_member.Name,
227 member_ct.GetTypeName(), type_width, min_constant_width);
228 }
229 break;
230 default:
231 break;
232 }
233 }
234 break;
235 }
236 }
237 }
238
239 // FIXME: Add a PdbSymUid namespace for field list members and update
240 // the m_uid_to_decl map with this decl.
241 return Error::success();
242}
243
244Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
245 NestedTypeRecord &nested) {
246 // Typedefs can only be added on structs.
247 if (m_record.record.kind != Member::Struct)
248 return Error::success();
249
250 clang::QualType qt =
251 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(nested.Type, false));
252 if (qt.isNull())
253 return Error::success();
254 CompilerType ct = m_ast_builder.ToCompilerType(qt);
255
256 // There's no distinction between nested types and typedefs, so check if we
257 // encountered a nested type.
258 auto *pdb = static_cast<SymbolFileNativePDB *>(
259 m_ast_builder.clang().GetSymbolFile()->GetBackingSymbolFile());
260 std::optional<TypeIndex> parent = pdb->GetParentType(nested.Type);
261 if (parent && *parent == m_id.index && ct.GetTypeName(true) == nested.Name)
262 return Error::success();
263
264 clang::DeclContext *decl_ctx =
265 m_ast_builder.GetOrCreateClangDeclContextForUid(m_id);
266 if (!decl_ctx)
267 return Error::success();
268
269 std::string name = nested.Name.str();
270 ct.CreateTypedef(name.c_str(), m_ast_builder.ToCompilerDeclContext(decl_ctx),
271 0);
272 return Error::success();
273}
274
275Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
276 DataMemberRecord &data_member) {
277
278 uint64_t offset = data_member.FieldOffset * 8;
279 uint32_t bitfield_width = 0;
280
281 TypeIndex ti(data_member.Type);
282 if (!ti.isSimple()) {
283 CVType cvt = m_index.tpi().getType(ti);
284 if (cvt.kind() == LF_BITFIELD) {
285 BitFieldRecord bfr;
286 llvm::cantFail(TypeDeserializer::deserializeAs<BitFieldRecord>(cvt, bfr));
287 offset += bfr.BitOffset;
288 bitfield_width = bfr.BitSize;
289 ti = bfr.Type;
290 }
291 }
292
293 clang::QualType member_qt =
294 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(ti));
295 if (member_qt.isNull())
296 return Error::success();
297 TypeSystemClang::RequireCompleteType(m_ast_builder.ToCompilerType(member_qt));
298 lldb::AccessType access = TranslateMemberAccess(data_member.getAccess());
299 size_t field_size =
300 bitfield_width ? bitfield_width : GetSizeOfType(ti, m_index.tpi()) * 8;
301 if (field_size == 0)
302 return Error::success();
303 m_record.CollectMember(data_member.Name, offset, field_size, member_qt, access,
304 bitfield_width);
305 return Error::success();
306}
307
308Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
309 OneMethodRecord &one_method) {
310 AddMethod(one_method.Name, one_method.Type, one_method.getOptions(),
311 one_method.Attrs);
312
313 return Error::success();
314}
315
316Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
317 OverloadedMethodRecord &overloaded) {
318 TypeIndex method_list_idx = overloaded.MethodList;
319
320 CVType method_list_type = m_index.tpi().getType(method_list_idx);
321 assert(method_list_type.kind() == LF_METHODLIST);
322
323 MethodOverloadListRecord method_list;
324 llvm::cantFail(TypeDeserializer::deserializeAs<MethodOverloadListRecord>(
325 method_list_type, method_list));
326
327 for (const OneMethodRecord &method : method_list.Methods)
328 AddMethod(overloaded.Name, method.Type, method.getOptions(), method.Attrs);
329
330 return Error::success();
331}
332
333Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
334 EnumeratorRecord &enumerator) {
335 Declaration decl;
336 llvm::StringRef name = DropNameScope(enumerator.getName());
337
338 clang::EnumDecl *enum_decl = TypeSystemClang::GetAsEnumDecl(m_derived_ct);
339 if (!enum_decl)
340 return Error::success();
341
342 llvm::APSInt val = enumerator.Value;
343 clang::QualType int_ty = enum_decl->getIntegerType();
344 uint64_t n_bits = m_ast_builder.clang().getASTContext().getTypeSize(int_ty);
345 if (n_bits == 0)
346 return Error::success();
347
348 // MSVC encodes 64 Bit unsigned enum values as signed integers. For example,
349 // ULONGLONG_MAX will be encoded as -1. LLVM encodes all values as unsigned.
350 // Fix this by explicitly setting the bit width and signedness.
351 val = val.extOrTrunc(n_bits);
352 val.setIsSigned(int_ty->isSignedIntegerType());
353
354 m_ast_builder.clang().AddEnumerationValueToEnumerationType(
355 m_derived_ct, decl, name.str().c_str(), val);
356 return Error::success();
357}
358
360 // Ensure the correct order for virtual bases.
361 llvm::stable_sort(m_bases, llvm::less_first());
362
363 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> bases;
364 bases.reserve(m_bases.size());
365 for (auto &ib : m_bases)
366 bases.push_back(std::move(ib.second));
367
369 // Make sure all base classes refer to complete types and not forward
370 // declarations. If we don't do this, clang will crash with an
371 // assertion in the call to clang_type.TransferBaseClasses()
372 for (const auto &base_class : bases) {
373 clang::TypeSourceInfo *type_source_info =
374 base_class->getTypeSourceInfo();
375 if (type_source_info) {
377 clang.GetType(type_source_info->getType()));
378 }
379 }
380
381 clang.TransferBaseClasses(m_derived_ct.GetOpaqueQualType(), std::move(bases));
382
383 clang.AddMethodOverridesForCXXRecordType(m_derived_ct.GetOpaqueQualType());
384 FinishRecord();
387
388 if (auto *record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(&m_tag_decl)) {
389 m_ast_builder.GetClangASTImporter().SetRecordLayout(record_decl, m_layout);
390 }
391}
392
393uint64_t
395 uint64_t bit_offset, CompilerType parent_ct,
396 ClangASTImporter::LayoutInfo &parent_layout,
397 clang::DeclContext *parent_decl_ctx) {
399 clang.GetSymbolFile()->GetBackingSymbolFile());
400 clang::FieldDecl *field_decl = nullptr;
401 uint64_t bit_size = 0;
402 switch (field->kind) {
403 case Member::Field: {
405 parent_ct, field->name, m_ast_builder.ToCompilerType(field->qt),
406 field->bitfield_width);
407 bit_size = field->bit_size;
408 break;
409 };
410 case Member::Struct:
411 case Member::Union: {
412 clang::TagTypeKind kind = field->kind == Member::Struct
413 ? clang::TagTypeKind::Struct
414 : clang::TagTypeKind::Union;
415 ClangASTMetadata metadata;
416 metadata.SetUserID(pdb->anonymous_id);
417 metadata.SetIsDynamicCXXType(false);
418 CompilerType record_ct = clang.CreateRecordType(
419 parent_decl_ctx, OptionalClangModuleID(), "", llvm::to_underlying(kind),
423 clang::DeclContext *decl_ctx = clang.GetDeclContextForType(record_ct);
424 for (const auto &member : field->fields) {
425 uint64_t member_offset = field->kind == Member::Struct
426 ? member->bit_offset - field->base_offset
427 : 0;
428 uint64_t member_bit_size = AddMember(clang, member.get(), member_offset,
429 record_ct, layout, decl_ctx);
430 if (field->kind == Member::Struct)
431 bit_size = std::max(bit_size, member_offset + member_bit_size);
432 else
433 bit_size = std::max(bit_size, member_bit_size);
434 }
435 layout.bit_size = bit_size;
437 clang::RecordDecl *record_decl = clang.GetAsRecordDecl(record_ct);
438 m_ast_builder.GetClangASTImporter().SetRecordLayout(record_decl, layout);
439 field_decl =
440 TypeSystemClang::AddFieldToRecordType(parent_ct, "", record_ct, 0);
441 // Mark this record decl as completed.
442 DeclStatus status;
443 status.resolved = true;
444 status.uid = pdb->anonymous_id--;
445 m_decl_to_status.insert({record_decl, status});
446 break;
447 };
448 }
449 // FIXME: Add a PdbSymUid namespace for field list members and update
450 // the m_uid_to_decl map with this decl.
451 parent_layout.field_offsets.insert({field_decl, bit_offset});
452 return bit_size;
453}
454
457 clang::DeclContext *decl_ctx =
458 m_ast_builder.GetOrCreateClangDeclContextForUid(m_id);
459 m_record.ConstructRecord();
460 // Maybe we should check the construsted record size with the size in pdb. If
461 // they mismatch, it might be pdb has fields info missing.
462 for (const auto &field : m_record.record.fields) {
463 AddMember(clang, field.get(), field->bit_offset, m_derived_ct, m_layout,
464 decl_ctx);
465 }
466}
467
469 llvm::StringRef name, uint64_t offset, uint64_t field_size,
470 clang::QualType qt, lldb::AccessType access, uint64_t bitfield_width) {
471 fields_map[offset].push_back(std::make_unique<Member>(
472 name, offset, field_size, qt, access, bitfield_width));
473 if (start_offset > offset)
474 start_offset = offset;
475}
476
478 // For anonymous unions in a struct, msvc generated pdb doesn't have the
479 // entity for that union. So, we need to construct anonymous union and struct
480 // based on field offsets. The final AST is likely not matching the exact
481 // original AST, but the memory layout is preseved.
482 // After we collecting all fields in visitKnownMember, we have all fields in
483 // increasing offset order in m_fields. Since we are iterating in increase
484 // offset order, if the current offset is equal to m_start_offset, we insert
485 // it as direct field of top level record. If the current offset is greater
486 // than m_start_offset, we should be able to find a field in end_offset_map
487 // whose end offset is less than or equal to current offset. (if not, it might
488 // be missing field info. We will ignore the field in this case. e.g. Field A
489 // starts at 0 with size 4 bytes, and Field B starts at 2 with size 4 bytes.
490 // Normally, there must be something which ends at/before 2.) Then we will
491 // append current field to the end of parent record. If parent is struct, we
492 // can just grow it. If parent is a field, it's a field inside an union. We
493 // convert it into an anonymous struct containing old field and new field.
494
495 // The end offset to a vector of field/struct that ends at the offset.
496 std::map<uint64_t, std::vector<Member *>> end_offset_map;
497 auto is_last_end_offset = [&](auto it) {
498 return it != end_offset_map.end() && ++it == end_offset_map.end();
499 };
500
501 for (auto &pair : fields_map) {
502 uint64_t offset = pair.first;
503 auto &fields = pair.second;
504 assert(offset >= start_offset);
505 Member *parent = &record;
506 if (offset > start_offset) {
507 // Find the field with largest end offset that is <= offset. If it's less
508 // than offset, it indicates there are padding bytes between end offset
509 // and offset.
510 assert(!end_offset_map.empty());
511 auto iter = end_offset_map.lower_bound(offset);
512 if (iter == end_offset_map.end())
513 --iter;
514 else if (iter->first > offset) {
515 if (iter == end_offset_map.begin())
516 continue;
517 --iter;
518 }
519 if (iter->second.empty())
520 continue;
521
522 // If the new fields come after the already added ones
523 // without overlap, go back to the root.
524 if (iter->first <= offset && is_last_end_offset(iter)) {
525 if (record.kind == Member::Struct) {
526 parent = &record;
527 } else {
528 assert(record.kind == Member::Union &&
529 "Current record must be a union");
530 assert(!record.fields.empty());
531 // For unions, append the field to the last struct
532 parent = record.fields.back().get();
533 }
534 } else {
535 parent = iter->second.back();
536 iter->second.pop_back();
537 }
538 }
539 // If it's a field, then the field is inside a union, so we can safely
540 // increase its size by converting it to a struct to hold multiple fields.
541 if (parent->kind == Member::Field)
542 parent->ConvertToStruct();
543
544 if (fields.size() == 1) {
545 uint64_t end_offset = offset + fields.back()->bit_size;
546 parent->fields.push_back(std::move(fields.back()));
547 if (parent->kind == Member::Struct) {
548 end_offset_map[end_offset].push_back(parent);
549 } else {
550 assert(parent == &record &&
551 "If parent is union, it must be the top level record.");
552 end_offset_map[end_offset].push_back(parent->fields.back().get());
553 }
554 } else {
555 if (parent->kind == Member::Struct) {
556 parent->fields.push_back(std::make_unique<Member>(Member::Union));
557 parent = parent->fields.back().get();
558 parent->bit_offset = offset;
559 } else {
560 assert(parent == &record &&
561 "If parent is union, it must be the top level record.");
562 }
563 for (auto &field : fields) {
564 int64_t bit_size = field->bit_size;
565 parent->fields.push_back(std::move(field));
566 end_offset_map[offset + bit_size].push_back(
567 parent->fields.back().get());
568 }
569 }
570 }
571}
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition Log.h:375
llvm::Error Error
void SetUserID(lldb::user_id_t user_id)
void SetIsDynamicCXXType(std::optional< bool > b)
Generic representation of a type in a programming language.
lldb::BasicType GetBasicTypeEnumeration() const
ConstString GetTypeName(bool BaseOnly=false) const
CompilerType CreateTypedef(const char *name, const CompilerDeclContext &decl_ctx, uint32_t payload) const
Create a typedef to this type using "name" as the name of the typedef this type is valid and the type...
A TypeSystem implementation based on Clang.
static void SetFloatingInitializerForVariable(clang::VarDecl *var, const llvm::APFloat &init_value)
Initializes a variable with a floating point value.
static void SetIntegerInitializerForVariable(clang::VarDecl *var, const llvm::APInt &init_value)
Initializes a variable with an integer value.
static clang::VarDecl * AddVariableToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &var_type)
static void BuildIndirectFields(const CompilerType &type)
static clang::CXXRecordDecl * GetAsCXXRecordDecl(lldb::opaque_compiler_type_t type)
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
static bool StartTagDeclarationDefinition(const CompilerType &type)
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, uint32_t bitfield_bit_size)
static clang::EnumDecl * GetAsEnumDecl(const CompilerType &type)
static void RequireCompleteType(CompilerType type)
Complete a type from debug info, or mark it as forcefully completed if there is no definition of the ...
PdbIndex - Lazy access to the important parts of a PDB file.
Definition PdbIndex.h:47
llvm::DenseMap< lldb::opaque_compiler_type_t, llvm::SmallSet< std::pair< llvm::StringRef, CompilerType >, 8 > > & m_cxx_record_map
ClangASTImporter::LayoutInfo m_layout
llvm::DenseMap< clang::Decl *, DeclStatus > & m_decl_to_status
uint64_t AddMember(TypeSystemClang &clang, Member *field, uint64_t bit_offset, CompilerType parent_ct, ClangASTImporter::LayoutInfo &parent_layout, clang::DeclContext *decl_ctx)
UdtRecordCompleter(PdbTypeSymId id, CompilerType &derived_ct, clang::TagDecl &tag_decl, PdbAstBuilderClang &ast_builder, PdbIndex &index, llvm::DenseMap< clang::Decl *, DeclStatus > &decl_to_status, llvm::DenseMap< lldb::opaque_compiler_type_t, llvm::SmallSet< std::pair< llvm::StringRef, CompilerType >, 8 > > &cxx_record_map)
clang::QualType AddBaseClassForTypeIndex(llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access, std::optional< uint64_t > vtable_idx=std::optional< uint64_t >())
void AddMethod(llvm::StringRef name, llvm::codeview::TypeIndex type_idx, llvm::codeview::MethodOptions options, llvm::codeview::MemberAttributes attrs)
llvm::StringRef DropNameScope(llvm::StringRef name)
Definition PdbUtil.cpp:602
lldb::AccessType TranslateMemberAccess(llvm::codeview::MemberAccess access)
size_t GetSizeOfType(PdbTypeSymId id, llvm::pdb::TpiStream &tpi)
Definition PdbUtil.cpp:1150
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:338
void * opaque_compiler_type_t
Definition lldb-types.h:91
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeLongDouble
@ eLanguageTypeC_plus_plus
ISO C++:1998.
llvm::DenseMap< const clang::FieldDecl *, uint64_t > field_offsets
llvm::codeview::TypeIndex index
Definition PdbSymUid.h:73
enum lldb_private::npdb::UdtRecordCompleter::Member::Kind kind
void CollectMember(llvm::StringRef name, uint64_t offset, uint64_t field_size, clang::QualType qt, lldb::AccessType access, uint64_t bitfield_width)
std::map< uint64_t, llvm::SmallVector< MemberUP, 1 > > fields_map