diff options
| author | Adrian Prantl <aprantl@apple.com> | 2014-01-17 00:15:10 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2014-01-17 00:15:10 +0000 |
| commit | d1b151ed7cfafbaf87ed8e3dbec0929a0d174460 (patch) | |
| tree | b76f56cb882d22d75041025e29aa0f74a8ee68bf /clang/lib/CodeGen/CGException.cpp | |
| parent | 3dd73db411177d9b9bb67e96309ed85a792d87c8 (diff) | |
| download | bcm5719-llvm-d1b151ed7cfafbaf87ed8e3dbec0929a0d174460.tar.gz bcm5719-llvm-d1b151ed7cfafbaf87ed8e3dbec0929a0d174460.zip | |
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
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 8a43794281d..cc03b0a8d5b 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -766,11 +766,9 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { // Save the current IR generation state. CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP(); - SourceLocation SavedLocation; - if (CGDebugInfo *DI = getDebugInfo()) { - SavedLocation = DI->getLocation(); + SaveAndRestoreLocation AutoRestoreLocation(*this, Builder); + if (CGDebugInfo *DI = getDebugInfo()) DI->EmitLocation(Builder, CurEHLocation); - } const EHPersonality &personality = EHPersonality::get(getLangOpts()); @@ -892,8 +890,6 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { // Restore the old IR generation state. Builder.restoreIP(savedIP); - if (CGDebugInfo *DI = getDebugInfo()) - DI->EmitLocation(Builder, SavedLocation); return lpad; } |

