r249031 - Module debugging: Also emit Objective-C interfaces forward declarations
Adrian Prantl via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 1 09:57:02 PDT 2015
Author: adrian
Date: Thu Oct 1 11:57:02 2015
New Revision: 249031
URL: http://llvm.org/viewvc/llvm-project?rev=249031&view=rev
Log:
Module debugging: Also emit Objective-C interfaces forward declarations
in their module scope when building a clang module.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/test/Modules/Inputs/DebugObjC.h
cfe/trunk/test/Modules/ModuleDebugInfo.m
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=249031&r1=249030&r2=249031&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Oct 1 11:57:02 2015
@@ -1663,9 +1663,10 @@ llvm::DIType *CGDebugInfo::CreateType(co
// debug type since we won't be able to lay out the entire type.
ObjCInterfaceDecl *Def = ID->getDefinition();
if (!Def || !Def->getImplementation()) {
+ llvm::DIScope *Mod = getParentModuleOrNull(ID);
llvm::DIType *FwdDecl = DBuilder.createReplaceableCompositeType(
- llvm::dwarf::DW_TAG_structure_type, ID->getName(), TheCU, DefUnit, Line,
- RuntimeLang);
+ llvm::dwarf::DW_TAG_structure_type, ID->getName(), Mod ? Mod : TheCU,
+ DefUnit, Line, RuntimeLang);
ObjCInterfaceCache.push_back(ObjCInterfaceCacheEntry(Ty, FwdDecl, Unit));
return FwdDecl;
}
Modified: cfe/trunk/test/Modules/Inputs/DebugObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DebugObjC.h?rev=249031&r1=249030&r2=249031&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/DebugObjC.h (original)
+++ cfe/trunk/test/Modules/Inputs/DebugObjC.h Thu Oct 1 11:57:02 2015
@@ -1,3 +1,5 @@
+ at class FwdDecl;
+
@interface ObjCClass {
int ivar;
}
Modified: cfe/trunk/test/Modules/ModuleDebugInfo.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.m?rev=249031&r1=249030&r2=249031&view=diff
==============================================================================
--- cfe/trunk/test/Modules/ModuleDebugInfo.m (original)
+++ cfe/trunk/test/Modules/ModuleDebugInfo.m Thu Oct 1 11:57:02 2015
@@ -20,6 +20,8 @@
// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC
// CHECK-SAME: isOptimized: false,
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
+// CHECK-SAME: name: "FwdDecl",
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-SAME: name: "ObjCClass",
// CHECK: !DIObjCProperty(name: "property",
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "ivar"
@@ -28,6 +30,9 @@
// CHECK: !DISubprogram(name: "-[ categoryMethod]"
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
-// MODULE-CHECK-SAME: name: "ObjCClass",
+// MODULE-CHECK-SAME: name: "FwdDecl",
// MODULE-CHECK-SAME: scope: ![[MODULE:[0-9]+]],
// MODULE-CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC"
+// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
+// MODULE-CHECK-SAME: name: "ObjCClass",
+// MODULE-CHECK-SAME: scope: ![[MODULE]],
More information about the cfe-commits
mailing list