summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-10-26 21:27:24 +0000
committerVedant Kumar <vsk@apple.com>2017-10-26 21:27:24 +0000
commit9c6b6826ce3720ca8bb9bd15f3abf71261e6b911 (patch)
tree23815b2afd2e80e75af71423c667bf0cd891abcd /clang/lib
parented2d5402cb16e77dd2cf720a09b5638f6aa4ef33 (diff)
downloadbcm5719-llvm-9c6b6826ce3720ca8bb9bd15f3abf71261e6b911.tar.gz
bcm5719-llvm-9c6b6826ce3720ca8bb9bd15f3abf71261e6b911.zip
[CGBlocks] Improve line info in backtraces containing *_helper_block
Instead of only setting a non-zero debug location on the return instruction in *_helper_block functions, set a proper location on all instructions within these functions. Pick the start location of the block literal expr for maximum clarity. The debugger does not step into *_helper_block functions during normal single-stepping because we mark their parameters as artificial. This is what we want (the functions are implicitly generated and uninteresting to most users). The stepping behavior is unchanged by this patch. rdar://32907581 Differential Revision: https://reviews.llvm.org/D39310 llvm-svn: 316704
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 0bd9d7c506c..8b798934055 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -1644,10 +1644,8 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) {
CGM.SetInternalFunctionAttributes(nullptr, Fn, FI);
- auto NL = ApplyDebugLocation::CreateEmpty(*this);
StartFunction(FD, C.VoidTy, Fn, FI, args);
- // Create a scope with an artificial location for the body of this function.
- auto AL = ApplyDebugLocation::CreateArtificial(*this);
+ ApplyDebugLocation NL{*this, blockInfo.getBlockExpr()->getLocStart()};
llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();
Address src = GetAddrOfLocalVar(&SrcDecl);
@@ -1816,10 +1814,8 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) {
CGM.SetInternalFunctionAttributes(nullptr, Fn, FI);
- // Create a scope with an artificial location for the body of this function.
- auto NL = ApplyDebugLocation::CreateEmpty(*this);
StartFunction(FD, C.VoidTy, Fn, FI, args);
- auto AL = ApplyDebugLocation::CreateArtificial(*this);
+ ApplyDebugLocation NL{*this, blockInfo.getBlockExpr()->getLocStart()};
llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();
OpenPOWER on IntegriCloud