From: Adrian Prantl Date: Fri, 23 Oct 2015 17:02:22 +0000 (+0000) Subject: Module Debugging: Emit module debug info for types inside of Objective-C X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00338de6911d006a57da15f026facab01279afcc;p=clang Module Debugging: Emit module debug info for types inside of Objective-C containers. rdar://problem/23196170 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251120 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 7989b95a56..b397eb352a 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -171,6 +171,10 @@ public: return true; } + void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override { + HandleTopLevelDecl(D); + } + void HandleTagDeclDefinition(TagDecl *D) override { if (Diags.hasErrorOccurred()) return; diff --git a/test/Modules/ExtDebugInfo.m b/test/Modules/ExtDebugInfo.m index 9bf8bbfbdc..8e063f0904 100644 --- a/test/Modules/ExtDebugInfo.m +++ b/test/Modules/ExtDebugInfo.m @@ -19,6 +19,7 @@ #endif int foo(ObjCClass *c) { + InnerEnum e = e0; [c instanceMethodWithInt: 0]; return [c property]; } @@ -30,3 +31,6 @@ int foo(ObjCClass *c) { // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, // CHECK: ![[MOD]] = !DIModule(scope: null, name: {{.*}}DebugObjC // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, +// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME: scope: ![[MOD]], +// CHECK-SAME: flags: DIFlagFwdDecl) diff --git a/test/Modules/Inputs/DebugObjC.h b/test/Modules/Inputs/DebugObjC.h index 979871d33c..bde463abfd 100644 --- a/test/Modules/Inputs/DebugObjC.h +++ b/test/Modules/Inputs/DebugObjC.h @@ -12,3 +12,13 @@ @interface ObjCClass (Category) - categoryMethod; @end + +@protocol ObjCProtocol + +typedef enum { + e0 = 0 +} InnerEnum; + ++ (InnerEnum)protocolMethod; + +@end diff --git a/test/Modules/ModuleDebugInfo.m b/test/Modules/ModuleDebugInfo.m index 31132c558c..72f60798a7 100644 --- a/test/Modules/ModuleDebugInfo.m +++ b/test/Modules/ModuleDebugInfo.m @@ -33,6 +33,7 @@ // CHECK: !DISubprogram(name: "+[ObjCClass classMethod]" // CHECK: !DISubprogram(name: "-[ObjCClass instanceMethodWithInt:]" // CHECK: !DISubprogram(name: "-[ categoryMethod]" +// CHECK: !DITypedefType(name: "InnerEnum" // MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, // MODULE-CHECK-SAME: name: "FwdDecl",