// 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;
}
// 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"
// 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]],