[llvm-dev] How to get the TypeIndex for the class/structure given its member function's TypeIndex in PdbAstBuilder?

Zequan Wu via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 11 15:21:52 PST 2021


Hi,

I'm trying to call TypeSystemClang::AddMethodToCXXRecordType in
PdbAstBuilder::GetOrCreateFunctionDecl to create a function decl in the
case when the function is inside a record. It requires the record's type as
the first argument. So, I think I need to get its TypeIndex first. I tried
to do the following, but it fails to find the parent's TypeIndex.
type_id.index is the member function's TypeIndex.
auto iter = m_parent_types.find(type_id.index);

Am I using m_parent_types incorrectly? Or is there any other ways to get
the class/structure's TypeIndex?

Zequan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211111/f4392545/attachment-0001.html>


More information about the llvm-dev mailing list