From d1b151ed7cfafbaf87ed8e3dbec0929a0d174460 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 17 Jan 2014 00:15:10 +0000 Subject: Debug info: Refactor NoLocation and ArtificialLocation to use a common base class and use it pervasively to restore debug locations. Fixes an interaction between cleanup and EH that caused the location to not be restored properly after emitting a landing pad. rdar://problem/15208190 llvm-svn: 199444 --- clang/lib/CodeGen/CGCleanup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGCleanup.cpp') diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp index c4e7880196e..4983ce93437 100644 --- a/clang/lib/CodeGen/CGCleanup.cpp +++ b/clang/lib/CodeGen/CGCleanup.cpp @@ -860,7 +860,9 @@ void CodeGenFunction::PopCleanupBlock(bool FallthroughIsBranchThrough) { // Emit the EH cleanup if required. if (RequiresEHCleanup) { - if (CGDebugInfo *DI = getDebugInfo()) + CGDebugInfo *DI = getDebugInfo(); + SaveAndRestoreLocation AutoRestoreLocation(*this, Builder); + if (DI) DI->EmitLocation(Builder, CurEHLocation); CGBuilderTy::InsertPoint SavedIP = Builder.saveAndClearIP(); -- cgit v1.2.3