[Lldb-commits] [clang] [lldb] [clang][DebugInfo][gmodules] Set runtimeLang on ObjC forward declarations (PR #120154)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 16 14:49:18 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);
----------------
Michael137 wrote:
This overload is specifically for `const ObjCInterfaceType *Ty`. So we're always dealing with ObjC classes here.
On line `3021` we're setting the RuntimeLang in the same way. I think we should stay consistent with whatever we attach to a definition. All the places in `dsymutil` and `LLDB` that read `DW_AT_APPLE_runtime_class` check for both `ObjC` and `ObjC++`. So looks like both are valid
https://github.com/llvm/llvm-project/pull/120154
More information about the lldb-commits
mailing list