@@ -38,16 +38,18 @@ struct CreateMethodDecl : public TypeVisitorCallbacks {
38
38
TypeIndex func_type_index,
39
39
clang::FunctionDecl *&function_decl,
40
40
lldb::opaque_compiler_type_t parent_ty,
41
- llvm::StringRef proc_name, CompilerType func_ct)
41
+ llvm::StringRef proc_name, ConstString mangled_name,
42
+ CompilerType func_ct)
42
43
: m_index(m_index), m_clang(m_clang), func_type_index(func_type_index),
43
44
function_decl (function_decl), parent_ty(parent_ty),
44
- proc_name(proc_name), func_ct(func_ct) {}
45
+ proc_name(proc_name), mangled_name(mangled_name), func_ct(func_ct) {}
45
46
PdbIndex &m_index;
46
47
TypeSystemClang &m_clang;
47
48
TypeIndex func_type_index;
48
49
clang::FunctionDecl *&function_decl;
49
50
lldb::opaque_compiler_type_t parent_ty;
50
51
llvm::StringRef proc_name;
52
+ ConstString mangled_name;
51
53
CompilerType func_ct;
52
54
53
55
llvm::Error visitKnownMember (CVMemberRecord &cvr,
@@ -87,8 +89,7 @@ struct CreateMethodDecl : public TypeVisitorCallbacks {
87
89
bool is_artificial = (options & MethodOptions::CompilerGenerated) ==
88
90
MethodOptions::CompilerGenerated;
89
91
function_decl = m_clang.AddMethodToCXXRecordType (
90
- parent_ty, proc_name,
91
- /* asm_label=*/ {}, func_ct, /* access=*/ access_type,
92
+ parent_ty, proc_name, mangled_name, func_ct, /* access=*/ access_type,
92
93
/* is_virtual=*/ is_virtual, /* is_static=*/ is_static,
93
94
/* is_inline=*/ false , /* is_explicit=*/ false ,
94
95
/* is_attr_used=*/ false , /* is_artificial=*/ is_artificial);
@@ -892,22 +893,26 @@ PdbAstBuilder::CreateFunctionDecl(PdbCompilandSymId func_id,
892
893
tag_record = CVTagRecord::create (index.tpi ().getType (*eti)).asTag ();
893
894
}
894
895
}
896
+
897
+ ConstString mangled_name (
898
+ pdb->FindMangledFunctionName (func_id).value_or (llvm::StringRef ()));
899
+
895
900
if (!tag_record.FieldList .isSimple ()) {
896
901
CVType field_list_cvt = index.tpi ().getType (tag_record.FieldList );
897
902
FieldListRecord field_list;
898
903
if (llvm::Error error = TypeDeserializer::deserializeAs<FieldListRecord>(
899
904
field_list_cvt, field_list))
900
905
llvm::consumeError (std::move (error));
901
906
CreateMethodDecl process (index, m_clang, func_ti, function_decl,
902
- parent_opaque_ty, func_name, func_ct);
907
+ parent_opaque_ty, func_name, mangled_name,
908
+ func_ct);
903
909
if (llvm::Error err = visitMemberRecordStream (field_list.Data , process))
904
910
llvm::consumeError (std::move (err));
905
911
}
906
912
907
913
if (!function_decl) {
908
914
function_decl = m_clang.AddMethodToCXXRecordType (
909
- parent_opaque_ty, func_name,
910
- /* asm_label=*/ {}, func_ct,
915
+ parent_opaque_ty, func_name, mangled_name, func_ct,
911
916
/* access=*/ lldb::AccessType::eAccessPublic,
912
917
/* is_virtual=*/ false , /* is_static=*/ false ,
913
918
/* is_inline=*/ false , /* is_explicit=*/ false ,
0 commit comments