summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-05-30 18:12:23 +0000
committerAdrian Prantl <aprantl@apple.com>2013-05-30 18:12:23 +0000
commit4c9a38a47ad73ef8a88f2ff577705100a9c61726 (patch)
tree052590cd39891ac475afd235b26c7c5fcba35098 /clang/lib/CodeGen/CGCall.cpp
parent4bb41e91dbfb226ec67fb8ea15e539ed0a597c3f (diff)
downloadbcm5719-llvm-4c9a38a47ad73ef8a88f2ff577705100a9c61726.tar.gz
bcm5719-llvm-4c9a38a47ad73ef8a88f2ff577705100a9c61726.zip
Do not reuse the debug location of the return value's store if there is autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups.
rdar://problem/13977888 llvm-svn: 182947
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 1ea16fe13a4..9a8edccdef0 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1667,8 +1667,10 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
// If there is a dominating store to ReturnValue, we can elide
// the load, zap the store, and usually zap the alloca.
if (llvm::StoreInst *SI = findDominatingStoreToReturnValue(*this)) {
- // Reuse the debug location from the store unless we're told not to.
- if (EmitRetDbgLoc)
+ // Reuse the debug location from the store unless there is
+ // cleanup code to be emitted between the store and return
+ // instruction.
+ if (EmitRetDbgLoc && !AutoreleaseResult)
RetDbgLoc = SI->getDebugLoc();
// Get the stored value and nuke the now-dead store.
RV = SI->getValueOperand();
OpenPOWER on IntegriCloud