瀏覽代碼

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

Adrian Prantl 9 年之前
父節點
當前提交
00338de691

+ 4 - 0
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;

+ 4 - 0
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)

+ 10 - 0
test/Modules/Inputs/DebugObjC.h

@@ -12,3 +12,13 @@
 @interface ObjCClass (Category)
 - categoryMethod;
 @end
+
+@protocol ObjCProtocol
+
+typedef enum {
+  e0 = 0
+}  InnerEnum;
+
++ (InnerEnum)protocolMethod;
+
+@end

+ 1 - 0
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",