[Lldb-commits] [clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 16 14:40:48 PST 2024
================
@@ -2995,20 +2995,21 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
if (!ID)
return nullptr;
+ auto RuntimeLang =
+ static_cast<llvm::dwarf::SourceLanguage>(TheCU->getSourceLanguage());
+
// Return a forward declaration if this type was imported from a clang module,
// and this is not the compile unit with the implementation of the type (which
// may contain hidden ivars).
if (DebugTypeExtRefs && ID->isFromASTFile() && ID->getDefinition() &&
!ID->getImplementation())
- return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
- ID->getName(),
- getDeclContextDescriptor(ID), Unit, 0);
+ return DBuilder.createForwardDecl(
+ llvm::dwarf::DW_TAG_structure_type, ID->getName(),
+ getDeclContextDescriptor(ID), Unit, 0, RuntimeLang);
----------------
adrian-prantl wrote:
Two things:
1. Shouldn't we do this only for ObjC class types?
2. Shouldn't — even in an ObjC++ CU — the runtimelang on an ObjC class be ObjC?
https://github.com/llvm/llvm-project/pull/120154
More information about the lldb-commits
mailing list