================
@@ -2045,14 +2045,17 @@ TypeSP
SymbolFileNativePDB::CreateTypedef(PdbGlobalSymId id) {
if (!ts)
return nullptr;
- ts->GetNativePDBParser()->GetOrCreateTypedefDecl(id);
+ auto *typedef_decl = ts->GetNativePDBParser()->GetOrCreateTypedefDecl(id);
+
+ CompilerType ct = target_type->GetForwardCompilerType();
+ if (auto *clang = llvm::dyn_cast_or_null<TypeSystemClang>(ts.get()))
+ ct = clang->GetType(clang->getASTContext().getTypeDeclType(typedef_decl));
----------------
Nerixyz wrote:
This feels a bit wrong, because `PdbAstParser::GetOrCreateTypedefDecl` [already
knows this compiler
type](https://github.com/llvm/llvm-project/blob/2259a80c7d6d27879f4ecac31bafaf2cff778430/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp#L743-L744).
However, it returns a decl, so we need to go back through the AST to resolve
the type.
The method isn't used elsewhere, so the return type could be changed to a
`CompilerType`.
https://github.com/llvm/llvm-project/pull/156250
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits