]> granicus.if.org Git - clang/commitdiff
Emit debug region end in unified return block.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 11 Nov 2008 20:59:54 +0000 (20:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 11 Nov 2008 20:59:54 +0000 (20:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp

index 1a26610d7523c30790d699c06ef481359d2fae97..bcd1e09800ebe06120a6641aa387e8800bc29bff 100644 (file)
@@ -70,18 +70,19 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
   // Finish emission of indirect switches.
   EmitIndirectSwitches();
 
-  // Emit debug descriptor for function end.
-  if (CGDebugInfo *DI = CGM.getDebugInfo()) {
-    DI->setLocation(EndLoc);
-    DI->EmitRegionEnd(CurFn, Builder);
-  }
   assert(BreakContinueStack.empty() &&
          "mismatched push/pop in break/continue stack!");
 
   // Emit function epilog (to return). This has the nice side effect
   // of also automatically handling code that falls off the end.
   EmitBlock(ReturnBlock);
+
+  // Emit debug descriptor for function end.
+  if (CGDebugInfo *DI = CGM.getDebugInfo()) {
+    DI->setLocation(EndLoc);
+    DI->EmitRegionEnd(CurFn, Builder);
+  }
+
   EmitFunctionEpilog(FnRetTy, ReturnValue);
 
   // Remove the AllocaInsertPt instruction, which is just a convenience for us.