Module Debugging: Emit module debug info for types inside of Objective-C
authorAdrian Prantl <aprantl@apple.com>
Fri, 23 Oct 2015 17:02:22 +0000 (17:02 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 23 Oct 2015 17:02:22 +0000 (17:02 +0000)
containers.

rdar://problem/23196170

llvm-svn: 251120

clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
clang/test/Modules/ExtDebugInfo.m
clang/test/Modules/Inputs/DebugObjC.h
clang/test/Modules/ModuleDebugInfo.m

index 7989b95..b397eb3 100644 (file)
@@ -171,6 +171,10 @@ public:
     return true;
   }
 
+  void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override {
+    HandleTopLevelDecl(D);
+  }
+
   void HandleTagDeclDefinition(TagDecl *D) override {
     if (Diags.hasErrorOccurred())
       return;
index 9bf8bbf..8e063f0 100644 (file)
@@ -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)
index 979871d..bde463a 100644 (file)
 @interface ObjCClass (Category)
 - categoryMethod;
 @end
+
+@protocol ObjCProtocol
+
+typedef enum {
+  e0 = 0
+}  InnerEnum;
+
++ (InnerEnum)protocolMethod;
+
+@end
index 31132c5..72f6079 100644 (file)
@@ -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",