]> granicus.if.org Git - clang/commitdiff
Module Debugging: Emit (ObjC) function declarations in the module scope
authorAdrian Prantl <aprantl@apple.com>
Sun, 4 Oct 2015 23:23:04 +0000 (23:23 +0000)
committerAdrian Prantl <aprantl@apple.com>
Sun, 4 Oct 2015 23:23:04 +0000 (23:23 +0000)
when building a module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249282 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/Modules/ModuleDebugInfo.m

index 4a5c16e219791735df7ee118feb43e0abd99df46..792b1b09a0f3fad556155156fdfb91f14243e1d2 100644 (file)
@@ -2731,7 +2731,7 @@ void CGDebugInfo::EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,
 
   unsigned Flags = 0;
   llvm::DIFile *Unit = getOrCreateFile(Loc);
-  llvm::DIScope *FDContext = Unit;
+  llvm::DIScope *FDContext = getDeclContextDescriptor(D);
   llvm::DINodeArray TParamsArray;
   if (isa<FunctionDecl>(D)) {
     // If there is a DISubprogram for this function available then use it.
index 8139343147833502ecbe8b77739de7f9d10eb41d..31132c558cab68d69c95c0e90e0c67fe9f63f945 100644 (file)
@@ -41,6 +41,8 @@
 // MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
 // MODULE-CHECK-SAME:             name: "ObjCClass",
 // MODULE-CHECK-SAME:             scope: ![[MODULE]],
+// MODULE-CHECK: !DISubprogram(name: "+[ObjCClass classMethod]",
+// MODULE-CHECK-SAME:          scope: ![[MODULE]],
 
 // The forward declaration should not be in the module scope.
 // MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file