CodeGenFunction::GenerateBlockFunction() should initialize DebugInfo just like CodeGenFunction::GenerateCode()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127174 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index c11c264..aace5bb 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -873,7 +873,10 @@
                                        const DeclMapTy &ldm) {
   const BlockDecl *blockDecl = blockInfo.getBlockDecl();
 
-  DebugInfo = getDebugInfo();
+  // Check if we should generate debug info for this block function.
+  if (CGM.getModuleDebugInfo())
+    DebugInfo = CGM.getModuleDebugInfo();
+
   BlockInfo = &blockInfo;
 
   // Arrange for local static and local extern declarations to appear