13 #include "clang/AST/CharUnits.h"
14 #include "clang/AST/Decl.h"
15 #include "clang/AST/DeclCXX.h"
26 #include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
27 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
28 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
29 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
30 #include "llvm/DebugInfo/PDB/PDBSymbolData.h"
31 #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
32 #include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
33 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
34 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
35 #include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
36 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
37 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
38 #include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
39 #include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
40 #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
50 case PDB_UdtType::Class:
51 return clang::TTK_Class;
52 case PDB_UdtType::Struct:
53 return clang::TTK_Struct;
54 case PDB_UdtType::Union:
55 return clang::TTK_Union;
56 case PDB_UdtType::Interface:
57 return clang::TTK_Interface;
59 llvm_unreachable(
"unsuported PDB UDT type");
64 case PDB_BuiltinType::Float:
66 case PDB_BuiltinType::Int:
67 case PDB_BuiltinType::Long:
68 case PDB_BuiltinType::Char:
70 case PDB_BuiltinType::Bool:
71 case PDB_BuiltinType::Char16:
72 case PDB_BuiltinType::Char32:
74 case PDB_BuiltinType::ULong:
75 case PDB_BuiltinType::HResult:
76 case PDB_BuiltinType::WCharT:
85 case PDB_VariantType::Int8:
86 case PDB_VariantType::Int16:
87 case PDB_VariantType::Int32:
88 case PDB_VariantType::Int64:
91 case PDB_VariantType::UInt8:
92 case PDB_VariantType::UInt16:
93 case PDB_VariantType::UInt32:
94 case PDB_VariantType::UInt64:
106 const PDBSymbolTypeBuiltin &pdb_type,
110 switch (pdb_type.getBuiltinType()) {
113 case PDB_BuiltinType::None:
115 case PDB_BuiltinType::Void:
117 case PDB_BuiltinType::Char:
119 case PDB_BuiltinType::Bool:
121 case PDB_BuiltinType::Long:
122 if (width == ast.getTypeSize(ast.LongTy))
123 return CompilerType(&clang_ast, ast.LongTy.getAsOpaquePtr());
124 if (width == ast.getTypeSize(ast.LongLongTy))
125 return CompilerType(&clang_ast, ast.LongLongTy.getAsOpaquePtr());
127 case PDB_BuiltinType::ULong:
128 if (width == ast.getTypeSize(ast.UnsignedLongTy))
129 return CompilerType(&clang_ast, ast.UnsignedLongTy.getAsOpaquePtr());
130 if (width == ast.getTypeSize(ast.UnsignedLongLongTy))
131 return CompilerType(&clang_ast, ast.UnsignedLongLongTy.getAsOpaquePtr());
133 case PDB_BuiltinType::WCharT:
134 if (width == ast.getTypeSize(ast.WCharTy))
135 return CompilerType(&clang_ast, ast.WCharTy.getAsOpaquePtr());
137 case PDB_BuiltinType::Char16:
138 return CompilerType(&clang_ast, ast.Char16Ty.getAsOpaquePtr());
139 case PDB_BuiltinType::Char32:
140 return CompilerType(&clang_ast, ast.Char32Ty.getAsOpaquePtr());
141 case PDB_BuiltinType::Float:
155 PDB_BuiltinType kind = pdb_type.getBuiltinType();
159 case PDB_BuiltinType::Currency:
161 case PDB_BuiltinType::Date:
163 case PDB_BuiltinType::Variant:
165 case PDB_BuiltinType::Complex:
167 case PDB_BuiltinType::Bitfield:
169 case PDB_BuiltinType::BSTR:
171 case PDB_BuiltinType::HResult:
173 case PDB_BuiltinType::BCD:
175 case PDB_BuiltinType::Char16:
177 case PDB_BuiltinType::Char32:
179 case PDB_BuiltinType::None:
187 auto &raw_sym = symbol.getRawSymbol();
188 auto first_line_up = raw_sym.getSrcLineOnTypeDefn();
190 if (!first_line_up) {
191 auto lines_up = symbol.getSession().findLineNumbersByAddress(
192 raw_sym.getVirtualAddress(), raw_sym.getLength());
195 first_line_up = lines_up->getNext();
199 uint32_t src_file_id = first_line_up->getSourceFileId();
200 auto src_file_up = symbol.getSession().getSourceFileById(src_file_id);
204 FileSpec spec(src_file_up->getFileName());
206 decl.
SetColumn(first_line_up->getColumnNumber());
207 decl.
SetLine(first_line_up->getLineNumber());
213 case PDB_MemberAccess::Private:
215 case PDB_MemberAccess::Protected:
217 case PDB_MemberAccess::Public:
225 case PDB_UdtType::Struct:
226 case PDB_UdtType::Union:
228 case PDB_UdtType::Class:
229 case PDB_UdtType::Interface:
232 llvm_unreachable(
"unsupported PDB UDT type");
240 auto parent = udt.getClassParent();
244 auto parent_udt = llvm::dyn_cast<PDBSymbolTypeUDT>(parent.get());
251 static clang::MSInheritanceAttr::Spelling
254 bool has_virtual =
false;
256 auto bases_enum = udt.findAllChildren<PDBSymbolTypeBaseClass>();
258 while (
auto base = bases_enum->getNext()) {
260 has_virtual |= base->isVirtualBaseClass();
265 return clang::MSInheritanceAttr::Keyword_virtual_inheritance;
267 return clang::MSInheritanceAttr::Keyword_multiple_inheritance;
268 return clang::MSInheritanceAttr::Keyword_single_inheritance;
271 static std::unique_ptr<llvm::pdb::PDBSymbol>
273 const IPDBSession &session = symbol.getSession();
274 const IPDBRawSymbol &raw = symbol.getRawSymbol();
275 auto tag = symbol.getSymTag();
281 case PDB_SymType::Function:
282 case PDB_SymType::Data:
283 case PDB_SymType::UDT:
284 case PDB_SymType::Enum:
285 case PDB_SymType::FunctionSig:
286 case PDB_SymType::Typedef:
287 case PDB_SymType::BaseClass:
288 case PDB_SymType::VTable: {
289 auto class_parent_id = raw.getClassParentId();
290 if (
auto class_parent = session.getSymbolById(class_parent_id))
301 case PDB_SymType::Block:
302 case PDB_SymType::Data: {
303 auto lexical_parent_id = raw.getLexicalParentId();
304 auto lexical_parent = session.getSymbolById(lexical_parent_id);
308 auto lexical_parent_tag = lexical_parent->getSymTag();
309 if (lexical_parent_tag == PDB_SymType::Function)
310 return lexical_parent;
311 if (lexical_parent_tag == PDB_SymType::Exe)
321 static clang::NamedDecl *
323 const clang::DeclContext &decl_context,
324 llvm::StringRef name) {
325 clang::IdentifierInfo &ident = ast.Idents.get(name);
326 clang::DeclarationName decl_name = ast.DeclarationNames.getIdentifier(&ident);
327 clang::DeclContext::lookup_result result = decl_context.lookup(decl_name);
331 return *result.begin();
335 return name ==
"`anonymous namespace'" || name ==
"`anonymous-namespace'";
340 case llvm::codeview::CallingConvention::NearC:
342 case llvm::codeview::CallingConvention::NearStdCall:
343 return clang::CC_X86StdCall;
344 case llvm::codeview::CallingConvention::NearFast:
345 return clang::CC_X86FastCall;
346 case llvm::codeview::CallingConvention::ThisCall:
347 return clang::CC_X86ThisCall;
348 case llvm::codeview::CallingConvention::NearVector:
349 return clang::CC_X86VectorCall;
350 case llvm::codeview::CallingConvention::NearPascal:
351 return clang::CC_X86Pascal;
353 assert(
false &&
"Unknown calling convention");
366 switch (type.getSymTag()) {
367 case PDB_SymType::BaseClass: {
372 auto ty = symbol_file->
ResolveTypeUID(type.getRawSymbol().getTypeId());
373 return ty ? ty->shared_from_this() :
nullptr;
375 case PDB_SymType::UDT: {
376 auto udt = llvm::dyn_cast<PDBSymbolTypeUDT>(&type);
387 if (udt->getLength() == 0)
411 metadata.
SetUserID(type.getSymIndexId());
424 auto inheritance_attr = clang::MSInheritanceAttr::CreateImplicit(
426 record_decl->addAttr(inheritance_attr);
428 TypeSystemClang::StartTagDeclarationDefinition(clang_type);
430 auto children = udt->findAllChildren();
431 if (!children || children->getChildCount() == 0) {
434 TypeSystemClang::CompleteTagDeclarationDefinition(clang_type);
439 type_resolve_state = Type::ResolveState::Full;
448 type_resolve_state = Type::ResolveState::Forward;
451 type_resolve_state = Type::ResolveState::Forward;
453 if (udt->isConstType())
456 if (udt->isVolatileType())
460 return std::make_shared<lldb_private::Type>(
466 case PDB_SymType::Enum: {
467 auto enum_type = llvm::dyn_cast<PDBSymbolTypeEnum>(&type);
473 uint64_t bytes = enum_type->getLength();
479 auto underlying_type_up = enum_type->getUnderlyingType();
480 if (!underlying_type_up)
487 auto first_child = enum_type->findOneChild<PDBSymbolData>();
494 m_ast, *underlying_type_up, encoding, bytes * 8);
500 bool isScoped =
false;
504 builtin_type, isScoped);
506 auto enum_decl = TypeSystemClang::GetAsEnumDecl(ast_enum);
510 auto enum_values = enum_type->findAllChildren<PDBSymbolData>();
512 while (
auto enum_value = enum_values->getNext()) {
513 if (enum_value->getDataKind() != PDB_DataKind::Constant)
519 if (TypeSystemClang::StartTagDeclarationDefinition(ast_enum))
520 TypeSystemClang::CompleteTagDeclarationDefinition(ast_enum);
523 if (enum_type->isConstType())
526 if (enum_type->isVolatileType())
530 return std::make_shared<lldb_private::Type>(
535 case PDB_SymType::Typedef: {
536 auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type);
564 auto typedef_decl = TypeSystemClang::GetAsTypedefDecl(ast_typedef);
565 assert(typedef_decl);
569 if (type_def->isConstType())
572 if (type_def->isVolatileType())
576 llvm::Optional<uint64_t> size;
577 if (type_def->getLength())
578 size = type_def->getLength();
579 return std::make_shared<lldb_private::Type>(
581 size,
nullptr, target_type->
GetID(),
585 case PDB_SymType::Function:
586 case PDB_SymType::FunctionSig: {
588 PDBSymbolTypeFunctionSig *func_sig =
nullptr;
589 if (
auto pdb_func = llvm::dyn_cast<PDBSymbolFunc>(&type)) {
590 if (pdb_func->isCompilerGenerated())
593 auto sig = pdb_func->getSignature();
596 func_sig = sig.release();
600 }
else if (
auto pdb_func_sig =
601 llvm::dyn_cast<PDBSymbolTypeFunctionSig>(&type)) {
602 func_sig =
const_cast<PDBSymbolTypeFunctionSig *
>(pdb_func_sig);
604 llvm_unreachable(
"Unexpected PDB symbol!");
606 auto arg_enum = func_sig->getArguments();
607 uint32_t num_args = arg_enum->getChildCount();
608 std::vector<CompilerType> arg_list;
610 bool is_variadic = func_sig->isCVarArgs();
614 for (
uint32_t arg_idx = 0; arg_idx < num_args; arg_idx++) {
615 auto arg = arg_enum->getChildAtIndex(arg_idx);
630 arg_list.push_back(arg_ast_type);
634 auto pdb_return_type = func_sig->getReturnType();
647 if (func_sig->isConstType())
648 type_quals |= clang::Qualifiers::Const;
649 if (func_sig->isVolatileType())
650 type_quals |= clang::Qualifiers::Volatile;
654 arg_list.size(), is_variadic, type_quals, cc);
657 return std::make_shared<lldb_private::Type>(
663 case PDB_SymType::ArrayType: {
664 auto array_type = llvm::dyn_cast<PDBSymbolTypeArray>(&type);
666 uint32_t num_elements = array_type->getCount();
667 uint32_t element_uid = array_type->getElementTypeId();
668 llvm::Optional<uint64_t> bytes;
669 if (uint64_t size = array_type->getLength())
684 if (TypeSystemClang::IsCXXClassType(element_ast_type) &&
686 if (TypeSystemClang::StartTagDeclarationDefinition(element_ast_type)) {
687 TypeSystemClang::CompleteTagDeclarationDefinition(element_ast_type);
694 element_ast_type, num_elements,
false);
695 TypeSP type_sp = std::make_shared<lldb_private::Type>(
699 type_sp->SetEncodingType(element_type);
702 case PDB_SymType::BuiltinType: {
703 auto *builtin_type = llvm::dyn_cast<PDBSymbolTypeBuiltin>(&type);
704 assert(builtin_type);
705 PDB_BuiltinType builtin_kind = builtin_type->getBuiltinType();
706 if (builtin_kind == PDB_BuiltinType::None)
709 llvm::Optional<uint64_t> bytes;
710 if (uint64_t size = builtin_type->getLength())
714 m_ast, *builtin_type, encoding, bytes.getValueOr(0) * 8);
716 if (builtin_type->isConstType())
719 if (builtin_type->isVolatileType())
724 return std::make_shared<lldb_private::Type>(
729 case PDB_SymType::PointerType: {
730 auto *pointer_type = llvm::dyn_cast<PDBSymbolTypePointer>(&type);
731 assert(pointer_type);
738 pointer_type->getPointeeType()->getSymIndexId());
742 if (pointer_type->isPointerToDataMember() ||
743 pointer_type->isPointerToMemberFunction()) {
744 auto class_parent_uid = pointer_type->getRawSymbol().getClassParentId();
745 auto class_parent_type = symbol_file->
ResolveTypeUID(class_parent_uid);
746 assert(class_parent_type);
749 pointer_ast_type = TypeSystemClang::CreateMemberPointerType(
750 class_parent_type->GetLayoutCompilerType(),
752 assert(pointer_ast_type);
754 return std::make_shared<lldb_private::Type>(
763 if (pointer_type->isReference())
765 else if (pointer_type->isRValueReference())
770 if (pointer_type->isConstType())
773 if (pointer_type->isVolatileType())
776 if (pointer_type->isRestrictedType())
779 return std::make_shared<lldb_private::Type>(
798 clang::CXXRecordDecl *record_decl =
809 std::unique_ptr<PDBSymbol> symbol =
810 symbol_file->
GetPDBSession().getSymbolById(uid_it->getSecond());
819 switch (symbol->getSymTag()) {
820 case PDB_SymType::UDT: {
821 auto udt = llvm::dyn_cast<PDBSymbolTypeUDT>(symbol.get());
828 llvm_unreachable(
"not a forward clang type decl!");
834 uint32_t sym_id = symbol.getSymIndexId();
846 auto tag = symbol.getSymTag();
847 if (tag == PDB_SymType::Data || tag == PDB_SymType::Function) {
848 const IPDBSession &session = symbol.getSession();
849 const IPDBRawSymbol &raw = symbol.getRawSymbol();
851 auto class_parent_id = raw.getClassParentId();
852 if (std::unique_ptr<PDBSymbol> class_parent =
853 session.getSymbolById(class_parent_id)) {
854 auto class_parent_type = symbol_file->
ResolveTypeUID(class_parent_id);
855 if (!class_parent_type)
858 CompilerType class_parent_ct = class_parent_type->GetFullCompilerType();
868 if (
auto func = llvm::dyn_cast_or_null<PDBSymbolFunc>(&symbol)) {
871 if (
uint32_t rva = func->getRelativeVirtualAddress()) {
874 class_parent->findAllChildren<PDBSymbolFunc>()) {
875 while (std::unique_ptr<PDBSymbolFunc> method =
876 methods_enum->getNext()) {
877 if (method->getRelativeVirtualAddress() == rva) {
901 switch (symbol.getSymTag()) {
902 case PDB_SymType::Data: {
903 auto data = llvm::dyn_cast<PDBSymbolData>(&symbol);
907 assert(decl_context);
914 if (
auto parent_decl = llvm::dyn_cast_or_null<clang::TagDecl>(decl_context))
924 auto type = symbol_file->ResolveTypeUID(data->getTypeId());
930 ClangUtil::GetQualType(type->GetLayoutCompilerType()));
937 case PDB_SymType::Function: {
938 auto func = llvm::dyn_cast<PDBSymbolFunc>(&symbol);
942 assert(decl_context);
947 Type *type = symbol_file->ResolveTypeUID(sym_id);
951 auto storage = func->isStatic() ? clang::StorageClass::SC_Static
952 : clang::StorageClass::SC_None;
958 std::vector<clang::ParmVarDecl *> params;
959 if (std::unique_ptr<PDBSymbolTypeFunctionSig> sig = func->getSignature()) {
961 arg_enum = sig->findAllChildren<PDBSymbolTypeFunctionArg>()) {
962 while (std::unique_ptr<PDBSymbolTypeFunctionArg> arg =
963 arg_enum->getNext()) {
964 Type *arg_type = symbol_file->ResolveTypeUID(arg->getTypeId());
972 params.push_back(param);
985 Type *type = symbol_file->ResolveTypeUID(sym_id);
996 if (symbol.getSymTag() == PDB_SymType::Function) {
997 clang::DeclContext *result =
1015 clang::DeclContext *result =
1025 const llvm::pdb::PDBSymbol &symbol) {
1029 return parent_context;
1041 std::string name(symbol.getRawSymbol().getName());
1043 llvm::ArrayRef<MSVCUndecoratedNameSpecifier> specs = parser.
GetSpecifiers();
1052 auto global = symbol_file->GetPDBSession().getGlobalScope();
1056 bool has_type_or_function_parent =
false;
1058 for (std::size_t i = 0; i < specs.size() - 1; i++) {
1060 if (std::unique_ptr<IPDBEnumSymbols> children_enum = global->findChildren(
1061 PDB_SymType::None, specs[i].GetFullName(), NS_CaseSensitive)) {
1062 while (IPDBEnumChildren<PDBSymbol>::ChildTypePtr child =
1063 children_enum->getNext()) {
1064 if (clang::DeclContext *child_context =
1070 has_type_or_function_parent =
true;
1071 curr_context = child_context;
1080 if (!has_type_or_function_parent) {
1082 const char *namespace_name_c_str =
1084 : namespace_name.data();
1085 clang::NamespaceDecl *namespace_decl =
1092 curr_context = namespace_decl;
1096 return curr_context;
1100 const clang::DeclContext *decl_context) {
1109 auto global_up = session.getGlobalScope();
1113 symbol = symbol_up.get();
1115 symbol = global_up.get();
1119 if (
auto children = symbol->findAllChildren())
1120 while (
auto child = children->getNext())
1124 clang::NamespaceDecl *
1126 llvm::StringRef name) {
1139 for (clang::NamespaceDecl *namespace_decl : *
set)
1140 if (namespace_decl->getName().equals(name))
1141 return namespace_decl;
1143 for (clang::NamespaceDecl *namespace_decl : *
set)
1144 if (namespace_decl->isAnonymousNamespace())
1151 const PDBSymbolData &enum_value) {
1153 Variant v = enum_value.getValue();
1158 case PDB_VariantType::Int8:
1159 raw_value = v.Value.Int8;
1161 case PDB_VariantType::Int16:
1162 raw_value = v.Value.Int16;
1164 case PDB_VariantType::Int32:
1165 raw_value = v.Value.Int32;
1167 case PDB_VariantType::Int64:
1168 raw_value = v.Value.Int64;
1170 case PDB_VariantType::UInt8:
1171 raw_value = v.Value.UInt8;
1173 case PDB_VariantType::UInt16:
1174 raw_value = v.Value.UInt16;
1176 case PDB_VariantType::UInt32:
1177 raw_value = v.Value.UInt32;
1179 case PDB_VariantType::UInt64:
1180 raw_value = v.Value.UInt64;
1187 ClangUtil::GetQualType(underlying_type));
1189 enum_type, decl, name.c_str(), raw_value, byte_size * 8);
1190 if (!enum_constant_decl)
1193 m_uid_to_decl[enum_value.getSymIndexId()] = enum_constant_decl;
1201 llvm::pdb::PDBSymbolTypeUDT &udt) {
1203 layout_info.
bit_size = udt.getLength() * 8;
1205 auto nested_enums = udt.findAllChildren<PDBSymbolTypeUDT>();
1207 while (
auto nested = nested_enums->getNext())
1210 auto bases_enum = udt.findAllChildren<PDBSymbolTypeBaseClass>();
1216 auto members_enum = udt.findAllChildren<PDBSymbolData>();
1220 auto methods_enum = udt.findAllChildren<PDBSymbolFunc>();
1225 TypeSystemClang::BuildIndirectFields(compiler_type);
1226 TypeSystemClang::CompleteTagDeclarationDefinition(compiler_type);
1228 clang::CXXRecordDecl *record_decl =
1231 return static_cast<bool>(compiler_type);
1235 return static_cast<bool>(compiler_type);
1243 while (
auto member = members_enum.getNext()) {
1244 if (member->isCompilerGenerated())
1247 auto member_name = member->getName();
1249 auto member_type = symbol_file.
ResolveTypeUID(member->getTypeId());
1254 if (!member_comp_type.GetCompleteType()) {
1256 ":: Class '%s' has a member '%s' of type '%s' "
1257 "which does not have a complete definition.",
1259 member_comp_type.GetTypeName().GetCString());
1260 if (TypeSystemClang::StartTagDeclarationDefinition(member_comp_type))
1261 TypeSystemClang::CompleteTagDeclarationDefinition(member_comp_type);
1266 switch (member->getDataKind()) {
1267 case PDB_DataKind::Member: {
1268 auto location_type = member->getLocationType();
1270 auto bit_size = member->getLength();
1271 if (location_type == PDB_LocType::ThisRel)
1274 auto decl = TypeSystemClang::AddFieldToRecordType(
1275 record_type, member_name.c_str(), member_comp_type, access, bit_size);
1281 auto offset = member->getOffset() * 8;
1282 if (location_type == PDB_LocType::BitField)
1283 offset += member->getBitPosition();
1285 layout_info.
field_offsets.insert(std::make_pair(decl, offset));
1289 case PDB_DataKind::StaticMember: {
1290 auto decl = TypeSystemClang::AddVariableToRecordType(
1291 record_type, member_name.c_str(), member_comp_type, access);
1297 if (member_comp_type.IsConst()) {
1298 auto value = member->getValue();
1299 clang::QualType qual_type = decl->getType();
1301 unsigned constant_width = value.getBitWidth();
1303 if (qual_type->isIntegralOrEnumerationType()) {
1304 if (type_width >= constant_width) {
1305 TypeSystemClang::SetIntegerInitializerForVariable(
1306 decl, value.toAPSInt().extOrTrunc(type_width));
1309 "Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
1310 "which resolves to a wider constant value ({4} bits). "
1311 "Ignoring constant.",
1313 member_comp_type.GetTypeName(), type_width,
1317 switch (member_comp_type.GetBasicTypeEnumeration()) {
1321 if (type_width == constant_width) {
1322 TypeSystemClang::SetFloatingInitializerForVariable(
1323 decl, value.toAPFloat());
1324 decl->setConstexpr(
true);
1327 "Class '{0}' has a member '{1}' of type '{2}' ({3} "
1328 "bits) which resolves to a constant value of mismatched "
1329 "width ({4} bits). Ignoring constant.",
1331 member_comp_type.GetTypeName(), type_width,
1346 llvm_unreachable(
"unsupported PDB data kind");
1356 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> base_classes;
1358 while (
auto base = bases_enum.getNext()) {
1364 if (!base_comp_type.GetCompleteType()) {
1366 ":: Class '%s' has a base class '%s' "
1367 "which does not have a complete definition.",
1369 base_comp_type.GetTypeName().GetCString());
1370 if (TypeSystemClang::StartTagDeclarationDefinition(base_comp_type))
1371 TypeSystemClang::CompleteTagDeclarationDefinition(base_comp_type);
1376 auto is_virtual = base->isVirtualBaseClass();
1378 std::unique_ptr<clang::CXXBaseSpecifier> base_spec =
1381 record_kind == clang::TTK_Class);
1384 base_classes.push_back(std::move(base_spec));
1393 auto offset = clang::CharUnits::fromQuantity(base->getOffset());
1394 layout_info.
base_offsets.insert(std::make_pair(decl, offset));
1398 std::move(base_classes));
1404 while (std::unique_ptr<PDBSymbolFunc> method = methods_enum.getNext())
1405 if (clang::CXXMethodDecl *decl =
1410 clang::CXXMethodDecl *
1413 const llvm::pdb::PDBSymbolFunc &method)
const {
1425 ":: Class '%s' has a method '%s' whose type cannot be completed.",
1428 if (TypeSystemClang::StartTagDeclarationDefinition(method_comp_type))
1429 TypeSystemClang::CompleteTagDeclarationDefinition(method_comp_type);
1439 nullptr, method_comp_type, access, method.isVirtual(),
1440 method.isStatic(), method.hasInlineAttribute(),
1443 method.isCompilerGenerated());