[CGBlocks] Improve line info in backtraces containing *_helper_block
authorVedant Kumar <vsk@apple.com>
Thu, 26 Oct 2017 21:27:24 +0000 (21:27 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 26 Oct 2017 21:27:24 +0000 (21:27 +0000)
commit9c6b6826ce3720ca8bb9bd15f3abf71261e6b911
tree23815b2afd2e80e75af71423c667bf0cd891abcd
parented2d5402cb16e77dd2cf720a09b5638f6aa4ef33
[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
clang/lib/CodeGen/CGBlocks.cpp
clang/test/CodeGenObjC/debug-info-blocks.m