Debug info for blocks: Fix a bug caught by the Verifier.
authorAdrian Prantl <aprantl@apple.com>
Fri, 21 Nov 2014 00:35:25 +0000 (00:35 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 21 Nov 2014 00:35:25 +0000 (00:35 +0000)
commit88eec39460db6bc00dcccaed44dbaa50c817e2fc
tree80e8870e63f4409051c6ed93f407dfc99e917085
parentb5b4dd81ba02bce1a9818841c5f33d876423e04f
Debug info for blocks: Fix a bug caught by the Verifier.
When emitting nested block definitions, the insert-at-point variant of
DIBuilder::insertDeclare() could be called with the insertion point set
to the end-of-BasicBlock sentinel, causing the parent pointer of the
CallInst to be set to the intentionally bogus value of the sentinel.

Fixed by conditionally invoking the correct version of insertDeclare().
rdar://problem/19034882

llvm-svn: 222487
clang/lib/CodeGen/CGBlocks.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGenObjC/debug-info-nested-blocks.m [new file with mode: 0644]