[Lldb-commits] [lldb] [LLDB][NativePDB] Use typedef compiler type for typedef types (PR #156250)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 8 07:16:55 PDT 2025


================
@@ -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));
----------------
Michael137 wrote:

What use does `GetOrCreateType` have here? If that's not the thing that creates the correct `TypedefType`? Or in other words, could you elaborate on how this fixes the issue?

Is it that `GetOrCreateTypedefDecl` creates a new decl, but the associated `TypedefType` is different from the type created by `GetOrCreateType`? Does that mean we create two different typedefs? 

https://github.com/llvm/llvm-project/pull/156250


More information about the lldb-commits mailing list