Author: adrian Date: Sun Oct 4 18:23:04 2015 New Revision: 249282 URL: http://llvm.org/viewvc/llvm-project?rev=249282&view=rev Log: Module Debugging: Emit (ObjC) function declarations in the module scope when building a module.
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp cfe/trunk/test/Modules/ModuleDebugInfo.m Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=249282&r1=249281&r2=249282&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original) +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Sun Oct 4 18:23:04 2015 @@ -2731,7 +2731,7 @@ void CGDebugInfo::EmitFunctionDecl(Globa 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. Modified: cfe/trunk/test/Modules/ModuleDebugInfo.m URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.m?rev=249282&r1=249281&r2=249282&view=diff ============================================================================== --- cfe/trunk/test/Modules/ModuleDebugInfo.m (original) +++ cfe/trunk/test/Modules/ModuleDebugInfo.m Sun Oct 4 18:23:04 2015 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits